修改了入参代码格式
This commit is contained in:
parent
61ca263d0d
commit
adb89dd9a1
@ -17,28 +17,29 @@ type InquiryConfig struct{}
|
||||
|
||||
// GetDoctorInquiryConfigPage 获取开启问诊配置医生列表-分页
|
||||
func (r *InquiryConfig) GetDoctorInquiryConfigPage(c *gin.Context) {
|
||||
req := requests.InquiryConfigRequest{}
|
||||
if err := c.ShouldBind(&req.GetDoctorInquiryConfigPage); err != nil {
|
||||
inquiryConfigRequest := requests.InquiryConfigRequest{}
|
||||
req := inquiryConfigRequest.GetDoctorInquiryConfigPage
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(req.GetDoctorInquiryConfigPage); err != nil {
|
||||
if err := global.Validate.Struct(req); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
if req.GetDoctorInquiryConfigPage.Page == 0 {
|
||||
req.GetDoctorInquiryConfigPage.Page = 1
|
||||
if req.Page == 0 {
|
||||
req.Page = 1
|
||||
}
|
||||
|
||||
if req.GetDoctorInquiryConfigPage.PageSize == 0 {
|
||||
req.GetDoctorInquiryConfigPage.PageSize = 20
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = 20
|
||||
}
|
||||
|
||||
doctorInquiryConfigDao := dao.DoctorInquiryConfigDao{}
|
||||
doctorInquiryConfig, total, err := doctorInquiryConfigDao.GetUserDoctorPageSearch(req.GetDoctorInquiryConfigPage, req.GetDoctorInquiryConfigPage.Page, req.GetDoctorInquiryConfigPage.PageSize)
|
||||
doctorInquiryConfig, total, err := doctorInquiryConfigDao.GetUserDoctorPageSearch(req, req.Page, req.PageSize)
|
||||
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
@ -49,8 +50,8 @@ func (r *InquiryConfig) GetDoctorInquiryConfigPage(c *gin.Context) {
|
||||
res := dto.GetDoctorInquiryConfigListDto(doctorInquiryConfig)
|
||||
|
||||
result := make(map[string]interface{})
|
||||
result["page"] = req.GetDoctorInquiryConfigPage.Page
|
||||
result["page_size"] = req.GetDoctorInquiryConfigPage.PageSize
|
||||
result["page"] = req.Page
|
||||
result["page_size"] = req.PageSize
|
||||
result["total"] = total
|
||||
result["data"] = res
|
||||
responses.OkWithData(result, c)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user