package com.zanxiang.game.data.serve.controller;

import com.zanxiang.erp.security.annotation.PreAuthorize;
import com.zanxiang.game.data.serve.pojo.dto.RoleCombatRankingDTO;
import com.zanxiang.game.data.serve.pojo.dto.RoleRechargeRankingDTO;
import com.zanxiang.game.data.serve.service.IRoleManageService;
import com.zanxiang.game.data.serve.utils.Page;
import com.zanxiang.module.util.pojo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author tianhua
 * @time 2023/9/8
 * @Description  角色运营管理控制层接口
 **/
@Api(tags = "角色运营管理")
@RestController
@RequestMapping("/role")
@Slf4j
public class RoleManageController {

    @Autowired
    private IRoleManageService roleManageService;

    @ApiOperation(value = "角色充值排行榜")
    @PreAuthorize(permissionKey = "roleManage:recharge:role")
    @PostMapping("/rechargeRanking")
    public ResultVO<Page<Map>> getRoleRechargeRanking(@RequestBody RoleRechargeRankingDTO dto) {
        return ResultVO.ok(roleManageService.getRoleRechargeRanking(dto));
    }

    @ApiOperation(value = "角色战力排行榜")
    @PreAuthorize(permissionKey = "roleManage:combat:role")
    @PostMapping("/combatRanking")
    public ResultVO<Page<Map>> getRoleCombatRanking(@RequestBody RoleCombatRankingDTO dto) {
        return ResultVO.ok(roleManageService.getRoleCombatRanking(dto));
    }


}
