package com.ruoyi.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.annotations.UserLoginToken;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.controller.req.MonthReq;
import com.ruoyi.frequency.agreement.entity.Agreement;
import com.ruoyi.frequency.agreement.service.AgreementService;
import com.ruoyi.frequency.illegaldeductionrecord.entity.IllegalDeductionRecord;
import com.ruoyi.frequency.illegaldeductionrecord.service.IllegalDeductionRecordService;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.BodyIdReq;
import com.ruoyi.vo.RyController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 扣款
 *
 * @author a
 * @date 2023/8/18 15:28
 */
@RestController
@RequestMapping("/api/illegalDeductionRecord")
@Api(tags = "扣款")
public class ApiIllegalDeductionRecordController extends RyController {

    @Autowired
    private IllegalDeductionRecordService illegalDeductionRecordService;

    @PostMapping("/getPage")
    @UserLoginToken
    @ApiOperation(value = "扣款列表", notes = "扣款列表")
    public ResponseData getPage(@RequestBody MonthReq req) {
        return ResponseData.success(illegalDeductionRecordService.getPage(req,getUserVo()));
    }

    @PostMapping("/detail")
    @UserLoginToken
    @ApiOperation(value = "扣款详情", notes = "扣款详情")
    public ResponseData<IllegalDeductionRecord> detail(@RequestBody BodyIdReq req) {
        return ResponseData.success(illegalDeductionRecordService.detail(req,getUserVo()));
    }
}
