package user import ( "git.sxidc.com/go-framework/baize/framework/core/domain" "git.sxidc.com/go-framework/baize/framework/core/domain/entity" "time" ) const ( FieldUserName = "UserName" FieldPassword = "Password" FieldName = "Name" FieldPhone = "Phone" FieldEmail = "Email" FieldToken = "Token" FieldLastLoginTime = "LastLoginTime" ) var ( ColumnUserName = domain.ColumnName(FieldUserName) ColumnPassword = domain.ColumnName(FieldPassword) ColumnName = domain.ColumnName(FieldName) ColumnPhone = domain.ColumnName(FieldPhone) ColumnEmail = domain.ColumnName(FieldEmail) ColumnToken = domain.ColumnName(FieldToken) ColumnLastLoginTime = domain.ColumnName(FieldLastLoginTime) ) var fieldMap = map[string]string{ FieldUserName: "用户名", FieldPassword: "密码", FieldName: "姓名", FieldPhone: "手机号", FieldEmail: "邮箱", FieldToken: "token", FieldLastLoginTime: "最近登录时间", } type Entity struct { entity.Base UserName string `sqlmapping:"column:user_name;notUpdate" sqlresult:"column:user_name" check:"required,lte=256,when=create"` Password string `sqlmapping:"column:password" sqlresult:"column:password" check:"required,lte=256,when=create/update"` Name string `sqlmapping:"column:name;updateClear" sqlresult:"column:name" check:"lte=256,when=create/update"` Phone string `sqlmapping:"column:phone;updateClear" sqlresult:"column:phone" check:"lte=128,when=create/update"` Email string `sqlmapping:"column:email;updateClear" sqlresult:"column:email" check:"lte=512,when=create/update"` Token string `sqlmapping:"column:token;notUpdate" sqlresult:"column:token"` LastLoginTime time.Time `sqlmapping:"column:last_login_time;notUpdate" sqlresult:"column:last_login_time" check:"required,timezero"` RoleIDs []string `sqlmapping:"-" sqlresult:"-"` entity.TimeFields } func (e *Entity) DomainCNName() string { return "用户" } func (e *Entity) DomainCamelName() string { return "User" } func (e *Entity) GetFieldMap() map[string]string { return fieldMap }