Files
assets/model/config/service.go
2026-03-18 10:18:03 +08:00

46 lines
1.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
}