whycxzp
2023-12-20 abf4ce6d752dccb6012f23f7a8d43a5bcd9ac60c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.FileParam;
import com.whyc.pojo.TestParam;
import com.whyc.service.TestParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@RestController
@RequestMapping(("testParam"))
@Api(tags = "测试参数-分级评价")
public class TestParamController {
 
    @Autowired
    private TestParamService service;
 
    @ApiOperation("分级评价-系数及阈值查询")
    @GetMapping("factorsAndThreshold")
    public Response<TestParam> getFactorsAndThreshold(){
        TestParam param =  service.getFactorsAndThreshold();
        return new Response().set(1,param);
    }
 
    @ApiOperation("分级评价-系数及阈值更新及禁用启用")
    @PutMapping("factorsAndThreshold")
    public Response updateFactorsAndThreshold(@RequestBody TestParam param){
        service.updateFactorsAndThreshold(param);
        return new Response().set(1,"更新完成");
    }
 
    @ApiOperation("服务调用测试")
    @GetMapping("callService")
    public Response<TestParam> callService(int seconds) throws InterruptedException {
        service.callService(seconds);
        return new Response().set(1,"调用服务成功!");
    }
 
}