permission.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. package response
  2. type PermissionFirstItem struct {
  3. Id int `description:"一级品种ID"`
  4. AuthOk bool
  5. Sort int
  6. IsCheck bool
  7. List PermissionFiccSecondList
  8. YbIndexName string
  9. YbIndexIcon string
  10. }
  11. type PermissionFiccItem struct {
  12. Id int `json:"id"`
  13. ClassifyName string `json:"classify_name"`
  14. List PermissionFiccSecondList `json:"list"`
  15. Sort int `json:"sort"`
  16. IconUrl string `json:"icon_url"`
  17. SelectIconUrl string `json:"select_icon_url"`
  18. }
  19. type PermissionFiccSecondItem struct {
  20. ChartPermissionName string `json:"chart_permission_name"`
  21. ChartPermissionID int `json:"chart_permission_id"`
  22. Sort int `json:"sort"`
  23. AuthOk bool `json:"auth_ok"`
  24. PirceDrivenState int `json:"pirce_driven_state" description:"价格驱动品种状态:0-关闭 1-开启"`
  25. }
  26. type PermissionFiccResp struct {
  27. PermissionList PermissionFiccList `json:"permission_list"`
  28. ContactInfo PermissionCheckContactInfo `json:"contact_info"`
  29. CheckFlag bool `json:"check_flag"`
  30. }
  31. type PermissionFiccList []*PermissionFiccItem
  32. func (p PermissionFiccList) Len() int {
  33. return len(p)
  34. }
  35. func (p PermissionFiccList) Less(i, j int) bool {
  36. return p[i].Sort < p[j].Sort
  37. }
  38. func (p PermissionFiccList) Swap(i, j int) {
  39. p[i], p[j] = p[j], p[i]
  40. }
  41. type PermissionFiccSecondList []*PermissionFiccSecondItem
  42. func (ps PermissionFiccSecondList) Len() int {
  43. return len(ps)
  44. }
  45. func (ps PermissionFiccSecondList) Less(i, j int) bool {
  46. return ps[i].Sort < ps[j].Sort
  47. }
  48. func (ps PermissionFiccSecondList) Swap(i, j int) {
  49. ps[i], ps[j] = ps[j], ps[i]
  50. }
  51. // PermissionCheckInfo 权限校验完成后的结果
  52. type PermissionCheckInfo struct {
  53. Name string `json:"name" description:"销售名称"`
  54. Mobile string `json:"mobile" description:"手机号"`
  55. Type string `json:"type" description:"校验失败,没有权限,需要让前端处理的类型,枚举值:apply,contact"`
  56. HzPhone string `json:"hz_phone" description:"弘则公司电话"`
  57. CustomerInfo CustomerInfo `json:"customer_info" description:"客户信息"`
  58. }
  59. // PermissionCheckInfoContact 权限校验完成后的结果
  60. type PermissionCheckContactInfo struct {
  61. Name string `json:"name" description:"销售名称"`
  62. Mobile string `json:"mobile" description:"手机号"`
  63. }
  64. // CustomerInfo 客户信息
  65. type CustomerInfo struct {
  66. CompanyName string `json:"company_name" description:"客户(公司)名称"`
  67. Name string `json:"name" description:"联系人名称"`
  68. Mobile string `json:"mobile" description:"手机号"`
  69. Status string `json:"status" description:"状态"`
  70. IsSuspend int8 `json:"is_suspend" description:"启用与否字段:1:暂停,0:启用"`
  71. HasApply bool `json:"has_apply" description:"是否有申请过"`
  72. }
  73. type BindPermissionFiccResp struct {
  74. PermissionList []*BindPermissionFiccItem `json:"permission_list"`
  75. }
  76. type BindPermissionFiccItem struct {
  77. Id int `json:"id"`
  78. ClassifyName string `json:"classify_name"`
  79. List []*BindPermissionFiccSecondItem `json:"list"`
  80. }
  81. type BindPermissionFiccSecondItem struct {
  82. ChartPermissionName string `json:"chart_permission_name"`
  83. ChartPermissionID int `json:"chart_permission_id"`
  84. }