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.PackDetailGoodsVo;
import com.fjhx.sale.entity.pack.dto.PackDetailGoodsSelectDto;
import com.fjhx.sale.entity.pack.dto.PackDetailGoodsDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.pack.PackDetailGoodsService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 自定义装箱货物表 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-04-18
 */
@RestController
@RequestMapping("/packDetailGoods")
public class PackDetailGoodsController {

    @Autowired
    private PackDetailGoodsService packDetailGoodsService;

    /**
     * 自定义装箱货物表分页
     */
    @PostMapping("/page")
    public Page<PackDetailGoodsVo> page(@RequestBody PackDetailGoodsSelectDto dto) {
        return packDetailGoodsService.getPage(dto);
    }

    /**
     * 自定义装箱货物表明细
     */
    @PostMapping("/detail")
    public PackDetailGoodsVo detail(@RequestBody BaseSelectDto dto) {
        return packDetailGoodsService.detail(dto.getId());
    }

    /**
     * 自定义装箱货物表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody PackDetailGoodsDto packDetailGoodsDto) {
        packDetailGoodsService.add(packDetailGoodsDto);
    }

    /**
     * 自定义装箱货物表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody PackDetailGoodsDto packDetailGoodsDto) {
        packDetailGoodsService.edit(packDetailGoodsDto);
    }

    /**
     * 自定义装箱货物表删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        packDetailGoodsService.delete(dto.getId());
    }

}
