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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.starry.admin.modules.order.module.vo.PlayOrderRewardQueryVo;
import com.starry.admin.modules.order.module.vo.PlayOrderRewardReturnVo;
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
import com.starry.common.annotation.Log;
import com.starry.common.enums.BusinessType;
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;

/**
 * 打赏订单
 *
 * @author admin
 * @since 2024-03-20
 */
@Api(tags = "打赏订单管理", description = "打赏订单信息管理相关接口，包括查询等操作")
@RestController
@RequestMapping("/order/reward/")
public class PlayOrderRewardInfoController {

    @Resource
    private IPlayOrderInfoService orderInfoService;

    /**
     * 分页查询打赏订单列表
     */
    @ApiOperation(value = "分页查询打赏订单", notes = "分页查询打赏订单信息列表")
    @ApiResponses({
            @ApiResponse(code = 200, message = "操作成功", response = PlayOrderRewardReturnVo.class, responseContainer = "Page")})
    // @PreAuthorize("@customSs.hasPermission('order:reward:list')")
    @Log(title = "查询打赏订单", businessType = BusinessType.INSERT)
    @PostMapping("/listByPage")
    public R queryRewardOrder(
            @ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayOrderRewardQueryVo vo) {
        IPage<PlayOrderRewardReturnVo> page = orderInfoService.selectRewardOrderInfoByPage(vo);
        return R.ok(page);
    }

}
