package com.test.test.controller;

import com.test.common.core.controller.BaseController;
import com.test.common.core.domain.AjaxResult;
import com.test.test.domain.TestCaseResult;
import com.test.test.domain.qo.IDQO;
import com.test.test.service.ITestCaseResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 用例步骤执行报告Controller
 *
 * @author liangdl
 * @date 2025-03-14
 */
@RestController
@RequestMapping("/test/testCaseStepResult")
public class TestCaseResultController extends BaseController
{
    @Autowired
    private ITestCaseResultService testCaseResultService;

    /**
     * 获取用例步骤执行报告详细信息
     */
    @PostMapping(value = "/detail")
    public AjaxResult getInfo(@RequestBody IDQO qo)
    {
        return success(testCaseResultService.selectTestCaseResultById(qo.getId()));
    }

    @GetMapping("/list")
    public AjaxResult getList(@RequestParam String sid) {
        TestCaseResult testCaseResult = new TestCaseResult();
        testCaseResult.setCaseSid(sid);
        return success(testCaseResultService.selectTestCaseResultList(testCaseResult));
    }
}
