Files
junhong_cmp_fiber/internal/model/wecom_member.go
break 73f5125d3d
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m26s
七月迭代短暂完结,还有很多后端的关键东西没有弄,这是一版赶时间做的东西
2026-07-25 17:06:58 +08:00

27 lines
1.4 KiB
Go

package model
import (
"time"
"gorm.io/datatypes"
)
// WeComMember 是企业微信应用可见成员的本地选择快照,不承担组织模型职责。
type WeComMember struct {
ID uint `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
ApplicationID uint `gorm:"column:application_id;not null;uniqueIndex:uq_wecom_member_identity,priority:1" json:"application_id"`
CorpID string `gorm:"column:corp_id;type:varchar(64);not null" json:"corp_id"`
UserID string `gorm:"column:userid;type:varchar(64);not null;uniqueIndex:uq_wecom_member_identity,priority:2" json:"userid"`
Name string `gorm:"column:name;type:varchar(100);not null" json:"name"`
DepartmentIDs datatypes.JSON `gorm:"column:department_ids;type:jsonb;not null;default:'[]'" json:"department_ids"`
Visible bool `gorm:"column:visible;not null;default:true;index" json:"visible"`
SyncedAt time.Time `gorm:"column:synced_at;type:timestamptz;not null" json:"synced_at"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamptz;not null;autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamptz;not null;autoUpdateTime" json:"updated_at"`
}
// TableName 指定企业微信可见成员快照表名。
func (WeComMember) TableName() string {
return "tb_wecom_member"
}