package com.starry.admin.modules.custom.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.starry.admin.modules.custom.module.vo.PlayCustomRankingQueryVo;
import com.starry.admin.modules.custom.module.vo.PlayCustomRankingReturnVo;
import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
import com.starry.common.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
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;

/**
 * 顾客Controller
 *
 * @author admin
 * @since 2024-04-08
 */
@Api(tags = "顾客排名管理", description = "顾客消费排名相关接口，包括查询排名列表等操作")
@RestController
@RequestMapping("/custom/ranking")
public class PlayCustomRankingController {
    @Resource
    private IPlayCustomUserInfoService playCustomUserInfoService;

    /**
     * 查询顾客排名列表
     */
    @ApiOperation(value = "分页查询排名列表", notes = "分页查询顾客消费排名信息列表")
    @ApiResponses({
            @ApiResponse(code = 200, message = "操作成功", response = PlayCustomRankingReturnVo.class, responseContainer = "Page")})
    @PostMapping("/listByPage")
    public R list(@ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayCustomRankingQueryVo vo) {
        IPage<PlayCustomRankingReturnVo> list = playCustomUserInfoService.selectRankingByPage(vo);
        return R.ok(list);
    }

}
