package com.fjhx.controller.quality;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.params.quality.*;
import com.fjhx.service.quality.QualityInfoService;
import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 质检 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2023-02-13
 */
@RestController
@RequestMapping("/qualityInfo")
public class QualityInfoController {

    @Autowired
    private QualityInfoService qualityInfoService;

    @PostMapping("/page")
    public R page(@RequestBody QualityInfoPageDto dto) {
        Page<QualityInfoPageVo> result = qualityInfoService.getPage(dto);
        return R.success(result);
    }

    /**
     * 明细列表
     */
    @PostMapping("/detailsList")
    public R detailsList(@Validated @RequestBody GetDetailsListDto dto) {
        List<QualityDetailsVo> result = qualityInfoService.getDetailsList(dto);
        return R.success(result);
    }

    // @PostMapping("/add")
    // public R add(@RequestBody QualityInfoVo qualityInfoVo){
    //     qualityInfoService.add(qualityInfoVo);
    //     return R.success();
    // }

    // @PostMapping("/edit")
    // public R edit(@RequestBody QualityInfoVo qualityInfoVo) {
    //     qualityInfoService.edit(qualityInfoVo);
    //     return R.success();
    // }

    // @PostMapping("/delete")
    // public R delete(@RequestBody QualityInfoVo qualityInfoVo){
    //     qualityInfoService.delete(qualityInfoVo);
    //     return R.success();
    // }

}

