daShangDao_psiServer/models/employee.go
Administrator fafac05570 1.返回userlist
2.通过use_id,product_id 返回关联信息
2026-06-16 16:11:37 +08:00

48 lines
2.8 KiB
Go

package models
// Employee 员工
type Employee struct {
ID int64 `json:"id" gorm:"primarykey;comment:自增ID"`
EmployeeIDStr string `json:"employee_id_str" gorm:"size:10;not null;uniqueIndex"` // 工号
Fid int64 `json:"fid" gorm:"not null;default:0;comment:父级id"`
AboutId int64 `json:"about_id" gorm:"not null;default:0;comment:关联id"`
Code string `json:"code" gorm:"size:64;not null;default:'';comment:机械码"`
Username string `json:"username" gorm:"size:50;not null;default:'';comment:登录账号 (init_工号)"`
Password string `json:"password" gorm:"size:100;not null;default:'';comment:密码"`
Name string `json:"name" gorm:"size:50;not null;default:'';comment:姓名"`
Phone string `json:"phone" gorm:"size:11;not null;default:'';comment:手机号"`
Role int64 `json:"role" gorm:"not null;default:0;comment:权限"`
Status int8 `json:"status" gorm:"not null;default:1;comment:状态 1正常 0禁用"`
Score int64 `json:"score" gorm:"not null;default:0;comment:积分"`
SplitAccountConfigId int64 `json:"split_account_config_id" gorm:"not null;default:0;comment:分账配置ID"`
From string `json:"from" gorm:"size:50;not null;default:'';comment:来源"`
TypeId int8 `json:"type_id" gorm:"not null;default:0;comment:关联类型"`
LastLoginAt int64 `json:"last_login_at" gorm:"not null;default:0;comment:最后登录时间"`
LastLoginIP string `json:"last_login_ip" gorm:"size:20;not null;default:'';comment:最后登录ip"`
CreatedAt int64 `json:"created_at" gorm:"not null;default:0;comment:创建时间"`
UpdatedAt int64 `json:"updated_at" gorm:"not null;default:0;comment:更新时间"`
DeletedAt int64 `json:"deleted_at" gorm:"not null;default:0;comment:删除时间"`
ExpireTime int64 `json:"expire_time" gorm:"not null;default:0;comment:过期时间"`
}
// UpdateEmployeeSplitAccountConfigResponse 更新员工分账配置响应
type UpdateEmployeeSplitAccountConfigResponse struct {
ID int64 `json:"id"`
EmployeeIDStr string `json:"employee_id_str"`
Username string `json:"username"`
Name string `json:"name"`
Phone string `json:"phone"`
AboutId int64 `json:"about_id"`
SplitAccountConfigId int64 `json:"split_account_config_id"`
Status int8 `json:"status"`
UpdatedAt int64 `json:"updated_at"`
}
func (Employee) TableName() string {
return "employees"
}
func (Employee) TableOptions() string {
return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='员工表'"
}