1
This commit is contained in:
parent
1c108f8a1f
commit
2cf45830ff
@ -4,14 +4,29 @@ 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"
|
||||
)
|
||||
|
||||
type Department struct{}
|
||||
|
||||
// GetDepartmentList 获取自定义科室列表
|
||||
func (b *Department) GetDepartmentList(c *gin.Context) {
|
||||
// GetDepartmentCustomList 获取自定义科室列表
|
||||
func (b *Department) GetDepartmentCustomList(c *gin.Context) {
|
||||
departmentRequest := requests.DepartmentRequest{}
|
||||
if err := c.ShouldBindJSON(&departmentRequest.GetDepartmentCustomList); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(departmentRequest.GetDepartmentCustomList); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
hospitalDepartmentCustomDao := dao.HospitalDepartmentCustom{}
|
||||
|
||||
maps := make(map[string]interface{})
|
||||
|
||||
@ -150,6 +150,8 @@ func Auth() gin.HandlerFunc {
|
||||
"code": consts.SERVER_ERROR,
|
||||
"data": "",
|
||||
})
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
// 接口无需验证权限
|
||||
|
||||
14
api/requests/department.go
Normal file
14
api/requests/department.go
Normal file
@ -0,0 +1,14 @@
|
||||
package requests
|
||||
|
||||
type DepartmentRequest struct {
|
||||
GetDepartmentCustomList // 获取自定义科室列表
|
||||
}
|
||||
|
||||
// GetDepartmentCustomList 获取自定义科室列表
|
||||
type GetDepartmentCustomList struct {
|
||||
DepartmentId string `json:"department_id" form:"department_id" label:"医院科室-标准id"`
|
||||
DepartmentCustomName string `json:"department_custom_name" form:"department_custom_name" label:"科室名称-自定义"`
|
||||
DepartmentName string `json:"department_name" form:"department_name" label:"科室名称-标准"`
|
||||
DepartmentCode string `json:"department_code" form:"department_code" label:"科室编码-标准"`
|
||||
DepartmentStatus int `json:"department_status" form:"department_status" label:"状态"` // (1:正常 2:删除)
|
||||
}
|
||||
@ -249,14 +249,14 @@ func privateRouter(r *gin.Engine, api controller.Api) {
|
||||
// doctorGroup.PUT("/:post_id", api.Post.PutPost)
|
||||
}
|
||||
|
||||
// 科室
|
||||
// 科室管理-基础数据
|
||||
departmentGroup := adminGroup.Group("/department")
|
||||
{
|
||||
// 自定义科室
|
||||
customGroup := departmentGroup.Group("/custom")
|
||||
{
|
||||
// 获取自定义科室列表
|
||||
customGroup.GET("/list", api.Department.GetDepartmentList)
|
||||
customGroup.GET("/list", api.Department.GetDepartmentCustomList)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user