package com.zanxiang.manage.controller; import com.zanxiang.common.domain.ResultVO; import com.zanxiang.common.enums.GameCategoryEnum; import com.zanxiang.common.enums.OsEnum; import com.zanxiang.common.enums.VipLevelEnum; import com.zanxiang.common.utils.bean.BeanUtils; import com.zanxiang.erp.security.annotation.PreAuthorize; import com.zanxiang.manage.domain.vo.*; import com.zanxiang.manage.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; import java.util.List; /** * @author : lingfeng * @time : 2022-11-03 * @description : 条件选择接口 */ @Api(tags = {"选择下拉接口"}) @RestController @RequestMapping("/choice") @Slf4j public class ChoiceController { @Autowired private CpService cpService; @Autowired private GameService gameService; @Autowired private GameCategoryService gameCategoryService; @Autowired private PromoChannelService promoChannelService; @Autowired private PromoAccountService promoAccountService; @Autowired private PayWayService payWayService; @Autowired private PayMerchantService payMerchantService; @ApiOperation(value = "vip等级选择列表") @GetMapping(value = "/vip/level/list") @PreAuthorize(permissionKey = "sdk:choiceVipLevel:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = VipLevelChoiceVO.class, responseContainer = "list")}) public ResultVO> vipLevelChoiceList() { return ResultVO.ok(BeanUtils.copyList(Arrays.asList(VipLevelEnum.values()), VipLevelChoiceVO.class)); } @ApiOperation(value = "操作系统选择列表") @GetMapping(value = "/os/type/list") @PreAuthorize(permissionKey = "sdk:choiceOsType:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = SystemChoiceVO.class, responseContainer = "list")}) public ResultVO> systemChoiceList() { return ResultVO.ok(BeanUtils.copyList(Arrays.asList(OsEnum.values()), SystemChoiceVO.class)); } @ApiOperation(value = "cp选择列表") @GetMapping(value = "/cp/list") @PreAuthorize(permissionKey = "sdk:choiceCp:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = CpChoiceVO.class, responseContainer = "list")}) public ResultVO> cpChoiceList() { return new ResultVO<>(cpService.choiceList()); } @ApiOperation(value = "游戏选择列表") @GetMapping(value = "/game/list") @PreAuthorize(permissionKey = "sdk:gameChoice:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameChoiceVO.class, responseContainer = "list")}) public ResultVO> gameChoiceList() { return new ResultVO<>(gameService.choiceList()); } @ApiOperation(value = "游戏应用类型选择列表") @GetMapping(value = "/game/category/list") @PreAuthorize(permissionKey = "sdk:gameCategoryChoice:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameCategoryParentVO.class, responseContainer = "list")}) public ResultVO> gameCategoryChoiceList() { return ResultVO.ok(gameCategoryService.getGameCategoryParent(GameCategoryEnum.GAME_TYPE.getCategoryType())); } @ApiOperation(value = "游戏父标签选择列表") @GetMapping(value = "/game/parent/tags/list") @PreAuthorize(permissionKey = "sdk:gameTagsChoice:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameCategoryParentVO.class, responseContainer = "list")}) public ResultVO> gameTagsChoiceList() { return ResultVO.ok(gameCategoryService.getGameCategoryParent(GameCategoryEnum.GAME_LABEL.getCategoryType())); } @ApiOperation(value = "注册渠道选择列表") @GetMapping(value = "/promo/channel/list") @PreAuthorize(permissionKey = "sdk:promoChannelChoice:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoChannelChoiceVO.class, responseContainer = "list")}) public ResultVO> promoChannelChoiceList() { return new ResultVO<>(promoChannelService.promoChannelChoiceList()); } @ApiOperation(value = "归因推广账号选择列表") @GetMapping(value = "/promo/account/list") @PreAuthorize(permissionKey = "sdk:promoAccountChoice:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoAccountChoiceVO.class, responseContainer = "list")}) public ResultVO> promoAccountChoiceList() { return new ResultVO<>(promoAccountService.promoAccountChoiceList()); } @ApiOperation(value = "归因投放人员选择列表") @GetMapping(value = "/promo/pitcher/list") @PreAuthorize(permissionKey = "sdk:promoPitcherChoice:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PromoPitcherChoiceVO.class, responseContainer = "list")}) public ResultVO> promoPitcherChoiceList() { return new ResultVO<>(promoAccountService.promoPitcherChoiceList()); } @ApiOperation(value = "支付方式选择列表") @GetMapping(value = "/pay/way/list") @PreAuthorize(permissionKey = "sdk:payWayChoice:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayWayChoiceVO.class, responseContainer = "list")}) public ResultVO> payWayChoiceList() { return new ResultVO<>(payWayService.payWayChoiceList()); } @ApiOperation(value = "商户选择列表") @GetMapping(value = "/pay/merchant/list") @PreAuthorize(permissionKey = "sdk:payMerchantChoice:list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = PayMerchantChoiceVO.class, responseContainer = "list")}) public ResultVO> payMerchantChoiceList() { return ResultVO.ok(payMerchantService.payMerchantChoiceList()); } }