Dockerfile
This commit is contained in:
7
model/config/capacity.go
Normal file
7
model/config/capacity.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package config
|
||||
|
||||
type Capacity struct {
|
||||
CapacityUnit string `bson:"capacityUnit" json:"capacityUnit"` // 容量单位(具体单位值)
|
||||
MaxCapacity int `bson:"maxCapacity" json:"maxCapacity"` // 最大容量
|
||||
CurrentCapacity int `bson:"currentCapacity" json:"currentCapacity"` // 当前容量
|
||||
}
|
||||
9
model/config/interface.go
Normal file
9
model/config/interface.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"assets/consts/asset"
|
||||
)
|
||||
|
||||
type AssetConfigInterface interface {
|
||||
GetType() consts.AssetType
|
||||
}
|
||||
12
model/config/physical.go
Normal file
12
model/config/physical.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package config
|
||||
|
||||
// PhysicalAssetConfig 实物资产配置
|
||||
type PhysicalAssetConfig struct {
|
||||
Shipping *ShippingConfig `json:"shipping,omitempty"` // 配送配置
|
||||
}
|
||||
|
||||
// ShippingConfig 配送配置
|
||||
type ShippingConfig struct {
|
||||
DeliveryMethod string `json:"deliveryMethod"` // 配送方式:express快递/self_pickup自提
|
||||
//DeliveryTime int `bson:"deliveryTime" json:"deliveryTime"` // 配送时效(小时)
|
||||
}
|
||||
45
model/config/service.go
Normal file
45
model/config/service.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"assets/consts/asset"
|
||||
)
|
||||
|
||||
// ServiceAssetConfig 服务资产配置
|
||||
type ServiceAssetConfig struct {
|
||||
ServiceAssetType consts.ServiceAssetType `json:"serviceAssetType"`
|
||||
ServiceAssetArrivalConfig *ServiceAssetArrivalConfig `json:"serviceAssetArrivalConfig"`
|
||||
}
|
||||
|
||||
type ServiceAssetArrivalConfig struct {
|
||||
Schedule *ScheduleConfig `json:"schedule,omitempty"` // 排期配置
|
||||
Booking *BookingConfig `json:"booking,omitempty"` // 预订配置
|
||||
}
|
||||
|
||||
// ScheduleConfig 排期配置
|
||||
type ScheduleConfig struct {
|
||||
TimeSlots []*TimeSlot `json:"timeSlots"` // 时间段定义
|
||||
Exceptions []*ScheduleException `json:"exceptions,omitempty"` // 例外日期
|
||||
}
|
||||
|
||||
// BookingConfig 预订配置
|
||||
type BookingConfig struct {
|
||||
MinAdvance int `json:"minAdvance,omitempty"` // 最小提前时间(分钟)
|
||||
MinDuration int `json:"minDuration,omitempty"` // 最小预订时长(分钟)
|
||||
CancelWindow int `json:"cancelWindow,omitempty"` // 取消窗口(分钟)
|
||||
}
|
||||
|
||||
// TimeSlot 时间段
|
||||
type TimeSlot struct {
|
||||
DayOfWeek string `bson:"dayOfWeek" json:"dayOfWeek"` // 星期几(1-7)
|
||||
StartTime string `bson:"startTime" json:"startTime"` // 开始时间 HH:mm
|
||||
EndTime string `bson:"endTime" json:"endTime"` // 结束时间 HH:mm
|
||||
Capacity int `bson:"capacity,omitempty" json:"capacity,omitempty"` // 容量限制
|
||||
}
|
||||
|
||||
// ScheduleException 排期例外
|
||||
type ScheduleException struct {
|
||||
Date string `bson:"date" json:"date"` // 日期 YYYY-MM-DD
|
||||
Status int `bson:"status" json:"status"` // 状态,1:可用,0:不可用
|
||||
Reason string `bson:"reason,omitempty" json:"reason,omitempty"` // 原因
|
||||
DayOfWeek string `bson:"dayOfWeek" json:"dayOfWeek"` // 星期几(1-7)
|
||||
}
|
||||
19
model/config/virtual.go
Normal file
19
model/config/virtual.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package config
|
||||
|
||||
// VirtualAssetConfig 虚拟资产配置
|
||||
type VirtualAssetConfig struct {
|
||||
VirtualAssetType string `json:"virtualType"`
|
||||
CollectionPrice int `json:"collectionPrice"` // 合集价格(分为单位)
|
||||
Currency string `json:"currency"` // 货币单位,默认CNY
|
||||
ApiConfig *ApiConfig `json:"apiConfig"`
|
||||
}
|
||||
|
||||
// ApiConfig API配置(虚拟资产专用)
|
||||
type ApiConfig struct {
|
||||
Method string `json:"method"` // HTTP方法:GET/POST/PUT/DELETE
|
||||
RequestURL string `json:"requestURL"` // 请求地址
|
||||
Headers map[string]string `json:"headers"` // 请求头配置
|
||||
Params map[string]string `json:"params"` // 请求参数配置
|
||||
AuthType string `json:"authType"` // 认证类型:none/apikey/bearer/oauth
|
||||
AuthConfig string `json:"authConfig"` // 认证配置
|
||||
}
|
||||
Reference in New Issue
Block a user