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.EhsdQualityProductColorVo;
import com.fjhx.sale.entity.quality.dto.EhsdQualityProductColorSelectDto;
import com.fjhx.sale.entity.quality.dto.EhsdQualityProductColorDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.quality.EhsdQualityProductColorService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 质检--产品规格 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-05-22
 */
@RestController
@RequestMapping("/ehsdQualityProductColor")
public class EhsdQualityProductColorController {

    @Autowired
    private EhsdQualityProductColorService ehsdQualityProductColorService;

    /**
     * 质检--产品规格分页
     */
    @PostMapping("/page")
    public Page<EhsdQualityProductColorVo> page(@RequestBody EhsdQualityProductColorSelectDto dto) {
        return ehsdQualityProductColorService.getPage(dto);
    }

    /**
     * 质检--产品规格明细
     */
    @PostMapping("/detail")
    public EhsdQualityProductColorVo detail(@RequestBody BaseSelectDto dto) {
        return ehsdQualityProductColorService.detail(dto.getId());
    }

    /**
     * 质检--产品规格新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdQualityProductColorDto ehsdQualityProductColorDto) {
        ehsdQualityProductColorService.add(ehsdQualityProductColorDto);
    }

    /**
     * 质检--产品规格编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdQualityProductColorDto ehsdQualityProductColorDto) {
        ehsdQualityProductColorService.edit(ehsdQualityProductColorDto);
    }

    /**
     * 质检--产品规格删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        ehsdQualityProductColorService.delete(dto.getId());
    }

}
