123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package dao
- import (
- "time"
- )
- type User struct {
- ID int64 `gorm:"primary_key" json:"id"`
- TenantId string `gorm:"type:varchar(12);default '000000'" json:"tenantId"`
- Code string `gorm:"type:varchar(12)" json:"code"`
- Account string `gorm:"type:varchar(12)" json:"account"`
- Password string `gorm:"type:varchar(12)" json:"password"`
- Name string `gorm:"type:varchar(12)" json:"name"`
- RealName string `gorm:"type:varchar(12)" json:"real_name"`
- Avatar string `gorm:"type:varchar(12)" json:"avatar"`
- Email string `gorm:"type:varchar(12)" json:"email"`
- Phone string `gorm:"type:varchar(12)" json:"phone"`
- Birthday string `gorm:"type:datetime" json:"birthday"`
- Sex int `gorm:"type:smallint" json:"sex"`
- RoleId string `gorm:"type:varchar(1000)" json:"role_id"`
- DeptId string `gorm:"type:varchar(1000)" json:"dept_id"`
- PostId string `gorm:"type:varchar(1000)" json:"post_id"`
- CreateUser int64 `gorm:"type:bigint" json:"createUser"`
- CreateDept int64 `gorm:"type:bigint" json:"createDept"`
- CreateTime time.Time `gorm:"type:datetime" json:"createTime"`
- UpdateUser int64 `gorm:"type:bigint" json:"updateUser"`
- UpdateTime time.Time `gorm:"type:datetime" json:"updateTime"`
- Status int `gorm:"type:int " json:"status"`
- IsDeleted int `gorm:"type:int" json:"isDeleted"`
- GroupId int `gorm:"type:int" json:"groupId"`
- BigScreenIndexCameraIds string `gorm:"type:varchar(255)" json:"bigScreenIndexCameraIds"`
- SecuritySixScreen string `gorm:"type:varchar(255)" json:"security_six_screen"`
- }
- func (User) TableName() string {
- return "user"
- }
- func (c *User) GetUser() error {
- return GDb.Model(&c).Where("id = ?", c.ID).Find(&c).Error
- }
|