ChoiceController.java 6.4 KB

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