package com.fjhx.victoriatourist.controller.quality;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.victoriatourist.entity.quality.vo.QualityInfoVo;
import com.fjhx.victoriatourist.entity.quality.dto.QualityInfoSelectDto;
import com.fjhx.victoriatourist.entity.quality.dto.QualityInfoDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.victoriatourist.service.quality.QualityInfoService;
import org.springframework.beans.factory.annotation.Autowired;


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

    @Autowired
    private QualityInfoService qualityInfoService;

    /**
     * 质检分页
     */
    @PostMapping("/page")
    public Page<QualityInfoVo> page(@RequestBody QualityInfoSelectDto dto) {
        return qualityInfoService.getPage(dto);
    }

    /**
     * 质检分页
     */
    @PostMapping("/page1")
    public Page<QualityInfoVo> page1(@RequestBody QualityInfoSelectDto dto) {
        return qualityInfoService.getPage1(dto);
    }

    /**
     * 质检明细
     */
    @PostMapping("/detail")
    public QualityInfoVo detail(@RequestBody BaseSelectDto dto) {
        return qualityInfoService.detail(dto.getId());
    }

    /**
     * 质检新增
     */
    @PostMapping("/add")
    public void add(@RequestBody QualityInfoDto qualityInfoDto) {
        qualityInfoService.add(qualityInfoDto);
    }

    /**
     * 质检编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody QualityInfoDto qualityInfoDto) {
        qualityInfoService.edit(qualityInfoDto);
    }

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

}
