package com.ycwl.basic.profitsharing.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ycwl.basic.profitsharing.dto.ProfitSharingRecordReqQuery;
import com.ycwl.basic.profitsharing.dto.ProfitSharingRecordTableRespVo;
import com.ycwl.basic.profitsharing.service.ProfitSharingRecordService;
import com.ycwl.basic.utils.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/profitSharingRecord/v1")
@Api(tags = "利润分成记录相关接口")
public class ProfitSharingRecordController {

    @Autowired
    private ProfitSharingRecordService profitSharingRecordService;

    @ApiOperation("根据景区ID查询利润分成记录，支持分页，按创建时间倒序")
    @PostMapping("/page")
    public ApiResponse<ProfitSharingRecordTableRespVo> queryPage(@RequestBody ProfitSharingRecordReqQuery req) {
        ProfitSharingRecordTableRespVo records = profitSharingRecordService.list(req);
        return ApiResponse.success(records);
    }

}
