user.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. package advisory
  2. import (
  3. "hongze/hz_crm_api/controllers"
  4. "hongze/hz_crm_api/models"
  5. "hongze/hz_crm_api/models/advisory"
  6. )
  7. // 每日资讯
  8. type AdminUserController struct {
  9. controllers.BaseAuthController
  10. }
  11. // @Title 获取关注的所有分类
  12. // @Description 获取关注的所有分类接口
  13. // @Success Ret=200 {object} models.MyChartPermissionResp
  14. // @router /getmyfllow [get]
  15. func (this *AdminUserController) GetMyFllow() {
  16. br := new(models.BaseResponse).Init()
  17. defer func() {
  18. this.Data["json"] = br
  19. this.ServeJSON()
  20. }()
  21. AdminUser := this.SysUser
  22. if AdminUser == nil {
  23. br.Msg = "请登录"
  24. br.ErrMsg = "请登录,用户信息为空"
  25. br.Ret = 408
  26. return
  27. }
  28. list, err := advisory.GetChartPermissionList()
  29. if err != nil {
  30. br.Msg = "获取用户关注分类信息失败"
  31. br.ErrMsg = "获取用户关注分类信息失败,Err:" + err.Error()
  32. return
  33. }
  34. resp := new(advisory.MyChartPermissionResp)
  35. resp.List = list
  36. br.Ret = 200
  37. br.Success = true
  38. br.Msg = "获取成功"
  39. br.Data = resp
  40. //if AdminUser.RoleTypeCode == "admin"{
  41. // list, err := advisory.GetChartPermissionList()
  42. // if err != nil {
  43. // br.Msg = "获取用户关注分类信息失败"
  44. // br.ErrMsg = "获取用户关注分类信息失败,Err:" + err.Error()
  45. // return
  46. // }
  47. // resp := new(advisory.MyChartPermissionResp)
  48. // resp.List = list
  49. // br.Ret = 200
  50. // br.Success = true
  51. // br.Msg = "获取成功"
  52. // br.Data = resp
  53. //}else{
  54. // userFllowInfo, err := advisory.GetUserFllowInfo(AdminUser.AdminId)
  55. // if userFllowInfo == nil {
  56. // br.Msg = "该用户暂未关注"
  57. // br.ErrMsg = "请关注,userFllowInfo Is Empty"
  58. // br.Ret = 408
  59. // return
  60. // }
  61. // if err != nil {
  62. // br.Msg = "获取用户关注分类信息失败"
  63. // br.ErrMsg = "获取用户关注分类信息失败,Err:" + err.Error()
  64. // return
  65. // }
  66. // list, err := advisory.GetChartPermissionByIds(userFllowInfo.ChartPermissionId)
  67. // resp := new(advisory.MyChartPermissionResp)
  68. // resp.List = list
  69. // br.Ret = 200
  70. // br.Success = true
  71. // br.Msg = "获取成功"
  72. // br.Data = resp
  73. //}
  74. }