tg_user_bind.go 1.4 KB

12345678910111213141516171819202122232425262728
  1. package app
  2. import "time"
  3. // TgUserBind Telegram用户绑定信息
  4. type TgUserBind struct {
  5. Id int64 `json:"id" gorm:"column:id;type:bigint;comment:id;primarykey;NOT NULL"`
  6. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;comment:创建时间"`
  7. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;comment:更新时间"`
  8. UserId int64 `json:"userId" gorm:"column:user_id;type:bigint;index;comment:平台用户ID;NOT NULL"`
  9. TelegramId int64 `json:"telegramId" gorm:"column:telegram_id;type:bigint;uniqueIndex;comment:Telegram用户ID;NOT NULL"`
  10. TelegramUsername string `json:"telegramUsername" gorm:"column:telegram_username;type:varchar(255);comment:Telegram用户名"`
  11. TelegramFirstName string `json:"telegramFirstName" gorm:"column:telegram_first_name;type:varchar(255);comment:Telegram名字"`
  12. BindStatus int `json:"bindStatus" gorm:"column:bind_status;type:tinyint;default:1;comment:绑定状态: 1=已绑定, 0=已解绑"`
  13. BindTime time.Time `json:"bindTime" gorm:"column:bind_time;type:timestamp;default:CURRENT_TIMESTAMP;comment:绑定时间"`
  14. }
  15. func (*TgUserBind) TableName() string {
  16. return "magic_tg_user_bind"
  17. }
  18. func (*TgUserBind) Comment() string {
  19. return "Telegram用户绑定表"
  20. }
  21. func NewTgUserBind() *TgUserBind {
  22. return &TgUserBind{}
  23. }