ChoiceController.java 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. package com.zanxiang.manage.controller;
  2. import com.zanxiang.common.domain.ResultVO;
  3. import com.zanxiang.common.enums.OsEnum;
  4. import com.zanxiang.common.enums.VipLevelEnum;
  5. import com.zanxiang.common.utils.bean.BeanUtils;
  6. import com.zanxiang.erp.security.annotation.PreAuthorize;
  7. import com.zanxiang.manage.domain.vo.*;
  8. import com.zanxiang.manage.service.*;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import io.swagger.annotations.ApiResponse;
  12. import io.swagger.annotations.ApiResponses;
  13. import lombok.extern.slf4j.Slf4j;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.web.bind.annotation.GetMapping;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.web.bind.annotation.RestController;
  18. import java.util.Arrays;
  19. import java.util.List;
  20. /**
  21. * @author : lingfeng
  22. * @time : 2022-11-03
  23. * @description : 条件选择接口
  24. */
  25. @Api(tags = {"选择下拉接口"})
  26. @RestController
  27. @RequestMapping("/choice")
  28. @Slf4j
  29. public class ChoiceController {
  30. @Autowired
  31. private CpService cpService;
  32. @Autowired
  33. private GameService gameService;
  34. @Autowired
  35. private GameCategoryService gameCategoryService;
  36. @Autowired
  37. private PromoChannelService promoChannelService;
  38. @Autowired
  39. private PromoAccountService promoAccountService;
  40. @Autowired
  41. private PayWayService payWayService;
  42. @Autowired
  43. private PayMerchantService payMerchantService;
  44. @Autowired
  45. private GameTagService gameTagService;
  46. @ApiOperation(value = "vip等级选择列表")
  47. @GetMapping(value = "/vip/level/list")
  48. @PreAuthorize(permissionKey = "sdk:choiceVipLevel:list")
  49. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = VipLevelChoiceVO.class, responseContainer = "list")})
  50. public ResultVO<List<VipLevelChoiceVO>> vipLevelChoiceList() {
  51. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(VipLevelEnum.values()), VipLevelChoiceVO.class));
  52. }
  53. @ApiOperation(value = "操作系统选择列表")
  54. @GetMapping(value = "/os/type/list")
  55. @PreAuthorize(permissionKey = "sdk:choiceOsType:list")
  56. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = SystemChoiceVO.class, responseContainer = "list")})
  57. public ResultVO<List<SystemChoiceVO>> systemChoiceList() {
  58. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(OsEnum.values()), SystemChoiceVO.class));
  59. }
  60. @ApiOperation(value = "cp选择列表")
  61. @GetMapping(value = "/cp/list")
  62. @PreAuthorize(permissionKey = "sdk:choiceCp:list")
  63. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = CpChoiceVO.class, responseContainer = "list")})
  64. public ResultVO<List<CpChoiceVO>> cpChoiceList() {
  65. return new ResultVO<>(cpService.choiceList());
  66. }
  67. @ApiOperation(value = "游戏选择列表")
  68. @GetMapping(value = "/game/list")
  69. @PreAuthorize(permissionKey = "sdk:gameChoice:list")
  70. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameChoiceVO.class, responseContainer = "list")})
  71. public ResultVO<List<GameChoiceVO>> gameChoiceList() {
  72. return new ResultVO<>(gameService.choiceList());
  73. }
  74. @ApiOperation(value = "游戏应用类型选择列表")
  75. @GetMapping(value = "/game/category/list")
  76. @PreAuthorize(permissionKey = "sdk:gameCategoryChoice:list")
  77. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameCategoryChoiceVO.class, responseContainer = "list")})
  78. public ResultVO<List<GameCategoryChoiceVO>> gameCategoryChoiceList() {
  79. return ResultVO.ok(gameCategoryService.gameCategoryChoiceList());
  80. }
  81. @ApiOperation(value = "游戏分类标签选择列表")
  82. @GetMapping(value = "/game/tags/list")
  83. @PreAuthorize(permissionKey = "sdk:gameTagsChoice:list")
  84. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameTagChoiceVO.class, responseContainer = "list")})
  85. public ResultVO<List<GameTagChoiceVO>> gameTagsChoiceList() {
  86. return ResultVO.ok(gameTagService.gameTagsChoiceList());
  87. }
  88. @ApiOperation(value = "注册渠道选择列表")
  89. @GetMapping(value = "/promo/channel/list")
  90. @PreAuthorize(permissionKey = "sdk:promoChannelChoice:list")
  91. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoChannelChoiceVO.class, responseContainer = "list")})
  92. public ResultVO<List<PromoChannelChoiceVO>> promoChannelChoiceList() {
  93. return new ResultVO<>(promoChannelService.promoChannelChoiceList());
  94. }
  95. @ApiOperation(value = "归因推广账号选择列表")
  96. @GetMapping(value = "/promo/account/list")
  97. @PreAuthorize(permissionKey = "sdk:promoAccountChoice:list")
  98. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoAccountChoiceVO.class, responseContainer = "list")})
  99. public ResultVO<List<PromoAccountChoiceVO>> promoAccountChoiceList() {
  100. return new ResultVO<>(promoAccountService.promoAccountChoiceList());
  101. }
  102. @ApiOperation(value = "归因投放人员选择列表")
  103. @GetMapping(value = "/promo/pitcher/list")
  104. @PreAuthorize(permissionKey = "sdk:promoPitcherChoice:list")
  105. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoPitcherChoiceVO.class, responseContainer = "list")})
  106. public ResultVO<List<PromoPitcherChoiceVO>> promoPitcherChoiceList() {
  107. return new ResultVO<>(promoAccountService.promoPitcherChoiceList());
  108. }
  109. @ApiOperation(value = "支付方式选择列表")
  110. @GetMapping(value = "/pay/way/list")
  111. @PreAuthorize(permissionKey = "sdk:payWayChoice:list")
  112. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayWayChoiceVO.class, responseContainer = "list")})
  113. public ResultVO<List<PayWayChoiceVO>> payWayChoiceList() {
  114. return new ResultVO<>(payWayService.payWayChoiceList());
  115. }
  116. @ApiOperation(value = "商户选择列表")
  117. @GetMapping(value = "/pay/merchant/list")
  118. @PreAuthorize(permissionKey = "sdk:payMerchantChoice:list")
  119. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayMerchantChoiceVO.class, responseContainer = "list")})
  120. public ResultVO<List<PayMerchantChoiceVO>> payMerchantChoiceList() {
  121. return ResultVO.ok(payMerchantService.payMerchantChoiceList());
  122. }
  123. }