| | |
| | | |
| | | @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,"调用服务成功!"); |
| | | } |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |