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.EhsdQualityAqlVo;
import com.fjhx.sale.entity.quality.dto.EhsdQualityAqlSelectDto;
import com.fjhx.sale.entity.quality.dto.EhsdQualityAqlDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.quality.EhsdQualityAqlService;
import org.springframework.beans.factory.annotation.Autowired;


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

    @Autowired
    private EhsdQualityAqlService ehsdQualityAqlService;

    /**
     * 质检AQL表分页
     */
    @PostMapping("/page")
    public Page<EhsdQualityAqlVo> page(@RequestBody EhsdQualityAqlSelectDto dto) {
        return ehsdQualityAqlService.getPage(dto);
    }

    /**
     * 质检AQL表明细
     */
    @PostMapping("/detail")
    public EhsdQualityAqlVo detail(@RequestBody BaseSelectDto dto) {
        return ehsdQualityAqlService.detail(dto.getId());
    }

    /**
     * 质检AQL表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdQualityAqlDto ehsdQualityAqlDto) {
        ehsdQualityAqlService.add(ehsdQualityAqlDto);
    }

    /**
     * 质检AQL表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdQualityAqlDto ehsdQualityAqlDto) {
        ehsdQualityAqlService.edit(ehsdQualityAqlDto);
    }

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

}
