project_account.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * @description: 视图层 用户
  3. * @Author: CP
  4. * @Date: 2020-09-08 16:27:54
  5. * @FilePath: \construction_management\web\viewmodels\project_account.go
  6. */
  7. package viewmodels
  8. import validation "github.com/go-ozzo/ozzo-validation/v3"
  9. type ProjectAccount struct {
  10. Id string `form:"id"`
  11. ProjectId int `form:"projectid"`
  12. Account string `form:"account"`
  13. Name string `form:"name"`
  14. Company string `form:"company"`
  15. Role string `form:"role"`
  16. Mobile string `form:"mobile"`
  17. Telephone string `form:"telephone"`
  18. // LastLogin int `xorm:"comment('最后登录时间') INT(11)"`
  19. // AccountGroup int `xorm:"comment('所属账号组') TINYINT(4)"`
  20. // EnterpriseId int `xorm:"comment('企业id') INT(11)"`
  21. // CreateTime int `xorm:"comment('创建时间') INT(11)"`
  22. // IsAdmin int `xorm:"comment('是否为管理员 1为管理员') TINYINT(1)"`
  23. // Enable int `xorm:"comment('是否启用 1为启用') TINYINT(1)"`
  24. // AuthMobile string `xorm:"comment('认证手机') VARCHAR(32)"`
  25. // Permission string `xorm:"comment('权限') TEXT"`
  26. // Cooperation int `xorm:"comment('协作') TINYINT(4)"`
  27. // LastNotice time.Time `xorm:"comment('待办事项,通知') DATETIME"`
  28. // SignPath string `xorm:"comment('电子签名图片地址') VARCHAR(512)"`
  29. // SessionToken string `xorm:"comment('token信息验证') VARCHAR(128)"`
  30. // SmsType string `xorm:"comment('短信通知类型') TEXT"`
  31. // WxType string `xorm:"comment('微信通知类型') TEXT"`
  32. // Bind int `xorm:"comment('是否已绑定定制项目') TINYINT(1)"`
  33. // WxOpenid string `xorm:"comment('微信绑定openid') VARCHAR(64)"`
  34. // WxName string `xorm:"comment('微信昵称') VARCHAR(255)"`
  35. Csrf string `form:"csrf"`
  36. }
  37. func (l ProjectAccount) Validate() error {
  38. return validation.ValidateStruct(&l,
  39. validation.Field(&l.Name, validation.Required.Error("姓名不能为空")),
  40. validation.Field(&l.Company, validation.Required.Error("单位不能为空")),
  41. )
  42. }