package com.fjhx.account.controller.account;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.fjhx.account.entity.account.dto.AccountRequestFundsSelectDto;
import com.fjhx.account.entity.account.vo.AccountRequestFundsVo;
import com.fjhx.common.constant.SourceConstant;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.account.entity.account.vo.AccountPaymentVo;
import com.fjhx.account.entity.account.dto.AccountPaymentSelectDto;
import com.fjhx.account.entity.account.dto.AccountPaymentDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.account.service.account.AccountPaymentService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 打款表 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-11
 */
@DS(SourceConstant.ACCOUNT)
@RestController
@RequestMapping("/accountPayment")
public class AccountPaymentController {

    @Autowired
    private AccountPaymentService accountPaymentService;

    /**
     * 打款表分页
     */
    @PostMapping("/page")
    public Page<AccountPaymentVo> page(@RequestBody AccountRequestFundsSelectDto dto) {
        return accountPaymentService.getPage(dto);
    }

    /**
     * 打款表明细
     */
    @PostMapping("/detail")
    public AccountPaymentVo detail(@RequestBody BaseSelectDto dto) {
        return accountPaymentService.detail(dto.getId());
    }

    /**
     * 打款功能
     */
    @PostMapping("/add")
    public void add(@RequestBody AccountPaymentDto accountPaymentDto) {
        accountPaymentService.add(accountPaymentDto);
    }



}
