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.EhsdQualitySiteTestVo;
import com.fjhx.sale.entity.quality.dto.EhsdQualitySiteTestSelectDto;
import com.fjhx.sale.entity.quality.dto.EhsdQualitySiteTestDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.quality.EhsdQualitySiteTestService;
import org.springframework.beans.factory.annotation.Autowired;


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

    @Autowired
    private EhsdQualitySiteTestService ehsdQualitySiteTestService;

    /**
     * 质检工艺表分页
     */
    @PostMapping("/page")
    public Page<EhsdQualitySiteTestVo> page(@RequestBody EhsdQualitySiteTestSelectDto dto) {
        return ehsdQualitySiteTestService.getPage(dto);
    }

    /**
     * 质检工艺表明细
     */
    @PostMapping("/detail")
    public EhsdQualitySiteTestVo detail(@RequestBody BaseSelectDto dto) {
        return ehsdQualitySiteTestService.detail(dto.getId());
    }

    /**
     * 质检工艺表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdQualitySiteTestDto ehsdQualitySiteTestDto) {
        ehsdQualitySiteTestService.add(ehsdQualitySiteTestDto);
    }

    /**
     * 质检工艺表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdQualitySiteTestDto ehsdQualitySiteTestDto) {
        ehsdQualitySiteTestService.edit(ehsdQualitySiteTestDto);
    }

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

}
