// Package entity 数据实体 package entity import ( "time" "gorm.io/datatypes" ) // PlatformUser 平台用户关联信息 type PlatformUser struct { ID int64 `gorm:"column:id;primaryKey;autoIncrement;comment:平台用户ID(自增)" json:"id"` UserID int64 `gorm:"column:user_id;comment:关联t_user.id" json:"userId"` PlatformType int8 `gorm:"column:platform_type;comment:平台类型:1-微信小程序,2-抖音小程序,3-支付宝小程序" json:"platformType"` PlatformOpenID string `gorm:"column:platform_openid;comment:平台唯一标识(微信openid/抖音open_id)" json:"platformOpenid"` PlatformUnionID string `gorm:"column:platform_unionid;comment:平台统一标识(微信unionid,多小程序互通用)" json:"platformUnionid"` PlatformSessionKey string `gorm:"column:platform_session_key;comment:平台会话密钥(微信session_key,加密存储)" json:"platformSessionKey"` PlatformExtra datatypes.JSONMap `gorm:"column:platform_extra;comment:平台扩展字段(如抖音的user_name、微信的city等)" json:"platformExtra"` LastLoginTime *time.Time `gorm:"column:last_login_time;comment:最后登录时间" json:"lastLoginTime"` CreateTime time.Time `gorm:"column:create_time;autoCreateTime;comment:创建时间" json:"createTime"` UpdateTime time.Time `gorm:"column:update_time;autoUpdateTime;comment:更新时间" json:"updateTime"` Deleted int8 `gorm:"column:deleted;comment:软删除:0-未删,1-已删" json:"deleted"` } // TableName 指定表名 func (PlatformUser) TableName() string { return "t_platform_user" }