修改了获取医生是否可处方图标展示状态的业务判断
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
requestsV1 "hospital-open-api/api/requests/v1"
|
||||
"hospital-open-api/api/responses"
|
||||
serviceV1 "hospital-open-api/api/service/v1"
|
||||
"hospital-open-api/global"
|
||||
"hospital-open-api/utils"
|
||||
)
|
||||
|
||||
type Coupon struct{}
|
||||
|
||||
// GetMultiDoctor 获取多点执业医生详情
|
||||
func (r *Coupon) GetMultiDoctor(c *gin.Context) {
|
||||
userDoctorRequest := requestsV1.UserDoctorRequest{}
|
||||
req := userDoctorRequest.GetMultiDoctor
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
// 业务处理
|
||||
userDoctorService := serviceV1.UserDoctorService{}
|
||||
getMultiDoctorResponses, err := userDoctorService.GetMultiDoctor(req)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
responses.OkWithData(getMultiDoctorResponses, c)
|
||||
}
|
||||
@@ -98,6 +98,13 @@ func (r *UserDoctor) GetUserDoctorPage(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
userDoctorService := serviceV1.UserDoctorService{}
|
||||
for _, respons := range userDoctor {
|
||||
if len(respons.DoctorInquiryConfig) > 0 {
|
||||
respons.MultiPointStatus, _ = userDoctorService.GetDoctorMultiPointEnable(respons.DoctorInquiryConfig)
|
||||
}
|
||||
}
|
||||
|
||||
// 处理返回值
|
||||
getUserDoctorPageResponses := dtoV1.GetUserDoctorPageListDto(userDoctor)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user