research_group.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package controllers
  2. import (
  3. "eta_gn/eta_api/models"
  4. )
  5. type ResearchGroupController struct {
  6. BaseAuthController
  7. }
  8. // GetResearchGroupList
  9. // @Title 获取研究方向分组列表
  10. // @Description 获取研究方向分组列表
  11. // @Success 200 {object} services.ResearchGroupItem 获取成功
  12. // @router /research_group/list [get]
  13. func (this *ResearchGroupController) GetResearchGroupList() {
  14. br := new(models.BaseResponse).Init()
  15. defer func() {
  16. this.Data["json"] = br
  17. this.ServeJSON()
  18. }()
  19. br.Ret = 200
  20. br.Success = true
  21. br.Msg = "操作成功"
  22. return
  23. }
  24. // GetAdminResearchGroup
  25. // @Title 获取研究员研究方向
  26. // @Description 获取研究员研究方向
  27. // @Param AdminId query int true "研究员ID"
  28. // @Success 200 {object} models.ResearchGroupRelation 获取成功
  29. // @router /research_group/admin_group [get]
  30. func (this *ResearchGroupController) GetAdminResearchGroup() {
  31. br := new(models.BaseResponse).Init()
  32. defer func() {
  33. this.Data["json"] = br
  34. this.ServeJSON()
  35. }()
  36. adminId, _ := this.GetInt("AdminId")
  37. if adminId == 0 {
  38. br.Msg = "参数有误"
  39. return
  40. }
  41. br.Ret = 200
  42. br.Success = true
  43. br.Msg = "获取成功"
  44. return
  45. }