package cn.newfeifan.mall.module.distri.controller.admin.consumptionchangelog;

import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

import javax.validation.*;
import cn.newfeifan.mall.framework.common.pojo.PageResult;
import cn.newfeifan.mall.framework.common.pojo.CommonResult;
import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;


import cn.newfeifan.mall.module.distri.controller.admin.consumptionchangelog.vo.*;
import cn.newfeifan.mall.module.distri.service.consumptionchangelog.ConsumptionChangeLogService;

@Tag(name = "管理后台 - 平台消费分变动记录")
@RestController
@RequestMapping("/distri/consumption-change-log")
@Validated
public class ConsumptionChangeLogController {

    @Resource
    private ConsumptionChangeLogService consumptionChangeLogService;

    @GetMapping("/page")
    @Operation(summary = "获得平台消费分变动记录分页")
    @PreAuthorize("@ss.hasPermission('distri:consumption-change-log:query')")
    public CommonResult<PageResult<ConsumptionChangeLogRespVO>> getConsumptionChangeLogPage(@Valid ConsumptionChangeLogPageReqVO pageReqVO) {
        PageResult<ConsumptionChangeLogRespVO> pageResult = consumptionChangeLogService.getConsumptionChangeLogPage(pageReqVO);
        return success(pageResult);
    }

}