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.EhsdQualityProblemVo;
import com.fjhx.sale.entity.quality.dto.EhsdQualityProblemSelectDto;
import com.fjhx.sale.entity.quality.dto.EhsdQualityProblemDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.quality.EhsdQualityProblemService;
import org.springframework.beans.factory.annotation.Autowired;


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

    @Autowired
    private EhsdQualityProblemService ehsdQualityProblemService;

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

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

    /**
     * 质检问题表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdQualityProblemDto ehsdQualityProblemDto) {
        ehsdQualityProblemService.add(ehsdQualityProblemDto);
    }

    /**
     * 质检问题表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdQualityProblemDto ehsdQualityProblemDto) {
        ehsdQualityProblemService.edit(ehsdQualityProblemDto);
    }

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

}
