package com.ruoyi.web.work.api;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.work.domain.Report;
import com.ruoyi.web.work.domain.Result;
import com.ruoyi.web.work.service.IResultService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/app/obxResult")
@Api(tags = "小程序检测报告结果详情")
public class Api_ObxResultController {

    @Autowired
    private IResultService obxResultService;


    /**
     * 根据检测报告ID获取报告结果
     * @param obrId
     * @return
     */
    @ApiOperation(value = "根据检测报告ID获取报告结果")
    @GetMapping("/{obrId}")
    public AjaxResult getObxResultByObrId(@PathVariable String obrId){
        List<Result> obxResults = obxResultService.getObxResultByObrId(obrId);
        return AjaxResult.success(obxResults);
    }
}
