company_permission.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package controllers
  2. import (
  3. "eta_gn/eta_api/models"
  4. "eta_gn/eta_api/models/company"
  5. )
  6. // CompanyPermissionController 客户权限管理
  7. type CompanyPermissionController struct {
  8. BaseAuthController
  9. }
  10. // List
  11. // @Title 获取权限设置基础信息
  12. // @Description 获取权限设置基础信息接口
  13. // @Param CompanyType query string true "客户类型:传空字符串或者不传为全部,'ficc','权益'"
  14. // @Param NoUpgrade query bool false "是否不展示升级权限,默认为 false"
  15. // @Success 200 {object} company.PermissionSetResp
  16. // @router /permission/list [get]
  17. func (this *CompanyPermissionController) List() {
  18. br := new(models.BaseResponse).Init()
  19. defer func() {
  20. this.Data["json"] = br
  21. this.ServeJSON()
  22. }()
  23. sysUser := this.SysUser
  24. if sysUser == nil {
  25. br.Msg = "请登录"
  26. br.ErrMsg = "请登录,SysUser Is Empty"
  27. br.Ret = 408
  28. return
  29. }
  30. // 非自用无需查询
  31. resp := new(company.PermissionSetResp)
  32. br.Ret = 200
  33. br.Success = true
  34. br.Msg = "获取成功"
  35. br.Data = resp
  36. return
  37. }
  38. // PermissionVariety
  39. // @Title 品种
  40. // @Description 品种接口
  41. // @Param CompanyType query string true "客户类型:传空字符串或者不传为全部,'ficc','权益'"
  42. // @Success 200 {object} company.PermissionVarietyResp
  43. // @router /permission/variety [get]
  44. func (this *CompanyPermissionController) PermissionVariety() {
  45. br := new(models.BaseResponse).Init()
  46. defer func() {
  47. this.Data["json"] = br
  48. this.ServeJSON()
  49. }()
  50. sysUser := this.SysUser
  51. if sysUser == nil {
  52. br.Msg = "请登录"
  53. br.ErrMsg = "请登录,SysUser Is Empty"
  54. br.Ret = 408
  55. return
  56. }
  57. br.Ret = 200
  58. br.Success = true
  59. br.Msg = "获取成功"
  60. return
  61. }