package com.fjhx.account.controller.account;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo;
import com.fjhx.account.entity.account.dto.AccountRequestFundsDetailSelectDto;
import com.fjhx.account.entity.account.dto.AccountRequestFundsDetailDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.account.service.account.AccountRequestFundsDetailService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-10
 */
@RestController
@RequestMapping("/accountRequestFundsDetail")
public class AccountRequestFundsDetailController {

    @Autowired
    private AccountRequestFundsDetailService accountRequestFundsDetailService;

    /**
     * 分页
     */
    @PostMapping("/page")
    public Page<AccountRequestFundsDetailVo> page(@RequestBody AccountRequestFundsDetailSelectDto dto) {
        return accountRequestFundsDetailService.getPage(dto);
    }

    /**
     * 明细
     */
    @PostMapping("/detail")
    public AccountRequestFundsDetailVo detail(@RequestBody BaseSelectDto dto) {
        return accountRequestFundsDetailService.detail(dto.getId());
    }

    /**
     * 新增
     */
    @PostMapping("/add")
    public void add(@RequestBody AccountRequestFundsDetailDto accountRequestFundsDetailDto) {
        accountRequestFundsDetailService.add(accountRequestFundsDetailDto);
    }

    /**
     * 编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody AccountRequestFundsDetailDto accountRequestFundsDetailDto) {
        accountRequestFundsDetailService.edit(accountRequestFundsDetailDto);
    }

    /**
     * 删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        accountRequestFundsDetailService.delete(dto.getId());
    }

}
