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.EhsdQualityProductVo;
import com.fjhx.sale.entity.quality.dto.EhsdQualityProductSelectDto;
import com.fjhx.sale.entity.quality.dto.EhsdQualityProductDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.quality.EhsdQualityProductService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 质检--商品包装 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-05-22
 */
@RestController
@RequestMapping("/ehsdQualityProduct")
public class EhsdQualityProductController {

    @Autowired
    private EhsdQualityProductService ehsdQualityProductService;

    /**
     * 质检--商品包装分页
     */
    @PostMapping("/page")
    public Page<EhsdQualityProductVo> page(@RequestBody EhsdQualityProductSelectDto dto) {
        return ehsdQualityProductService.getPage(dto);
    }

    /**
     * 质检--商品包装明细
     */
    @PostMapping("/detail")
    public EhsdQualityProductVo detail(@RequestBody BaseSelectDto dto) {
        return ehsdQualityProductService.detail(dto.getId());
    }

    /**
     * 质检--商品包装新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdQualityProductDto ehsdQualityProductDto) {
        ehsdQualityProductService.add(ehsdQualityProductDto);
    }

    /**
     * 质检--商品包装编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdQualityProductDto ehsdQualityProductDto) {
        ehsdQualityProductService.edit(ehsdQualityProductDto);
    }

    /**
     * 质检--商品包装删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        ehsdQualityProductService.delete(dto.getId());
    }

}
