tg_group.go 1.5 KB

1234567891011121314151617181920212223242526272829
  1. package app
  2. // TgGroup Telegram群组信息
  3. type TgGroup struct {
  4. Id int64 `json:"id" gorm:"column:id;type:bigint;comment:id;primarykey;NOT NULL"`
  5. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;comment:创建时间"`
  6. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;comment:更新时间"`
  7. ChatId int64 `json:"chatId" gorm:"column:chat_id;type:bigint;uniqueIndex;comment:Telegram群组ID;NOT NULL"`
  8. ChatType string `json:"chatType" gorm:"column:chat_type;type:varchar(20);comment:群组类型(group/supergroup/channel)"`
  9. Title string `json:"title" gorm:"column:title;type:varchar(255);comment:群组标题"`
  10. Username string `json:"username" gorm:"column:username;type:varchar(100);comment:群组用户名"`
  11. Description string `json:"description" gorm:"column:description;type:text;comment:群组描述"`
  12. MemberCount int `json:"memberCount" gorm:"column:member_count;type:int;comment:成员数量"`
  13. Status int8 `json:"status" gorm:"column:status;type:tinyint;default:1;comment:状态: 1=正常, 2=已禁用, 3=已退出"`
  14. BotJoinedAt int64 `json:"botJoinedAt" gorm:"column:bot_joined_at;type:bigint;comment:机器人加入时间"`
  15. Remark string `json:"remark" gorm:"column:remark;type:varchar(500);comment:备注"`
  16. }
  17. func (*TgGroup) TableName() string {
  18. return "magic_tg_group"
  19. }
  20. func NewTgGroup() *TgGroup {
  21. return &TgGroup{}
  22. }
  23. func (*TgGroup) Comment() string {
  24. return "Telegram群组信息表"
  25. }