9111cb26e7
CI / admin (push) Has been skipped
CI / bff (push) Has been skipped
CI / chore (push) Has been skipped
CI / express (push) Has been skipped
CI / product (push) Has been skipped
CI / sale (push) Has been skipped
CI / user (push) Has been skipped
CI / wecom (push) Has been skipped
CI / changes (push) Successful in 12s
CI / ad (push) Successful in 0s
56 lines
2.0 KiB
Go
56 lines
2.0 KiB
Go
package dao
|
|
|
|
import "lone-services/pkg/utils"
|
|
|
|
const (
|
|
UserTypeAdmin uint8 = 1 // 管理员
|
|
UserTypeSale uint8 = 2 // 销售
|
|
|
|
StatusEnabled uint8 = 1 // 启用
|
|
StatusDisabled uint8 = 2 // 禁用
|
|
)
|
|
|
|
// WecomUser 用户企业微信绑定
|
|
type WecomUser struct {
|
|
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
|
UserId int64 `gorm:"column:user_id" json:"user_id"`
|
|
Type uint8 `gorm:"column:type" json:"type"`
|
|
WecomUserId string `gorm:"column:wecom_user_id" json:"wecom_user_id"`
|
|
Name string `gorm:"column:name" json:"name"`
|
|
Mobile string `gorm:"column:mobile" json:"mobile"`
|
|
Avatar string `gorm:"column:avatar" json:"avatar"`
|
|
Status uint8 `gorm:"column:status" json:"status"`
|
|
AgentIds string `gorm:"column:agent_ids;type:json" json:"agent_ids"`
|
|
CreatedAt utils.CustomTime `gorm:"column:created_at" json:"created_at"`
|
|
UpdatedAt utils.CustomTime `gorm:"column:updated_at" json:"updated_at"`
|
|
}
|
|
|
|
// UserAgentItem 用户绑定的应用快照
|
|
type UserAgentItem struct {
|
|
Id int64 `json:"id"`
|
|
AgentId int64 `json:"agent_id"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type UserListItem struct {
|
|
Id int64 `json:"id"`
|
|
UserId int64 `json:"user_id"`
|
|
Type uint8 `json:"type"`
|
|
TypeText string `json:"type_text"`
|
|
Name string `json:"name"`
|
|
Mobile string `json:"mobile"`
|
|
OriginMobile string `json:"origin_mobile"`
|
|
Avatar string `json:"avatar"`
|
|
Status uint8 `json:"status"`
|
|
BizName string `json:"biz_name"`
|
|
WecomUserId string `json:"wecom_user_id"`
|
|
Agents []UserAgentItem `json:"agents"`
|
|
CreatedAt string `json:"created_at"`
|
|
UpdatedAt string `json:"updated_at"`
|
|
}
|
|
|
|
type UserTypeOption struct {
|
|
ID uint8 `json:"id"`
|
|
Name string `json:"name"`
|
|
}
|