whycxzp
2023-12-20 14912f45bdce261601e1476b8bd4a3a502d09d52
服务调用测试
2个文件已修改
11 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/TestParamController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/TestParamService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/TestParamController.java
@@ -33,7 +33,7 @@
    @ApiOperation("服务调用测试")
    @GetMapping("callService")
    public Response<TestParam> callService(int seconds) throws InterruptedException {
    public Response<TestParam> callService(@RequestParam Integer seconds) throws InterruptedException {
        service.callService(seconds);
        return new Response().set(1,"调用服务成功!");
    }
src/main/java/com/whyc/service/TestParamService.java
@@ -25,4 +25,13 @@
        mapper.updateById(param);
    }
    public void callService(int seconds) throws InterruptedException {
        //毫秒
        int milliseconds = seconds * 1000;
        int count = milliseconds/100;
        for (int i = 0; i < count; i++) {
            getFactorsAndThreshold();
            Thread.sleep(100);
        }
    }
}