29 lines
1.7 KiB
Go
29 lines
1.7 KiB
Go
package models
|
|
|
|
// Warehouse 仓库表
|
|
type Warehouse struct {
|
|
ID int64 `json:"id" gorm:"primarykey;comment:仓库ID"`
|
|
LogisticsID int64 `json:"logistics_id" gorm:"not null;default:0;index;comment:所属物流模板ID"`
|
|
Code string `json:"code" gorm:"size:50;not null;default:'';uniqueIndex:uk_code;comment:仓库编码"`
|
|
Name string `json:"name" gorm:"size:100;not null;default:'';comment:仓库名称"`
|
|
Type int8 `json:"type" gorm:"not null;default:1;comment:仓库类型(1:主仓库,2:备用仓库,3:中转仓库)"`
|
|
ContactPerson string `json:"contact_person" gorm:"size:50;default:'';comment:联系人"`
|
|
ContactPhone string `json:"contact_phone" gorm:"size:20;default:'';comment:联系电话"`
|
|
Province string `json:"province" gorm:"size:50;default:'';comment:省份"`
|
|
City string `json:"city" gorm:"size:50;default:'';comment:城市"`
|
|
District string `json:"district" gorm:"size:50;default:'';comment:区县"`
|
|
Address string `json:"address" gorm:"size:255;not null;default:'';comment:仓库地址"`
|
|
Status int8 `json:"status" gorm:"type:tinyint(1);not null;default:1;comment:状态(0:禁用,1:启用)"`
|
|
CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;comment:创建时间戳(秒)"`
|
|
UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;not null;default:0;comment:更新时间戳(秒)"`
|
|
IsDel int8 `json:"is_del" gorm:"type:tinyint(1);not null;default:0;comment:逻辑删除标记(0:未删除,1:已删除)"`
|
|
}
|
|
|
|
func (Warehouse) TableName() string {
|
|
return "warehouse"
|
|
}
|
|
|
|
func (Warehouse) TableOptions() string {
|
|
return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='仓库表'"
|
|
}
|