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

30 lines
1.7 KiB
Go

package model
import (
"time"
"gorm.io/gorm"
)
// WeComApplication 企业微信自建应用及加密连接凭据。
type WeComApplication struct {
gorm.Model
CorpID string `gorm:"column:corp_id;type:varchar(64);not null;uniqueIndex:uq_wecom_application_identity,priority:1,where:deleted_at IS NULL" json:"corp_id"`
AgentID int64 `gorm:"column:agent_id;type:bigint;not null;uniqueIndex:uq_wecom_application_identity,priority:2,where:deleted_at IS NULL" json:"agent_id"`
Name string `gorm:"column:name;type:varchar(100);not null" json:"name"`
SecretCiphertext []byte `gorm:"column:secret_ciphertext;type:bytea;not null" json:"-"`
CallbackTokenCiphertext []byte `gorm:"column:callback_token_ciphertext;type:bytea;not null" json:"-"`
EncodingAESKeyCiphertext []byte `gorm:"column:encoding_aes_key_ciphertext;type:bytea;not null" json:"-"`
DefaultCreatorUserID string `gorm:"column:default_creator_userid;type:varchar(64);not null;default:''" json:"default_creator_userid"`
DefaultCreatorName string `gorm:"column:default_creator_name;type:varchar(100);not null;default:''" json:"default_creator_name"`
Status int `gorm:"column:status;type:int;not null;default:1" json:"status"`
CreatedBy uint `gorm:"column:created_by;not null" json:"created_by"`
UpdatedBy uint `gorm:"column:updated_by;not null" json:"updated_by"`
LastConnectedAt *time.Time `gorm:"column:last_connected_at;type:timestamptz" json:"last_connected_at,omitempty"`
}
// TableName 指定企业微信应用表名。
func (WeComApplication) TableName() string {
return "tb_wecom_application"
}