package com.fjhx.account.controller.repayment;

import com.fjhx.account.entity.repayment.dto.RepaymentRecordsDto;
import com.fjhx.account.entity.repayment.dto.RepaymentRecordsSelectDto;
import com.fjhx.account.entity.repayment.vo.RepaymentRecordsVo;
import com.fjhx.account.service.repayment.RepaymentRecordsService;
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;

import java.util.List;

/**
 * <p>
 * 还款记录 前端控制器
 * </p>
 *
 * @author
 * @since 2023-09-15
 */
@RestController
@RequestMapping("/repaymentRecords")
public class RepaymentRecordsController {

    @Autowired
    private RepaymentRecordsService repaymentRecordsService;

    /**
     * 还款记录列表
     */
    @PostMapping("/list")
    public List<RepaymentRecordsVo> list(@RequestBody RepaymentRecordsSelectDto dto) {
        return repaymentRecordsService.getList(dto);
    }

    /**
     * 还款记录新增
     */
    @PostMapping("/add")
    public void add(@RequestBody RepaymentRecordsDto repaymentRecordsDto) {
        repaymentRecordsService.add(repaymentRecordsDto);
    }

}
