瀏覽代碼

userAccount 添加创建时间和更新时间字段

fuwencai 4 年之前
父節點
當前提交
51a0b6ef1a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      model/user.go

+ 2 - 0
model/user.go

@@ -21,6 +21,8 @@ type UserAccount struct {
 	ID    int    `json:"id" gorm:"primaryKey"`
 	AppID string `json:"app_id"`
 	Money int    `json:"money"`
+	CreateAt  time.Time      `json:"-" gorm:"autoCreateTime"` //标签autoCreateTime设置如果字段名字不为CreatAt时候自动插入当前时间
+	UpdateAt  time.Time      `json:"-" gorm:"autoUpdateTime"`
 }
 
 func (p *UserAccount) TableName() string {