新增专长
This commit is contained in:
@@ -25,6 +25,7 @@ type userDoctorManage struct {
|
||||
|
||||
// Basic 基础数据
|
||||
type basic struct {
|
||||
Department // 科室管理
|
||||
Hospital // 医院管理
|
||||
Department // 科室管理
|
||||
Hospital // 医院管理
|
||||
DiseaseClassExpertise // 专长管理
|
||||
}
|
||||
|
||||
@@ -29,28 +29,7 @@ func (b *Department) GetDepartmentCustomList(c *gin.Context) {
|
||||
|
||||
hospitalDepartmentCustomDao := dao.HospitalDepartmentCustom{}
|
||||
|
||||
maps := make(map[string]interface{})
|
||||
if departmentRequest.DepartmentId != "" {
|
||||
maps["department_id"] = departmentRequest.DepartmentId
|
||||
}
|
||||
|
||||
if departmentRequest.DepartmentCustomName != "" {
|
||||
maps["department_custom_name"] = departmentRequest.DepartmentCustomName
|
||||
}
|
||||
|
||||
if departmentRequest.DepartmentName != "" {
|
||||
maps["department_name"] = departmentRequest.DepartmentName
|
||||
}
|
||||
|
||||
if departmentRequest.DepartmentCode != "" {
|
||||
maps["department_code"] = departmentRequest.DepartmentCode
|
||||
}
|
||||
|
||||
if departmentRequest.DepartmentStatus != 0 {
|
||||
maps["department_status"] = departmentRequest.DepartmentStatus
|
||||
}
|
||||
|
||||
hospitalDepartmentCustom, err := hospitalDepartmentCustomDao.GetHospitalDepartmentCustomList(maps)
|
||||
hospitalDepartmentCustom, err := hospitalDepartmentCustomDao.GetHospitalDepartmentCustomListByMaps(departmentRequest.GetDepartmentCustomList)
|
||||
if err != nil {
|
||||
responses.Ok(c)
|
||||
return
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
// Package controller 专长
|
||||
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/diseaseClassExpertiseResponse"
|
||||
"hospital-admin-api/global"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
type DiseaseClassExpertise struct{}
|
||||
|
||||
// GetExpertiseList 获取专长列表
|
||||
func (b *DiseaseClassExpertise) GetExpertiseList(c *gin.Context) {
|
||||
expertiseRequest := requests.ExpertiseRequest{}
|
||||
if err := c.ShouldBind(&expertiseRequest.GetExpertiseList); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(expertiseRequest.GetExpertiseList); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
diseaseClassExpertiseDao := dao.DiseaseClassExpertiseDao{}
|
||||
|
||||
diseaseClassExpertises, err := diseaseClassExpertiseDao.GetDiseaseClassExpertiseListByMaps(expertiseRequest.GetExpertiseList)
|
||||
if err != nil {
|
||||
responses.Ok(c)
|
||||
return
|
||||
}
|
||||
|
||||
// 处理返回值
|
||||
getDepartmentListResponse := diseaseClassExpertiseResponse.GetDiseaseClassExpertiseListResponse(diseaseClassExpertises)
|
||||
responses.OkWithData(getDepartmentListResponse, c)
|
||||
}
|
||||
Reference in New Issue
Block a user