123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- package controllers
- import (
- "eta/eta_api/models"
- "eta/eta_api/services"
- "eta/eta_api/utils"
- )
- type ResearchGroupController struct {
- BaseAuthController
- }
- func (this *ResearchGroupController) GetResearchGroupList() {
- br := new(models.BaseResponse).Init()
- defer func() {
- this.Data["json"] = br
- this.ServeJSON()
- }()
- if utils.BusinessCode != utils.BusinessCodeRelease && utils.BusinessCode != utils.BusinessCodeSandbox && utils.BusinessCode != utils.BusinessCodeDebug {
- br.Ret = 200
- br.Success = true
- br.Msg = "操作成功"
- return
- }
- 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
- }
- 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
- }
- if utils.BusinessCode != utils.BusinessCodeRelease && utils.BusinessCode != utils.BusinessCodeSandbox && utils.BusinessCode != utils.BusinessCodeDebug {
- br.Ret = 200
- br.Success = true
- br.Msg = "获取成功"
- return
- }
-
- 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
- }
|