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.EhsdQualityCartonsVo;
import com.fjhx.sale.entity.quality.dto.EhsdQualityCartonsSelectDto;
import com.fjhx.sale.entity.quality.dto.EhsdQualityCartonsDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.quality.EhsdQualityCartonsService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 质检纸箱表 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-05-22
 */
@RestController
@RequestMapping("/ehsdQualityCartons")
public class EhsdQualityCartonsController {

    @Autowired
    private EhsdQualityCartonsService ehsdQualityCartonsService;

    /**
     * 质检纸箱表分页
     */
    @PostMapping("/page")
    public Page<EhsdQualityCartonsVo> page(@RequestBody EhsdQualityCartonsSelectDto dto) {
        return ehsdQualityCartonsService.getPage(dto);
    }

    /**
     * 质检纸箱表明细
     */
    @PostMapping("/detail")
    public EhsdQualityCartonsVo detail(@RequestBody BaseSelectDto dto) {
        return ehsdQualityCartonsService.detail(dto.getId());
    }

    /**
     * 质检纸箱表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdQualityCartonsDto ehsdQualityCartonsDto) {
        ehsdQualityCartonsService.add(ehsdQualityCartonsDto);
    }

    /**
     * 质检纸箱表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdQualityCartonsDto ehsdQualityCartonsDto) {
        ehsdQualityCartonsService.edit(ehsdQualityCartonsDto);
    }

    /**
     * 质检纸箱表删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        ehsdQualityCartonsService.delete(dto.getId());
    }

}
