1
This commit is contained in:
parent
b99f67fb19
commit
26a884d3e3
@ -189,7 +189,7 @@ func (r *InquiryConfig) GetSystemInquiryConfigPage(c *gin.Context) {
|
|||||||
responses.OkWithData(result, c)
|
responses.OkWithData(result, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSystemInquiryConfig 系统问诊配置详情
|
// GetSystemInquiryConfig 系统问诊配置详情-id
|
||||||
func (r *InquiryConfig) GetSystemInquiryConfig(c *gin.Context) {
|
func (r *InquiryConfig) GetSystemInquiryConfig(c *gin.Context) {
|
||||||
id := c.Param("system_inquiry_config_id")
|
id := c.Param("system_inquiry_config_id")
|
||||||
if id == "" {
|
if id == "" {
|
||||||
@ -263,3 +263,29 @@ func (r *InquiryConfig) PutSystemInquiryConfig(c *gin.Context) {
|
|||||||
|
|
||||||
responses.Ok(c)
|
responses.Ok(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetSystemInquiryConfigDetail 系统问诊配置详情-条件
|
||||||
|
func (r *InquiryConfig) GetSystemInquiryConfigDetail(c *gin.Context) {
|
||||||
|
inquiryConfigRequest := requests.InquiryConfigRequest{}
|
||||||
|
req := inquiryConfigRequest.GetSystemInquiryConfigDetail
|
||||||
|
if err := c.ShouldBind(&req); err != nil {
|
||||||
|
responses.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 参数验证
|
||||||
|
if err := global.Validate.Struct(req); err != nil {
|
||||||
|
responses.FailWithMessage(utils.Translate(err), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 业务处理
|
||||||
|
systemInquiryConfigService := service.SystemInquiryConfigService{}
|
||||||
|
res, err := systemInquiryConfigService.GetSystemInquiryConfigDetail(req)
|
||||||
|
if err != nil {
|
||||||
|
responses.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
responses.OkWithData(res, c)
|
||||||
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
package requests
|
package requests
|
||||||
|
|
||||||
type InquiryConfigRequest struct {
|
type InquiryConfigRequest struct {
|
||||||
GetDoctorInquiryConfigPage // 获取开启问诊配置医生列表-分页
|
GetDoctorInquiryConfigPage // 获取开启问诊配置医生列表-分页
|
||||||
PutDoctorInquiryConfig // 修改医生问诊配置
|
PutDoctorInquiryConfig // 修改医生问诊配置
|
||||||
AddDoctorInquiryConfig // 新增医生问诊配置
|
AddDoctorInquiryConfig // 新增医生问诊配置
|
||||||
GetSystemInquiryConfigPage // 获取系统问诊配置列表-分页
|
GetSystemInquiryConfigPage // 获取系统问诊配置列表-分页
|
||||||
PutSystemInquiryConfig // 修改系统问诊配置
|
PutSystemInquiryConfig // 修改系统问诊配置
|
||||||
|
GetSystemInquiryConfigDetail // 系统问诊配置详情-条件
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDoctorInquiryConfigPage 获取开启问诊配置医生列表-分页
|
// GetDoctorInquiryConfigPage 获取开启问诊配置医生列表-分页
|
||||||
@ -72,3 +73,9 @@ type SystemInquiryTime struct {
|
|||||||
StartTime string `json:"start_time" label:"开始时间"`
|
StartTime string `json:"start_time" label:"开始时间"`
|
||||||
EndTime string `json:"end_time" label:"结束时间"`
|
EndTime string `json:"end_time" label:"结束时间"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetSystemInquiryConfigDetail 系统问诊配置详情-条件
|
||||||
|
type GetSystemInquiryConfigDetail struct {
|
||||||
|
InquiryType *int `json:"inquiry_type" form:"inquiry_type" validate:"required,oneof=1 2 3 4 5" label:"问诊类型"` // 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测
|
||||||
|
InquiryMode *int `json:"inquiry_mode" form:"inquiry_mode" validate:"required,oneof=1 2 3 4 5" label:"问诊方式"` // 1:图文 2:视频 3:语音 4:电话 5:会员
|
||||||
|
}
|
||||||
|
|||||||
@ -493,11 +493,14 @@ func privateRouter(r *gin.Engine, api controller.Api) {
|
|||||||
// 获取系统问诊配置列表-分页
|
// 获取系统问诊配置列表-分页
|
||||||
systemGroup.GET("", api.InquiryConfig.GetSystemInquiryConfigPage)
|
systemGroup.GET("", api.InquiryConfig.GetSystemInquiryConfigPage)
|
||||||
|
|
||||||
// 系统问诊配置详情
|
// 系统问诊配置详情-id
|
||||||
systemGroup.GET("/:system_inquiry_config_id", api.InquiryConfig.GetSystemInquiryConfig)
|
systemGroup.GET("/:system_inquiry_config_id", api.InquiryConfig.GetSystemInquiryConfig)
|
||||||
|
|
||||||
// 修改系统问诊配置
|
// 修改系统问诊配置
|
||||||
systemGroup.PUT("/:system_inquiry_config_id", api.InquiryConfig.PutSystemInquiryConfig)
|
systemGroup.PUT("/:system_inquiry_config_id", api.InquiryConfig.PutSystemInquiryConfig)
|
||||||
|
|
||||||
|
// 系统问诊配置详情-条件
|
||||||
|
systemGroup.GET("/detail", api.InquiryConfig.GetSystemInquiryConfigDetail)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -617,3 +617,29 @@ func (r *SystemInquiryConfigService) PutSystemInquiryConfig(systemInquiryConfigI
|
|||||||
tx.Commit()
|
tx.Commit()
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetSystemInquiryConfigDetail 系统问诊配置详情-条件
|
||||||
|
func (r *SystemInquiryConfigService) GetSystemInquiryConfigDetail(req requests.GetSystemInquiryConfigDetail) (res *dto.SystemInquiryConfigDto, err error) {
|
||||||
|
// 获取系统问诊配置
|
||||||
|
systemInquiryConfigDao := dao.SystemInquiryConfigDao{}
|
||||||
|
|
||||||
|
maps := make(map[string]interface{})
|
||||||
|
maps["inquiry_type"] = req.InquiryType
|
||||||
|
maps["inquiry_mode"] = req.InquiryMode
|
||||||
|
systemInquiryConfig, err := systemInquiryConfigDao.GetSystemInquiryConfig(maps)
|
||||||
|
if err != nil || systemInquiryConfig == nil {
|
||||||
|
return nil, errors.New("数据错误")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取系统问诊时间
|
||||||
|
systemInquiryTimeDao := dao.SystemInquiryTimeDao{}
|
||||||
|
systemInquiryTimes, err := systemInquiryTimeDao.GetSystemInquiryTimeListBySystemInquiryConfigId(systemInquiryConfig.SystemInquiryConfigId)
|
||||||
|
|
||||||
|
// 处理返回值
|
||||||
|
res = dto.GetSystemInquiryConfigDto(systemInquiryConfig)
|
||||||
|
|
||||||
|
// 加载系统问诊时间
|
||||||
|
res.LoadSystemInquiryTime(systemInquiryTimes)
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user