package controllers

import "sws_xcx/service"

type SysDicApiController struct {
	BaseApiController
}

// @Title GetIllness
// @Description 获取病情字典
// @Success 200 {object} models.type 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 {object} models.type 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))
}
