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