company_permission.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package company
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "hongze/hongze_yb/controller/response"
  5. "hongze/hongze_yb/services/company"
  6. userService "hongze/hongze_yb/services/user"
  7. )
  8. // GetHomeFiccPermissions 首页品种权限列表
  9. func GetHomeFiccPermissions(c *gin.Context) {
  10. userinfo := userService.GetInfoByClaims(c)
  11. list, err := company.GetHomeFiccPermissions(userinfo)
  12. if err !=nil {
  13. response.Fail(err.Error(), c)
  14. return
  15. }
  16. response.OkData("获取成功", list, c)
  17. }
  18. // GetPermissionTree 获取FICC品种权限列表-不校验权限
  19. // @Tags 客户模块
  20. // @Summary 获取FICC品种权限列表
  21. // @Description 获取FICC品种权限列表
  22. // @Security ApiKeyAuth
  23. // @Param Authorization header string true "Bearer 31a165baebe6dec616b1f8f3207b4273"
  24. // @Accept json
  25. // @Product json
  26. // @Success 200 {object} []company.FiccPermissionList
  27. // @failure 400 {string} string "获取失败"
  28. // @Router /company/permission/tree [get]
  29. func GetPermissionTree(c *gin.Context) {
  30. list, err := company.GetFiccPermissionList()
  31. if err != nil {
  32. response.FailMsg("获取失败", "GetPermissionList ErrMsg:" + err.Error(), c)
  33. return
  34. }
  35. response.OkData("获取成功", list, c)
  36. }
  37. // GetBindFiccPermissions 展示有权限的品种列表,无权限的隐藏
  38. func GetBindFiccPermissions(c *gin.Context) {
  39. userinfo := userService.GetInfoByClaims(c)
  40. list, err := company.GetBindFiccPermissions(userinfo)
  41. if err !=nil {
  42. response.Fail(err.Error(), c)
  43. return
  44. }
  45. response.OkData("获取成功", list, c)
  46. }
  47. // GetCommoditiesBindFiccPermissions 大宗商品展示有权限的品种列表,无权限的隐藏
  48. // @Tags 客户模块
  49. // @Summary 获取FICC品种权限列表
  50. // @Description 获取FICC品种权限列表
  51. // @Security ApiKeyAuth
  52. // @Param Authorization header string true "Bearer 31a165baebe6dec616b1f8f3207b4273"
  53. // @Accept json
  54. // @Product json
  55. // @Success 200 {object} []company.FiccPermissionList
  56. // @failure 400 {string} string "获取失败"
  57. // @Router /company/permission/commodities [get]
  58. func GetCommoditiesBindFiccPermissions(c *gin.Context) {
  59. userinfo := userService.GetInfoByClaims(c)
  60. list, err := company.GetCommoditiesBindFiccPermissions(userinfo)
  61. if err !=nil {
  62. response.Fail(err.Error(), c)
  63. return
  64. }
  65. response.OkData("获取成功", list, c)
  66. }