package com.fjhx.sale.controller.pack;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.pack.vo.PackDetailProductVo;
import com.fjhx.sale.entity.pack.dto.PackDetailProductSelectDto;
import com.fjhx.sale.entity.pack.dto.PackDetailProductDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.pack.PackDetailProductService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 装箱出货产品明细表 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-04-18
 */
@RestController
@RequestMapping("/packDetailProduct")
public class PackDetailProductController {

    @Autowired
    private PackDetailProductService packDetailProductService;

    /**
     * 装箱出货产品明细表分页
     */
    @PostMapping("/page")
    public Page<PackDetailProductVo> page(@RequestBody PackDetailProductSelectDto dto) {
        return packDetailProductService.getPage(dto);
    }

    /**
     * 装箱出货产品明细表明细
     */
    @PostMapping("/detail")
    public PackDetailProductVo detail(@RequestBody BaseSelectDto dto) {
        return packDetailProductService.detail(dto.getId());
    }

    /**
     * 装箱出货产品明细表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody PackDetailProductDto packDetailProductDto) {
        packDetailProductService.add(packDetailProductDto);
    }

    /**
     * 装箱出货产品明细表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody PackDetailProductDto packDetailProductDto) {
        packDetailProductService.edit(packDetailProductDto);
    }

    /**
     * 装箱出货产品明细表删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        packDetailProductService.delete(dto.getId());
    }

}
