package com.fjhx.account.controller.transaction;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.account.entity.transaction.dto.TransactionDto;
import com.fjhx.account.entity.transaction.dto.TransactionSelectDto;
import com.fjhx.account.entity.transaction.vo.TransactionVo;
import com.fjhx.account.service.transaction.TransactionService;
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-06-26
 */
@RestController
@RequestMapping("/transaction")
public class TransactionController {

    @Autowired
    private TransactionService transactionService;

    /**
     * 往来管理分页
     */
    @PostMapping("/page")
    public Page<TransactionVo> page(@RequestBody TransactionSelectDto dto) {
        return transactionService.getPage(dto);
    }

    /**
     * 往来管理新增
     */
    @PostMapping("/add")
    public void add(@RequestBody TransactionDto transactionDto) {
        transactionService.add(transactionDto);
    }

}
