修改系统问诊配置
This commit is contained in:
@@ -6,17 +6,18 @@ import (
|
||||
)
|
||||
|
||||
type SystemInquiryConfigDto struct {
|
||||
SystemInquiryConfigId string `json:"system_inquiry_config_id"` // 主键id
|
||||
InquiryType int `json:"inquiry_type"` // 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
InquiryMode int `json:"inquiry_mode"` // 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
MaxWorkNumDay int `json:"max_work_num_day"` // 每日最大接诊数量
|
||||
InquiryPrice string `json:"inquiry_price"` // 接诊价格
|
||||
MinInquiryPrice *float64 `json:"min_inquiry_price"` // 最低接诊价格(专家问诊)
|
||||
MaxInquiryPrice *float64 `json:"max_inquiry_price"` // 最高接诊价格(专家问诊)
|
||||
TimesNumber int `json:"times_number"` // 沟通次数(0为不限制次数)
|
||||
Duration int `json:"duration"` // 沟通时长(分钟,0为不限制时长)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
SystemInquiryConfigId string `json:"system_inquiry_config_id"` // 主键id
|
||||
InquiryType int `json:"inquiry_type"` // 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
InquiryMode int `json:"inquiry_mode"` // 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
MaxWorkNumDay int `json:"max_work_num_day"` // 每日最大接诊数量
|
||||
InquiryPrice string `json:"inquiry_price"` // 接诊价格
|
||||
MinInquiryPrice *float64 `json:"min_inquiry_price"` // 最低接诊价格(专家问诊)
|
||||
MaxInquiryPrice *float64 `json:"max_inquiry_price"` // 最高接诊价格(专家问诊)
|
||||
TimesNumber int `json:"times_number"` // 沟通次数(0为不限制次数)
|
||||
Duration int `json:"duration"` // 沟通时长(分钟,0为不限制时长)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
SystemInquiryTime []*SystemInquiryTimeDto `json:"system_inquiry_time"` // 系统问诊时间配置
|
||||
}
|
||||
|
||||
func GetSystemInquiryConfigDto(m *model.SystemInquiryConfig) *SystemInquiryConfigDto {
|
||||
@@ -76,3 +77,11 @@ func GetSystemInquiryConfigListDto(m []*model.SystemInquiryConfig) []*SystemInqu
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// LoadSystemInquiryTime 加载系统问诊时间
|
||||
func (r *SystemInquiryConfigDto) LoadSystemInquiryTime(m []*model.SystemInquiryTime) *SystemInquiryConfigDto {
|
||||
if len(m) > 0 {
|
||||
r.SystemInquiryTime = GetSystemInquiryTimeListDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type SystemInquiryTimeDto struct {
|
||||
InquiryTimeId string `json:"inquiry_time_id"` // 主键id
|
||||
SystemInquiryConfigId string `json:"system_inquiry_config_id"` // 系统配置主键id;NOT NULL
|
||||
StartTime string `json:"start_time"` // 开始时间
|
||||
EndTime string `json:"end_time"` // 结束时间
|
||||
TimeInterval string `json:"time_interval"` // 时段(上午、中午、下午、夜间、全天)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetSystemInquiryTimeDto(m *model.SystemInquiryTime) *SystemInquiryTimeDto {
|
||||
return &SystemInquiryTimeDto{
|
||||
InquiryTimeId: fmt.Sprintf("%d", m.InquiryTimeId),
|
||||
SystemInquiryConfigId: fmt.Sprintf("%d", m.SystemInquiryConfigId),
|
||||
StartTime: m.StartTime[:2] + ":" + m.StartTime[2:],
|
||||
EndTime: m.EndTime[:2] + ":" + m.EndTime[2:],
|
||||
TimeInterval: m.TimeInterval,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetSystemInquiryTimeListDto(m []*model.SystemInquiryTime) []*SystemInquiryTimeDto {
|
||||
// 处理返回值
|
||||
responses := make([]*SystemInquiryTimeDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &SystemInquiryTimeDto{
|
||||
InquiryTimeId: fmt.Sprintf("%d", v.InquiryTimeId),
|
||||
SystemInquiryConfigId: fmt.Sprintf("%d", v.SystemInquiryConfigId),
|
||||
StartTime: v.StartTime[:2] + ":" + v.StartTime[2:],
|
||||
EndTime: v.EndTime[:2] + ":" + v.EndTime[2:],
|
||||
TimeInterval: v.TimeInterval,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
Reference in New Issue
Block a user