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.EhsdQualityWorkshipVo;
import com.fjhx.sale.entity.quality.dto.EhsdQualityWorkshipSelectDto;
import com.fjhx.sale.entity.quality.dto.EhsdQualityWorkshipDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.quality.EhsdQualityWorkshipService;
import org.springframework.beans.factory.annotation.Autowired;


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

    @Autowired
    private EhsdQualityWorkshipService ehsdQualityWorkshipService;

    /**
     * 质检问题表分页
     */
    @PostMapping("/page")
    public Page<EhsdQualityWorkshipVo> page(@RequestBody EhsdQualityWorkshipSelectDto dto) {
        return ehsdQualityWorkshipService.getPage(dto);
    }

    /**
     * 质检问题表明细
     */
    @PostMapping("/detail")
    public EhsdQualityWorkshipVo detail(@RequestBody BaseSelectDto dto) {
        return ehsdQualityWorkshipService.detail(dto.getId());
    }

    /**
     * 质检问题表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdQualityWorkshipDto ehsdQualityWorkshipDto) {
        ehsdQualityWorkshipService.add(ehsdQualityWorkshipDto);
    }

    /**
     * 质检问题表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdQualityWorkshipDto ehsdQualityWorkshipDto) {
        ehsdQualityWorkshipService.edit(ehsdQualityWorkshipDto);
    }

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

}
