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.AccountRemainderVo;
import com.fjhx.account.entity.account.dto.AccountRemainderSelectDto;
import com.fjhx.account.entity.account.dto.AccountRemainderDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.account.service.account.AccountRemainderService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 账户-余额表 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-06
 */
@RestController
@RequestMapping("/accountRemainder")
public class AccountRemainderController {

    @Autowired
    private AccountRemainderService accountRemainderService;

    /**
     * 账户-余额表分页
     */
    @PostMapping("/page")
    public Page<AccountRemainderVo> page(@RequestBody AccountRemainderSelectDto dto) {
        return accountRemainderService.getPage(dto);
    }

    /**
     * 账户-余额表明细
     */
    @PostMapping("/detail")
    public AccountRemainderVo detail(@RequestBody BaseSelectDto dto) {
        return accountRemainderService.detail(dto.getId());
    }

    /**
     * 账户-余额表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody AccountRemainderDto accountRemainderDto) {
        accountRemainderService.add(accountRemainderDto);
    }

    /**
     * 账户-余额表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody AccountRemainderDto accountRemainderDto) {
        accountRemainderService.edit(accountRemainderDto);
    }

    /**
     * 账户-余额表删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        accountRemainderService.delete(dto.getId());
    }

}
