修改自定义科室
This commit is contained in:
@@ -3,8 +3,10 @@ package controller
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"hospital-admin-api/api/dao"
|
||||
"hospital-admin-api/api/requests"
|
||||
"hospital-admin-api/api/responses"
|
||||
"hospital-admin-api/api/responses/hosDepCustomResponse"
|
||||
"hospital-admin-api/global"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
@@ -14,7 +16,7 @@ type Department struct{}
|
||||
// GetDepartmentCustomList 获取自定义科室列表
|
||||
func (b *Department) GetDepartmentCustomList(c *gin.Context) {
|
||||
departmentRequest := requests.DepartmentRequest{}
|
||||
if err := c.ShouldBindJSON(&departmentRequest.GetDepartmentCustomList); err != nil {
|
||||
if err := c.ShouldBind(&departmentRequest.GetDepartmentCustomList); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
@@ -25,7 +27,15 @@ func (b *Department) GetDepartmentCustomList(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
hospitalDepartmentCustomDao := dao.HospitalDepartmentCustom{}
|
||||
|
||||
hospitalDepartmentCustom, err := hospitalDepartmentCustomDao.GetHospitalDepartmentCustomList(departmentRequest.GetDepartmentCustomList)
|
||||
if err != nil {
|
||||
responses.Ok(c)
|
||||
return
|
||||
}
|
||||
|
||||
// 处理返回值
|
||||
// getDepartmentListResponse := hosDepCustomResponse.GetHospitalDepartmentCustomListResponse(hospitalDepartmentCustom)
|
||||
// responses.OkWithData(getDepartmentListResponse, c)
|
||||
getDepartmentListResponse := hosDepCustomResponse.GetHospitalDepartmentCustomListResponse(hospitalDepartmentCustom)
|
||||
responses.OkWithData(getDepartmentListResponse, c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user