package com.fjhx.sale.controller.quality;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.quality.vo.EhsdQualityPackVo;
import com.fjhx.sale.entity.quality.dto.EhsdQualityPackSelectDto;
import com.fjhx.sale.entity.quality.dto.EhsdQualityPackDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.quality.EhsdQualityPackService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 质检---产品包装明细表 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-05-22
 */
@RestController
@RequestMapping("/ehsdQualityPack")
public class EhsdQualityPackController {

    @Autowired
    private EhsdQualityPackService ehsdQualityPackService;

    /**
     * 质检---产品包装明细表分页
     */
    @PostMapping("/page")
    public Page<EhsdQualityPackVo> page(@RequestBody EhsdQualityPackSelectDto dto) {
        return ehsdQualityPackService.getPage(dto);
    }

    /**
     * 质检---产品包装明细表明细
     */
    @PostMapping("/detail")
    public EhsdQualityPackVo detail(@RequestBody BaseSelectDto dto) {
        return ehsdQualityPackService.detail(dto.getId());
    }

    /**
     * 质检---产品包装明细表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdQualityPackDto ehsdQualityPackDto) {
        ehsdQualityPackService.add(ehsdQualityPackDto);
    }

    /**
     * 质检---产品包装明细表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdQualityPackDto ehsdQualityPackDto) {
        ehsdQualityPackService.edit(ehsdQualityPackDto);
    }

    /**
     * 质检---产品包装明细表删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        ehsdQualityPackService.delete(dto.getId());
    }

}
