Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

dim_depot.go 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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("dim_depot", "店铺档案表").
  9. ID("dim_depot_id", 32).Comment("店铺编码主键").End().
  10. String("depot_id", 32).Comment("店铺编码").End().
  11. String("depot_name", 64).NotNull().Comment("渠道名称(如:天猫旗舰店)").End().
  12. String("depot_type", 32).NotNull().Comment("渠道类型(如:线上/线下/奥莱)").End().
  13. String("tenant_id", 8).NotNull().Comment("租户ID").End().
  14. String("city_id", 32).NotNull().Comment("店铺所在城市").End().
  15. String("depot_address", 32).NotNull().Comment("店铺地址").End().
  16. String("creator", 32).NotNull().Comment("创建人").End().
  17. DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End()
  18. r.RegisterTable(tb.Build())
  19. })
  20. }
  21. // DimDepot 店铺档案表结构体(原ConfigChannel调整为匹配表结构)
  22. type DimDepot struct {
  23. DimDepotID string `gorm:"column:dim_depot_id;type:varchar(32);primaryKey;comment:店铺编码主键"`
  24. DepotID string `gorm:"column:depot_id;type:varchar(32);comment:店铺编码"`
  25. DepotName string `gorm:"column:depot_name;type:varchar(64);not null;comment:渠道名称(如:天猫旗舰店)"`
  26. DepotType string `gorm:"column:depot_type;type:varchar(32);not null;comment:渠道类型(如:线上/线下/奥莱)"`
  27. TenantID string `gorm:"column:tenant_id;type:varchar(8);not null;comment:租户ID"`
  28. CityID string `gorm:"column:city_id;type:varchar(32);not null;comment:店铺所在城市"`
  29. DepotAddress string `gorm:"column:depot_address;type:varchar(32);not null;comment:店铺地址"`
  30. Creator string `gorm:"column:creator;type:varchar(32);not null;comment:创建人"`
  31. CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间"`
  32. }
  33. func (DimDepot) TableName() string {
  34. return "dim_depot"
  35. }