package com.fjhx.sale.controller.quality;

import com.fjhx.sale.entity.quality.po.EhsdQuality;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.quality.vo.EhsdQualityVo;
import com.fjhx.sale.entity.quality.dto.EhsdQualitySelectDto;
import com.fjhx.sale.entity.quality.dto.EhsdQualityDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.quality.EhsdQualityService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 质检基础信息表 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-05-22
 */
@RestController
@RequestMapping("/ehsdQuality")
public class EhsdQualityController {

    @Autowired
    private EhsdQualityService ehsdQualityService;

    /**
     * 质检基础信息表分页
     */
    @PostMapping("/page")
    public Page<EhsdQualityVo> page(@RequestBody EhsdQualitySelectDto dto) {
        return ehsdQualityService.getPage(dto);
    }

    /**
     * 质检基础信息表明细
     */
    @PostMapping("/detail")
    public EhsdQuality detail(@RequestBody BaseSelectDto dto) {
        return ehsdQualityService.detail(dto.getId());
    }

    /**
     * 质检基础信息表提交
     */
    @PostMapping("/submit")
    public void add(@RequestBody EhsdQualityDto ehsdQualityDto) {
        ehsdQualityService.submit(ehsdQualityDto);
    }

    /**
     * 质检基础信息表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdQualityDto ehsdQualityDto) {
        ehsdQualityService.edit(ehsdQualityDto);
    }

    /**
     * 质检基础信息表删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        ehsdQualityService.delete(dto.getId());
    }

}
