12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- package controllers
- import (
- "hongze/hz_crm_api/models"
- "hongze/hz_crm_api/services"
- )
- type ResearchGroupController struct {
- BaseAuthController
- }
- // GetResearchGroupList
- // @Title 获取研究方向分组列表
- // @Description 获取研究方向分组列表
- // @Success 200 {object} services.ResearchGroupItem 获取成功
- // @router /research_group/list [get]
- func (this *ResearchGroupController) GetResearchGroupList() {
- br := new(models.BaseResponse).Init()
- defer func() {
- this.Data["json"] = br
- this.ServeJSON()
- }()
- include, _ := this.GetInt("Include")
- list, err := services.GetResearchGroupTree(include)
- if err != nil {
- br.Msg = "获取分组失败"
- br.ErrMsg = "GetResearchGroupList ErrMsg:" + err.Error()
- return
- }
- br.Ret = 200
- br.Success = true
- br.Msg = "获取成功"
- br.Data = list
- }
- // GetAdminResearchGroup
- // @Title 获取研究员研究方向
- // @Description 获取研究员研究方向
- // @Param AdminId query int true "研究员ID"
- // @Success 200 {object} models.ResearchGroupRelation 获取成功
- // @router /research_group/admin_group [get]
- func (this *ResearchGroupController) GetAdminResearchGroup() {
- br := new(models.BaseResponse).Init()
- defer func() {
- this.Data["json"] = br
- this.ServeJSON()
- }()
- adminId, _ := this.GetInt("AdminId")
- if adminId == 0 {
- br.Msg = "参数有误"
- return
- }
- //list, err := system.ResearchGroupRelationListByAdminId(adminId)
- list, err := models.ResearchTagRelationListByAdminId(adminId)
- if err != nil {
- br.Msg = "获取研究方向失败"
- br.ErrMsg = "GetAdminResearchGroup ErrMsg:" + err.Error()
- return
- }
- br.Ret = 200
- br.Success = true
- br.Msg = "获取成功"
- br.Data = list
- }
|