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.EhsdQualityMarkingDetailVo;
import com.fjhx.sale.entity.quality.dto.EhsdQualityMarkingDetailSelectDto;
import com.fjhx.sale.entity.quality.dto.EhsdQualityMarkingDetailDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.quality.EhsdQualityMarkingDetailService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 质检打标明细表 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-05-25
 */
@RestController
@RequestMapping("/ehsdQualityMarkingDetail")
public class EhsdQualityMarkingDetailController {

    @Autowired
    private EhsdQualityMarkingDetailService ehsdQualityMarkingDetailService;

    /**
     * 质检打标明细表分页
     */
    @PostMapping("/page")
    public Page<EhsdQualityMarkingDetailVo> page(@RequestBody EhsdQualityMarkingDetailSelectDto dto) {
        return ehsdQualityMarkingDetailService.getPage(dto);
    }

    /**
     * 质检打标明细表明细
     */
    @PostMapping("/detail")
    public EhsdQualityMarkingDetailVo detail(@RequestBody BaseSelectDto dto) {
        return ehsdQualityMarkingDetailService.detail(dto.getId());
    }

    /**
     * 质检打标明细表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdQualityMarkingDetailDto ehsdQualityMarkingDetailDto) {
        ehsdQualityMarkingDetailService.add(ehsdQualityMarkingDetailDto);
    }

    /**
     * 质检打标明细表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdQualityMarkingDetailDto ehsdQualityMarkingDetailDto) {
        ehsdQualityMarkingDetailService.edit(ehsdQualityMarkingDetailDto);
    }

    /**
     * 质检打标明细表删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        ehsdQualityMarkingDetailService.delete(dto.getId());
    }

}
