1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- package controllers
-
- import "sws_xcx/service"
-
- type SysDicApiController struct {
- BaseApiController
- }
-
- // @Title GetIllness
- // @Description 获取病情字典
- // @Success 200 {array} models.DicResp success
- // @Failure 500 error
- // @router /getillness [get]
- func (c *SysDicApiController) GetIllness() {
- s := service.NewSysDicService()
- dics, err := s.GetDicsByType("ILLNESS")
- if err != nil {
- c.ServeDynamicFailJsonSend(err.Error())
- return
- }
-
- c.ServeSuccessJSON(s.Transform(dics))
- }
-
- // @Title GetRenalStatus
- // @Description 获取肾功能情况列表
- // @Success 200 {array} models.DicResp success
- // @Failure 500 error
- // @router /getrenalstatus [get]
- func (c *SysDicApiController) GetRenalStatus() {
- s := service.NewSysDicService()
- dics, err := s.GetDicsByType("RENAL")
- if err != nil {
- c.ServeDynamicFailJsonSend(err.Error())
- return
- }
-
- c.ServeSuccessJSON(s.Transform(dics))
- }
-
- // @Title GetDeviceTypes
- // @Description 获取设备类型列表
- // @Success 200 {array} models.DicResp success
- // @Failure 500 error
- // @router /getdevicetypes [get]
- func (c *SysDicApiController) GetDeviceTypes() {
- s := service.NewSysDicService()
- dics, err := s.GetDicsByType("DEVICE_TYPE")
- if err != nil {
- c.ServeDynamicFailJsonSend(err.Error())
- return
- }
-
- c.ServeSuccessJSON(s.Transform(dics))
- }
-
- // @Title GetCheckItems
- // @Description 获取检测项目列表
- // @Success 200 {array} models.CheckItem success
- // @Failure 500 error
- // @router /getcheckitems [get]
- func (c *SysDicApiController) GetCheckItems() {
- s := service.NewCheckItemService()
- dics, err := s.GetCheckItems("cn", "")
- if err != nil {
- c.ServeDynamicFailJsonSend(err.Error())
- return
- }
- c.ServeSuccessJSON(dics)
- }
|