ChoiceController.java 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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.enums.PayApplicationTypeEnum;
  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. @Autowired
  47. private PromoMediaService promoMediaService;
  48. @Autowired
  49. private PromoSiteService promoSiteService;
  50. @Autowired
  51. private PayApplicationService payApplicationService;
  52. @ApiOperation(value = "vip等级选择列表")
  53. @GetMapping(value = "/vip/level/list")
  54. @PreAuthorize(permissionKey = "sdk:choiceVipLevel:list")
  55. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = VipLevelChoiceVO.class, responseContainer = "list")})
  56. public ResultVO<List<VipLevelChoiceVO>> vipLevelChoiceList() {
  57. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(VipLevelEnum.values()), VipLevelChoiceVO.class));
  58. }
  59. @ApiOperation(value = "操作系统选择列表")
  60. @GetMapping(value = "/os/type/list")
  61. @PreAuthorize(permissionKey = "sdk:choiceOsType:list")
  62. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = SystemChoiceVO.class, responseContainer = "list")})
  63. public ResultVO<List<SystemChoiceVO>> systemChoiceList() {
  64. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(OsEnum.values()), SystemChoiceVO.class));
  65. }
  66. @ApiOperation(value = "cp选择列表")
  67. @GetMapping(value = "/cp/list")
  68. @PreAuthorize(permissionKey = "sdk:choiceCp:list")
  69. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = CpChoiceVO.class, responseContainer = "list")})
  70. public ResultVO<List<CpChoiceVO>> cpChoiceList() {
  71. return new ResultVO<>(cpService.choiceList());
  72. }
  73. @ApiOperation(value = "游戏选择列表")
  74. @GetMapping(value = "/game/list")
  75. @PreAuthorize(permissionKey = "sdk:gameChoice:list")
  76. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameChoiceVO.class, responseContainer = "list")})
  77. public ResultVO<List<GameChoiceVO>> gameChoiceList() {
  78. return new ResultVO<>(gameService.choiceList());
  79. }
  80. @ApiOperation(value = "游戏应用类型选择列表")
  81. @GetMapping(value = "/game/category/list")
  82. @PreAuthorize(permissionKey = "sdk:gameCategoryChoice:list")
  83. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameCategoryChoiceVO.class, responseContainer = "list")})
  84. public ResultVO<List<GameCategoryChoiceVO>> gameCategoryChoiceList() {
  85. return ResultVO.ok(gameCategoryService.gameCategoryChoiceList());
  86. }
  87. @ApiOperation(value = "游戏分类标签选择列表")
  88. @GetMapping(value = "/game/tags/list")
  89. @PreAuthorize(permissionKey = "sdk:gameTagsChoice:list")
  90. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameTagChoiceVO.class, responseContainer = "list")})
  91. public ResultVO<List<GameTagChoiceVO>> gameTagsChoiceList() {
  92. return ResultVO.ok(gameTagService.gameTagsChoiceList());
  93. }
  94. @ApiOperation(value = "注册渠道选择列表")
  95. @GetMapping(value = "/promo/channel/list")
  96. @PreAuthorize(permissionKey = "sdk:promoChannelChoice:list")
  97. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoChannelChoiceVO.class, responseContainer = "list")})
  98. public ResultVO<List<PromoChannelChoiceVO>> promoChannelChoiceList() {
  99. return new ResultVO<>(promoChannelService.promoChannelChoiceList());
  100. }
  101. @ApiOperation(value = "归因推广账号选择列表")
  102. @GetMapping(value = "/promo/account/list")
  103. @PreAuthorize(permissionKey = "sdk:promoAccountChoice:list")
  104. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoAccountChoiceVO.class, responseContainer = "list")})
  105. public ResultVO<List<PromoAccountChoiceVO>> promoAccountChoiceList() {
  106. return new ResultVO<>(promoAccountService.promoAccountChoiceList());
  107. }
  108. @ApiOperation(value = "归因投放人员选择列表")
  109. @GetMapping(value = "/promo/pitcher/list")
  110. @PreAuthorize(permissionKey = "sdk:promoPitcherChoice:list")
  111. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoPitcherChoiceVO.class, responseContainer = "list")})
  112. public ResultVO<List<PromoPitcherChoiceVO>> promoPitcherChoiceList() {
  113. return new ResultVO<>(promoAccountService.promoPitcherChoiceList());
  114. }
  115. @ApiOperation(value = "支付方式选择列表")
  116. @GetMapping(value = "/pay/way/list")
  117. @PreAuthorize(permissionKey = "sdk:payWayChoice:list")
  118. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayWayChoiceVO.class, responseContainer = "list")})
  119. public ResultVO<List<PayWayChoiceVO>> payWayChoiceList() {
  120. return new ResultVO<>(payWayService.payWayChoiceList());
  121. }
  122. @ApiOperation(value = "商户选择列表")
  123. @GetMapping(value = "/pay/merchant/list")
  124. @PreAuthorize(permissionKey = "sdk:payMerchantChoice:list")
  125. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayMerchantChoiceVO.class, responseContainer = "list")})
  126. public ResultVO<List<PayMerchantChoiceVO>> payMerchantChoiceList() {
  127. return ResultVO.ok(payMerchantService.payMerchantChoiceList());
  128. }
  129. @ApiOperation(value = "推广媒体类型选择列表")
  130. @GetMapping(value = "/promo/media/type/list")
  131. @PreAuthorize(permissionKey = "sdk:promoMediaTypeChoice:list")
  132. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoMediaTypeChoiceVO.class, responseContainer = "list")})
  133. public ResultVO<List<PromoMediaTypeChoiceVO>> promoMediaTypeChoiceList() {
  134. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(PromoMediaTypeEnum.values()), PromoMediaTypeChoiceVO.class));
  135. }
  136. @ApiOperation(value = "推广媒体选择列表")
  137. @GetMapping(value = "/promo/media/list")
  138. @PreAuthorize(permissionKey = "sdk:promoMediaChoice:list")
  139. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoMediaChoiceVO.class, responseContainer = "list")})
  140. public ResultVO<List<PromoMediaChoiceVO>> promoMediaChoiceList() {
  141. return ResultVO.ok(promoMediaService.promoMediaChoiceList());
  142. }
  143. @ApiOperation(value = "推广账号类型选择列表")
  144. @GetMapping(value = "/promo/account/type/list")
  145. @PreAuthorize(permissionKey = "sdk:promoAccountTypeChoice:list")
  146. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoMediaChoiceVO.class, responseContainer = "list")})
  147. public ResultVO<List<PromoAccountTypeChoiceVO>> promoAccountTypeChoiceList() {
  148. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(PromoAccountTypeEnum.values()), PromoAccountTypeChoiceVO.class));
  149. }
  150. @ApiOperation(value = "推广账号联动选择列表")
  151. @GetMapping(value = "/promo/account/linkage/list")
  152. @PreAuthorize(permissionKey = "sdk:promoAccountLinkageChoice:list")
  153. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoAccountLinkageChoiceVO.class, responseContainer = "list")})
  154. public ResultVO<List<PromoAccountLinkageChoiceVO>> promoAccountLinkageChoiceList() {
  155. return new ResultVO<>(promoAccountService.promoAccountLinkageChoiceList());
  156. }
  157. @ApiOperation(value = "推广媒体版位位置联动选择列表")
  158. @GetMapping(value = "/promo/site/linkage/list")
  159. @PreAuthorize(permissionKey = "sdk:promoSiteLinkageChoice:list")
  160. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoSiteLinkageChoiceVO.class, responseContainer = "list")})
  161. public ResultVO<List<PromoSiteLinkageChoiceVO>> promoSiteLinkageChoiceList() {
  162. return new ResultVO<>(promoSiteService.promoSiteLinkageChoiceList());
  163. }
  164. @ApiOperation(value = "推广服务商选择列表")
  165. @GetMapping(value = "/promo/provider/list")
  166. @PreAuthorize(permissionKey = "sdk:promoProviderChoice:list")
  167. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoProviderChoiceVO.class, responseContainer = "list")})
  168. public ResultVO<List<PromoProviderChoiceVO>> promoProviderChoiceList() {
  169. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(PromoProviderEnum.values()), PromoProviderChoiceVO.class));
  170. }
  171. @ApiOperation(value = "支付应用类型选择列表")
  172. @GetMapping(value = "/application/type/list")
  173. @PreAuthorize(permissionKey = "sdk:applicationTypeChoice:list")
  174. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = ApplicationTypeChoiceVO.class, responseContainer = "list")})
  175. public ResultVO<List<ApplicationTypeChoiceVO>> applicationTypeChoiceList() {
  176. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(PayApplicationTypeEnum.values()), ApplicationTypeChoiceVO.class));
  177. }
  178. @ApiOperation(value = "支付应用选择列表")
  179. @GetMapping(value = "/pay/application/list")
  180. @PreAuthorize(permissionKey = "sdk:payApplicationChoice:list")
  181. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayApplicationChoiceVO.class, responseContainer = "list")})
  182. public ResultVO<List<PayApplicationChoiceVO>> payApplicationChoiceList() {
  183. return new ResultVO<>(payApplicationService.payApplicationChoiceList());
  184. }
  185. @ApiOperation(value = "支付盒子类型选择列表")
  186. @GetMapping(value = "/pay/box/list")
  187. @PreAuthorize(permissionKey = "sdk:payBoxChoice:list")
  188. @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayBoxTypeChoiceVO.class, responseContainer = "list")})
  189. public ResultVO<List<PayBoxTypeChoiceVO>> payBoxChoiceList() {
  190. return ResultVO.ok(BeanUtils.copyList(Arrays.asList(AppletStoreEnum.values()), PayBoxTypeChoiceVO.class));
  191. }
  192. }