package com.tuoheng.miniprogram.controller;

import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.miniprogram.entity.InspectionFile;
import com.tuoheng.miniprogram.entity.dto.QuestionIdentificationDto;
import com.tuoheng.miniprogram.entity.query.InspectionFileQuery;
import com.tuoheng.miniprogram.service.IInspectionFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 问题管理 前端控制器
 *
 * @Author ChengWang
 * @Date 2022/11/23
 */
@RestController
@RequestMapping("/inspectionFile")
public class InspectionFileController {

    @Autowired
    private IInspectionFileService iInspectionFileService;

    /**
     * 待确认问题
     * @param query
     * @return
     */
    @GetMapping("/unconfirmedQuestion")
    public JsonResult unconfirmedQuestion(InspectionFileQuery query){
        return iInspectionFileService.unconfirmedQuestion(query);
    }

    /**
     * 已确认问题
     * @param query
     * @return
     */
    @GetMapping("/confirmedQuestion")
    public JsonResult confirmedQuestion(InspectionFileQuery query){
        return iInspectionFileService.confirmedQuestion(query);
    }

    /**
     * 已忽略问题
     * @param query
     * @return
     */
    @GetMapping("/ignoredQuestion")
    public JsonResult ignoredQuestion(InspectionFileQuery query){
        return iInspectionFileService.ignoredQuestion(query);
    }

    /**
     * 确认问题
     * @param entity
     * @return
     */
    @PutMapping("/confirm")
    public JsonResult confirm(@RequestBody InspectionFile entity){
        return iInspectionFileService.confirm(entity);
    }

    /**
     * 忽略问题
     * @param entity
     * @return
     */
    @PutMapping("/ignore")
    public JsonResult ignore(@RequestBody InspectionFile entity){
        return iInspectionFileService.ignore(entity);
    }


    /**
     * 问题标识
     * @param dto
     * @return
     */
    @PutMapping("/identification")
    public JsonResult questionIdentification(@RequestBody QuestionIdentificationDto dto){
        return iInspectionFileService.questionIdentification(dto);
    }


    /**
     *查看问题及结果
     * @param id
     * @return
     */
    @GetMapping("/seeQuestion/{id}")
    public JsonResult seeQuestion(@PathVariable("id") String id){
        return iInspectionFileService.seeQuestion(id);
    }

    /**
     * 导航
     * @param id
     * @return
     */
    @GetMapping("/navigation/{id}")
    public JsonResult navigation(@PathVariable("id") String id){
        return iInspectionFileService.navigation(id);
    }

    /**
     * 问题处理统计
     * @return
     */
    @GetMapping("/handleCount")
    public JsonResult handleCount(){
        return iInspectionFileService.handleCount();
    }

    /**
     * 观看回放
     * @param id
     * @return
     */
    @GetMapping("/playback/{id}")
    public JsonResult playback(@PathVariable("id") String id){
        return iInspectionFileService.playback(id);
    }



}
