package com.fjhx.account.controller.write;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.account.entity.write.dto.WriteOffRecordsDto;
import com.fjhx.account.entity.write.dto.WriteOffRecordsSelectDto;
import com.fjhx.account.entity.write.vo.WriteOffRecordsVo;
import com.fjhx.account.service.write.WriteOffRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
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;


/**
 * <p>
 * 冲销记录表 前端控制器
 * </p>
 *
 * @author
 * @since 2023-07-12
 */
@RestController
@RequestMapping("/writeOffRecords")
public class WriteOffRecordsController {

    @Autowired
    private WriteOffRecordsService writeOffRecordsService;

    /**
     * 冲销记录表分页
     */
    @PostMapping("/page")
    public Page<WriteOffRecordsVo> page(@RequestBody WriteOffRecordsSelectDto dto) {
        return writeOffRecordsService.getPage(dto);
    }

    /**
     * 冲销记录表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody WriteOffRecordsDto writeOffRecordsDto) {
        writeOffRecordsService.add(writeOffRecordsDto);
    }

}
