代码修改
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
package org.nl.modules.system.rest;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.utils.PageUtil;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.start.auto.run.AutoRunService;
|
||||
import org.nl.start.auto.run.ThreadDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author /
|
||||
* 接口限流测试类
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/autorun")
|
||||
@Api(tags = "系统:查询自动线程")
|
||||
@RequiredArgsConstructor
|
||||
public class AutoRunController {
|
||||
|
||||
@Autowired
|
||||
private AutoRunService autoRunService;
|
||||
|
||||
@ApiOperation("查询自动线程")
|
||||
@Log("查询自动线程")
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> query(Map map) throws Exception {
|
||||
//List<ThreadDto> ThreadDtos = autoRunService.findByCondition(map);
|
||||
List<ThreadDto> ThreadDtos = autoRunService.findAll();
|
||||
return new ResponseEntity<>(PageUtil.toPage(ThreadDtos, ThreadDtos.size()), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("启动自动线程")
|
||||
@ApiOperation("启动自动线程")
|
||||
@PutMapping(value = "/start/{code}")
|
||||
public ResponseEntity<Object> start(@PathVariable String code) {
|
||||
autoRunService.startThread(code);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("停止自动线程")
|
||||
@ApiOperation("停止自动线程")
|
||||
@PutMapping(value = "/stop/{code}")
|
||||
public ResponseEntity<Object> execution(@PathVariable String code) {
|
||||
autoRunService.stopThread(code);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user