Dockerfile
This commit is contained in:
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)
|
||||
}
|
||||
Reference in New Issue
Block a user