新增医生问诊配置
This commit is contained in:
@@ -120,3 +120,29 @@ func (r *InquiryConfig) PutDoctorInquiryConfig(c *gin.Context) {
|
||||
|
||||
responses.Ok(c)
|
||||
}
|
||||
|
||||
// AddDoctorInquiryConfig 新增医生问诊配置
|
||||
func (r *InquiryConfig) AddDoctorInquiryConfig(c *gin.Context) {
|
||||
inquiryConfigRequest := requests.InquiryConfigRequest{}
|
||||
req := inquiryConfigRequest.AddDoctorInquiryConfig
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(req); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 业务处理
|
||||
doctorInquiryConfigService := service.DoctorInquiryConfigService{}
|
||||
_, err := doctorInquiryConfigService.AddDoctorInquiryConfig(req)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
responses.Ok(c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user