暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

config_channel.go 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package tables
  2. import (
  3. "time"
  4. "git.x2erp.com/qdy/go-db/sqldef"
  5. )
  6. func init() {
  7. sqldef.AddRegistration(func(r *sqldef.Registry) {
  8. tb := sqldef.NewTable("config_channel", "渠道档案表").
  9. ID("channel_id", 32).Comment("渠道编码,主键").End().
  10. String("channel_name", 64).NotNull().Comment("渠道名称(如:天猫旗舰店)").End().
  11. String("channel_type", 32).NotNull().Comment("渠道类型(如:线上/线下/奥莱)").End().
  12. String("store_id", 32).Comment("关联门店/仓库ID,对应ERP编码").End().
  13. String("tenant_id", 8).NotNull().Comment("租户ID").End().
  14. String("store_group_id", 32).NotNull().Comment("所属店铺组").End().
  15. String("creator", 32).NotNull().Comment("创建人").End().
  16. DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End()
  17. r.RegisterTable(tb.Build())
  18. })
  19. }
  20. // ConfigChannel 渠道档案表结构体
  21. type ConfigChannel struct {
  22. ChannelID string `gorm:"column:channel_id;type:varchar(32);primaryKey;not null;comment:渠道编码,主键"`
  23. ChannelName string `gorm:"column:channel_name;type:varchar(64);not null;comment:渠道名称(如:天猫旗舰店)"`
  24. ChannelType string `gorm:"column:channel_type;type:varchar(32);not null;comment:渠道类型(如:线上/线下/奥莱)"`
  25. StoreID string `gorm:"column:store_id;type:varchar(32);comment:关联门店/仓库ID,对应ERP编码"`
  26. TenantId string `gorm:"column:tenant_id;type:varchar(8);comment:租户ID"`
  27. Creator string `gorm:"column:creator;type:varchar(32);not null;comment:创建人"`
  28. CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;comment:创建时间"`
  29. StoreGroupID string `gorm:"column:store_group_id;type:varchar(32);comment:所属店铺组"`
  30. }
  31. func (ConfigChannel) TableName() string {
  32. return "config_channel"
  33. }