新增创建者名称
This commit is contained in:
@@ -11,6 +11,7 @@ type Api struct {
|
||||
userPatientManage // 患者管理
|
||||
caseManage // 病例管理
|
||||
orderPrescriptionManage // 处方管理
|
||||
inquiryManage // 问诊管理
|
||||
}
|
||||
|
||||
// SysSetting 系统设置
|
||||
@@ -59,3 +60,8 @@ type caseManage struct {
|
||||
type orderPrescriptionManage struct {
|
||||
OrderPrescription // 处方列表
|
||||
}
|
||||
|
||||
// 问诊管理
|
||||
type inquiryManage struct {
|
||||
Inquiry // 问诊管理
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"hospital-admin-api/api/dao"
|
||||
"hospital-admin-api/api/dto"
|
||||
"hospital-admin-api/api/requests"
|
||||
"hospital-admin-api/api/responses"
|
||||
"hospital-admin-api/global"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
// Inquiry 问诊管理
|
||||
type Inquiry struct{}
|
||||
|
||||
// GetUserDoctorPage 获取医生列表-分页
|
||||
func (r *Inquiry) GetUserDoctorPage(c *gin.Context) {
|
||||
userDoctorRequest := requests.UserDoctorRequest{}
|
||||
if err := c.ShouldBind(&userDoctorRequest.GetUserDoctorPage); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(userDoctorRequest.GetUserDoctorPage); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
if userDoctorRequest.GetUserDoctorPage.Page == 0 {
|
||||
userDoctorRequest.GetUserDoctorPage.Page = 1
|
||||
}
|
||||
|
||||
if userDoctorRequest.GetUserDoctorPage.PageSize == 0 {
|
||||
userDoctorRequest.GetUserDoctorPage.PageSize = 20
|
||||
}
|
||||
|
||||
userDoctorDao := dao.UserDoctorDao{}
|
||||
userDoctor, total, err := userDoctorDao.GetUserDoctorPageSearch(userDoctorRequest.GetUserDoctorPage, userDoctorRequest.GetUserDoctorPage.Page, userDoctorRequest.GetUserDoctorPage.PageSize)
|
||||
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 处理返回值
|
||||
getUserDoctorPageResponses := dto.GetUserDoctorListDto(userDoctor)
|
||||
|
||||
result := make(map[string]interface{})
|
||||
result["page"] = userDoctorRequest.GetUserDoctorPage.Page
|
||||
result["page_size"] = userDoctorRequest.GetUserDoctorPage.PageSize
|
||||
result["total"] = total
|
||||
result["data"] = getUserDoctorPageResponses
|
||||
responses.OkWithData(result, c)
|
||||
}
|
||||
Reference in New Issue
Block a user