package define import ( "git.chuangxin1.com/csacred/toolkit/types" ) // FormID http request form of id type FormID struct { ID int `json:"id" form:"id" db:"id"` } // FormUser http request from of user type FormUser struct { Page int `json:"page" db:"page" form:"page" validate:"required,gt=0"` PageSize int `json:"pagesize" db:"pagesize" form:"pagesize" validate:"required,gte=5,lte=100"` Code int `json:"code" db:"code" form:"code"` Name string `json:"name" db:"name" form:"name" validate:"max=20"` ID int `json:"id" db:"id" form:"id"` } // FormUserChangePwd http request from of user change password type FormUserChangePwd struct { OldPwd string `json:"passwd" form:"passwd" validate:"required,min=2,max=20"` NewPwd string `json:"newpasswd" form:"newpasswd" validate:"required,min=2,max=20"` NewPwdConfirm string `json:"passwdconfirm" form:"passwdconfirm" validate:"required,min=2,max=20"` } // FormUserSignIn http request from of user sign type FormUserSignIn struct { Name string `form:"name" db:"phone" validate:"required,min=2,max=20"` Password string `form:"passwd" validate:"required,min=2,max=20"` } // User user type User struct { ID int `json:"id"` Phone string `json:"phone"` Name string `json:"name"` Passwd string `json:"passwd"` Sex string `json:"sex"` Birthday types.DateText `json:"birthday"` //* Country types.NullInt `json:"country"` Province types.NullInt `json:"province"` City types.NullInt `json:"city"` Nation types.NullInt `json:"nation"` // */ Avatar types.NullString `json:"avatar"` Signature types.NullString `json:"signature"` Category int `json:"category"` Scale int `json:"scale"` Score int `json:"score"` Balance float32 `json:"balance"` Status int `json:"status"` Stime string `json:"stime"` Attr types.JSONText `json:"attr"` }