ChoiceController.java 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. package com.zanxiang.manage.controller;
  2. import com.zanxiang.common.domain.ResultVO;
  3. import com.zanxiang.common.enums.*;
  4. import com.zanxiang.common.utils.bean.BeanUtils;
  5. import com.zanxiang.erp.security.annotation.PreAuthorize;
  6. import com.zanxiang.manage.domain.vo.*;
  7. import com.zanxiang.manage.service.*;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import io.swagger.annotations.ApiResponse;
  11. import io.swagger.annotations.ApiResponses;
  12. import lombok.extern.slf4j.Slf4j;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.GetMapping;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RestController;
  17. import java.util.Arrays;
  18. import java.util.List;
  19. /**
  20. * @author : lingfeng
  21. * @time : 2022-11-03
  22. * @description : 条件选择接口
  23. */
  24. @Api(tags = {"选择下拉接口"})
  25. @RestController
  26. @RequestMapping("/choice")
  27. @Slf4j
  28. public class ChoiceController {
  29. @Autowired
  30. private ICpService cpService;
  31. @Autowired
  32. private IGameService gameService;
  33. @Autowired
  34. private IGameCategoryService gameCategoryService;
  35. @Autowired
  36. private IPromoChannelService promoChannelService;
  37. @Autowired
  38. private IPromoAccountService promoAccountService;
  39. @Autowired
  40. private IPayWayService payWayService;
  41. @Autowired
  42. private IPayMerchantService payMerchantService;
  43. @Autowired
  44. private IGameTagService gameTagService;
  45. @Autowired
  46. private IPromoMediaService promoMediaService;
  47. @Autowired
  48. private IPromoSiteService promoSiteService;
  49. @Autowired
  50. private IPayApplicationService payApplicationService;
  51. @Autowired
  52. private IPayDeviceService payDeviceService;
  53. @Autowired
  54. private IPayBoxService payBoxService;
  55. @ApiOperation(value = "vip等级选择列表")
  56. @GetMapping(value = "/vip/level/list")
  57. @PreAuthorize(permissionKey = "sdk:choiceVipLevel:list")
  58. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = VipLevelChoiceVO.class, responseContainer = "list")})
  59. public ResultVO<List<VipLevelChoiceVO>> vipLevelChoiceList() {
  60. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(VipLevelEnum.values()), VipLevelChoiceVO.class));
  61. }
  62. @ApiOperation(value = "操作系统选择列表")
  63. @GetMapping(value = "/os/type/list")
  64. @PreAuthorize(permissionKey = "sdk:choiceOsType:list")
  65. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = SystemChoiceVO.class, responseContainer = "list")})
  66. public ResultVO<List<SystemChoiceVO>> systemChoiceList() {
  67. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(OsEnum.values()), SystemChoiceVO.class));
  68. }
  69. @ApiOperation(value = "cp选择列表")
  70. @GetMapping(value = "/cp/list")
  71. @PreAuthorize(permissionKey = "sdk:choiceCp:list")
  72. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = CpChoiceVO.class, responseContainer = "list")})
  73. public ResultVO<List<CpChoiceVO>> cpChoiceList() {
  74. return new ResultVO<>(cpService.choiceList());
  75. }
  76. @ApiOperation(value = "游戏选择列表")
  77. @GetMapping(value = "/game/list")
  78. @PreAuthorize(permissionKey = "sdk:gameChoice:list")
  79. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameChoiceVO.class, responseContainer = "list")})
  80. public ResultVO<List<GameChoiceVO>> gameChoiceList() {
  81. return new ResultVO<>(gameService.choiceList());
  82. }
  83. @ApiOperation(value = "游戏应用类型选择列表")
  84. @GetMapping(value = "/game/category/list")
  85. @PreAuthorize(permissionKey = "sdk:gameCategoryChoice:list")
  86. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameCategoryChoiceVO.class, responseContainer = "list")})
  87. public ResultVO<List<GameCategoryChoiceVO>> gameCategoryChoiceList() {
  88. return ResultVO.ok(gameCategoryService.gameCategoryChoiceList());
  89. }
  90. @ApiOperation(value = "游戏分类标签选择列表")
  91. @GetMapping(value = "/game/tags/list")
  92. @PreAuthorize(permissionKey = "sdk:gameTagsChoice:list")
  93. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameTagChoiceVO.class, responseContainer = "list")})
  94. public ResultVO<List<GameTagChoiceVO>> gameTagsChoiceList() {
  95. return ResultVO.ok(gameTagService.gameTagsChoiceList());
  96. }
  97. @ApiOperation(value = "注册渠道选择列表")
  98. @GetMapping(value = "/promo/channel/list")
  99. @PreAuthorize(permissionKey = "sdk:promoChannelChoice:list")
  100. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoChannelChoiceVO.class, responseContainer = "list")})
  101. public ResultVO<List<PromoChannelChoiceVO>> promoChannelChoiceList() {
  102. return new ResultVO<>(promoChannelService.promoChannelChoiceList());
  103. }
  104. @ApiOperation(value = "归因推广账号选择列表")
  105. @GetMapping(value = "/promo/account/list")
  106. @PreAuthorize(permissionKey = "sdk:promoAccountChoice:list")
  107. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoAccountChoiceVO.class, responseContainer = "list")})
  108. public ResultVO<List<PromoAccountChoiceVO>> promoAccountChoiceList() {
  109. return new ResultVO<>(promoAccountService.promoAccountChoiceList());
  110. }
  111. @ApiOperation(value = "归因投放人员选择列表")
  112. @GetMapping(value = "/promo/pitcher/list")
  113. @PreAuthorize(permissionKey = "sdk:promoPitcherChoice:list")
  114. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoPitcherChoiceVO.class, responseContainer = "list")})
  115. public ResultVO<List<PromoPitcherChoiceVO>> promoPitcherChoiceList() {
  116. return new ResultVO<>(promoAccountService.promoPitcherChoiceList());
  117. }
  118. @ApiOperation(value = "支付方式选择列表")
  119. @GetMapping(value = "/pay/way/list")
  120. @PreAuthorize(permissionKey = "sdk:payWayChoice:list")
  121. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayWayChoiceVO.class, responseContainer = "list")})
  122. public ResultVO<List<PayWayChoiceVO>> payWayChoiceList() {
  123. return new ResultVO<>(payWayService.payWayChoiceList());
  124. }
  125. @ApiOperation(value = "支付类型选择列表")
  126. @GetMapping(value = "/pay/device/list")
  127. @PreAuthorize(permissionKey = "sdk:payDeviceChoice:list")
  128. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayDeviceChoiceVO.class, responseContainer = "list")})
  129. public ResultVO<List<PayDeviceChoiceVO>> payDeviceChoiceList() {
  130. return new ResultVO<>(payDeviceService.payDeviceChoiceList());
  131. }
  132. @ApiOperation(value = "商户选择列表")
  133. @GetMapping(value = "/pay/merchant/list")
  134. @PreAuthorize(permissionKey = "sdk:payMerchantChoice:list")
  135. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayMerchantChoiceVO.class, responseContainer = "list")})
  136. public ResultVO<List<PayMerchantChoiceVO>> payMerchantChoiceList() {
  137. return ResultVO.ok(payMerchantService.payMerchantChoiceList());
  138. }
  139. @ApiOperation(value = "推广媒体类型选择列表")
  140. @GetMapping(value = "/promo/media/type/list")
  141. @PreAuthorize(permissionKey = "sdk:promoMediaTypeChoice:list")
  142. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoMediaTypeChoiceVO.class, responseContainer = "list")})
  143. public ResultVO<List<PromoMediaTypeChoiceVO>> promoMediaTypeChoiceList() {
  144. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(PromoMediaTypeEnum.values()), PromoMediaTypeChoiceVO.class));
  145. }
  146. @ApiOperation(value = "推广媒体选择列表")
  147. @GetMapping(value = "/promo/media/list")
  148. @PreAuthorize(permissionKey = "sdk:promoMediaChoice:list")
  149. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoMediaChoiceVO.class, responseContainer = "list")})
  150. public ResultVO<List<PromoMediaChoiceVO>> promoMediaChoiceList() {
  151. return ResultVO.ok(promoMediaService.promoMediaChoiceList());
  152. }
  153. @ApiOperation(value = "推广账号类型选择列表")
  154. @GetMapping(value = "/promo/account/type/list")
  155. @PreAuthorize(permissionKey = "sdk:promoAccountTypeChoice:list")
  156. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoMediaChoiceVO.class, responseContainer = "list")})
  157. public ResultVO<List<PromoAccountTypeChoiceVO>> promoAccountTypeChoiceList() {
  158. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(PromoAccountTypeEnum.values()), PromoAccountTypeChoiceVO.class));
  159. }
  160. @ApiOperation(value = "推广账号联动选择列表")
  161. @GetMapping(value = "/promo/account/linkage/list")
  162. @PreAuthorize(permissionKey = "sdk:promoAccountLinkageChoice:list")
  163. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoAccountLinkageChoiceVO.class, responseContainer = "list")})
  164. public ResultVO<List<PromoAccountLinkageChoiceVO>> promoAccountLinkageChoiceList() {
  165. return new ResultVO<>(promoAccountService.promoAccountLinkageChoiceList());
  166. }
  167. @ApiOperation(value = "推广媒体版位位置联动选择列表")
  168. @GetMapping(value = "/promo/site/linkage/list")
  169. @PreAuthorize(permissionKey = "sdk:promoSiteLinkageChoice:list")
  170. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoSiteLinkageChoiceVO.class, responseContainer = "list")})
  171. public ResultVO<List<PromoSiteLinkageChoiceVO>> promoSiteLinkageChoiceList() {
  172. return new ResultVO<>(promoSiteService.promoSiteLinkageChoiceList());
  173. }
  174. @ApiOperation(value = "推广服务商选择列表")
  175. @GetMapping(value = "/promo/provider/list")
  176. @PreAuthorize(permissionKey = "sdk:promoProviderChoice:list")
  177. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoProviderChoiceVO.class, responseContainer = "list")})
  178. public ResultVO<List<PromoProviderChoiceVO>> promoProviderChoiceList() {
  179. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(PromoProviderEnum.values()), PromoProviderChoiceVO.class));
  180. }
  181. @ApiOperation(value = "支付应用类型选择列表")
  182. @GetMapping(value = "/application/type/list")
  183. @PreAuthorize(permissionKey = "sdk:payApplicationTypeChoice:list")
  184. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = ApplicationTypeChoiceVO.class, responseContainer = "list")})
  185. public ResultVO<List<ApplicationTypeChoiceVO>> applicationTypeChoiceList() {
  186. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(PayApplicationTypeEnum.values()), ApplicationTypeChoiceVO.class));
  187. }
  188. @ApiOperation(value = "支付应用选择列表")
  189. @GetMapping(value = "/pay/application/list")
  190. @PreAuthorize(permissionKey = "sdk:payApplicationChoice:list")
  191. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayApplicationChoiceVO.class, responseContainer = "list")})
  192. public ResultVO<List<PayApplicationChoiceVO>> payApplicationChoiceList() {
  193. return new ResultVO<>(payApplicationService.payApplicationChoiceList());
  194. }
  195. @ApiOperation(value = "支付盒子选择列表")
  196. @GetMapping(value = "/pay/box/list")
  197. @PreAuthorize(permissionKey = "sdk:payBoxChoice:list")
  198. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayBoxChoiceVO.class, responseContainer = "list")})
  199. public ResultVO<List<PayBoxChoiceVO>> payBoxChoiceList() {
  200. return ResultVO.ok(payBoxService.payBoxChoiceList());
  201. }
  202. @ApiOperation(value = "策略类型选择列表")
  203. @GetMapping(value = "/game/pay/strategy/list")
  204. @PreAuthorize(permissionKey = "sdk:gamePayStrategyChoice:list")
  205. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GamePayStrategyChoiceVO.class, responseContainer = "list")})
  206. public ResultVO<List<GamePayStrategyChoiceVO>> gamePayStrategyChoiceList() {
  207. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(GameStrategyTypeEnum.values()), GamePayStrategyChoiceVO.class));
  208. }
  209. }