package com.fjhx.purchase.controller.refund;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.purchase.entity.refund.vo.RefundVo;
import com.fjhx.purchase.entity.refund.dto.RefundSelectDto;
import com.fjhx.purchase.entity.refund.dto.RefundDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.purchase.service.refund.RefundService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 退款管理 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-04-13
 */
@RestController
@RequestMapping("/refund")
public class RefundController {

    @Autowired
    private RefundService refundService;

    /**
     * 退款管理分页
     */
    @PostMapping("/page")
    public Page<RefundVo> page(@RequestBody RefundSelectDto dto) {
        return refundService.getPage(dto);
    }

    /**
     * 退款管理明细
     */
    @PostMapping("/detail")
    public RefundVo detail(@RequestBody BaseSelectDto dto) {
        return refundService.detail(dto.getId());
    }

    /**
     * 退款管理新增
     */
    @PostMapping("/add")
    public void add(@RequestBody RefundDto refundDto) {
        refundService.add(refundDto);
    }

    /**
     * 退款管理编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody RefundDto refundDto) {
        refundService.edit(refundDto);
    }

    /**
     * 退款管理删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        refundService.delete(dto.getId());
    }

    /**
     * 退款管理删除
     */
    @PostMapping("/receipt/registration")
    public void receiptRegistration(@RequestBody RefundDto dto) {
        refundService.receiptRegistration(dto);
    }

}
