package com.fjhx.sale.controller.purchase;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.purchase.dto.PurchaseBackSelectDto;
import com.fjhx.sale.entity.purchase.vo.PurchaseBackVo;
import com.fjhx.sale.service.purchase.PurchaseBackService;
import com.ruoyi.common.core.domain.BaseSelectDto;
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>
 * sale_采购退货 前端控制器
 * </p>
 *
 * @author
 * @since 2024-01-30
 */
@RestController
@RequestMapping("/purchaseBack")
public class PurchaseBackController {

    @Autowired
    private PurchaseBackService purchaseBackService;

    /**
     * sale_采购退货分页
     */
    @PostMapping("/page")
    public Page<PurchaseBackVo> page(@RequestBody PurchaseBackSelectDto dto) {
        return purchaseBackService.getPage(dto);
    }

    /**
     * sale_采购退货明细
     */
    @PostMapping("/detail")
    public PurchaseBackVo detail(@RequestBody BaseSelectDto dto) {
        return purchaseBackService.detail(dto.getId());
    }

}
