70 lines
2.9 KiB
Go
70 lines
2.9 KiB
Go
package model
|
||
|
||
const (
|
||
StoreStatusDisabled = -1
|
||
StoreStatusClosed = 0
|
||
StoreStatusOpened = 1
|
||
)
|
||
|
||
const (
|
||
MainSubStoreName = "本店"
|
||
MainSubStoreAddress = "本店"
|
||
)
|
||
|
||
// 配送范围类型,此定义与京东到家相同,除非特殊说明,本系统中的坐标都是火星坐标
|
||
const (
|
||
DeliveryRangeTypePolygon = 2
|
||
DeliveryRangeTypeRadius = 3
|
||
)
|
||
|
||
type Store struct {
|
||
ModelIDCUO
|
||
Name string `gorm:"type:varchar(255);unique_index" json:"name"`
|
||
CityCode int `json:"cityCode"` // todo ?
|
||
DistrictCode int `json:"districtCode"` // todo ?
|
||
Address string `gorm:"type:varchar(255)" json:"address"`
|
||
Tel1 string `gorm:"type:varchar(32)" json:"tel1"`
|
||
Tel2 string `gorm:"type:varchar(32)" json:"tel2"`
|
||
OpenTime1 int16 `json:"openTime1"` // 930就表示9点半,用两个的原因是为了支持中午休息,1与2的时间段不能交叉,为0表示没有
|
||
CloseTime1 int16 `json:"closeTime1"` // 格式同上
|
||
OpenTime2 int16 `json:"openTime2"` // 格式同上
|
||
CloseTime2 int16 `json:"closeTime2"` // 格式同上
|
||
Lng int `json:"lng"` // 乘了10的6次方
|
||
Lat int `json:"lat"` // 乘了10的6次方
|
||
DeliveryRangeType int8 `json:"deliveryRangeType"` // 参见相关常量定义
|
||
DeliveryRange string `gorm:"type:varchar(2048)" json:"deliveryRange"` // 如果DeliveryRangeType为DeliveryRangeTypePolygon,则为逗号分隔坐标,分号分隔的坐标点(坐标与Lng和Lat一样,都是整数),比如 121361504,31189308;121420555,31150238。否则为半径,单位为米
|
||
Status int `json:"status"`
|
||
}
|
||
|
||
type StoreSub struct {
|
||
ModelIDCUO
|
||
StoreID int `gorm:"unique_index:unique_index1"`
|
||
Index int `gorm:"unique_index:unique_index1"` // 子店序号,为0表示主店
|
||
Name string `gorm:"type:varchar(255)"`
|
||
Address string `gorm:"type:varchar(255)"`
|
||
Status int // 取值同Store.Status
|
||
Mobile1 string `gorm:"type:varchar(32)"`
|
||
Mobile2 string `gorm:"type:varchar(32)"`
|
||
Mobile3 string `gorm:"type:varchar(32)"`
|
||
}
|
||
|
||
type StoreMap struct {
|
||
ModelIDCUO
|
||
StoreID int `gorm:"unique_index:storemap1"`
|
||
VendorID int `gorm:"unique_index:storemap1"`
|
||
VendorStoreID string `gorm:"type:varchar(48);unique_index"`
|
||
Status int // 取值同Store.Status
|
||
|
||
AutoPickup int8 // 是否自动拣货
|
||
DeliveryType int8 // 配送类型
|
||
DeliveryCompetition int8 // 是否支持配送竞争
|
||
}
|
||
|
||
type StoreCourierMap struct {
|
||
ModelIDCUO
|
||
StoreID int `gorm:"unique_index:storemap1"`
|
||
VendorID int `gorm:"unique_index:storemap1"`
|
||
VendorStoreID string `gorm:"type:varchar(48);unique_index"`
|
||
Status int
|
||
}
|