修改系统问诊配置
This commit is contained in:
@@ -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