|
@@ -3,7 +3,8 @@ package com.ruoyi.sim.controller;
|
|
|
import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -30,6 +31,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/sim/task")
|
|
|
+@Api("任务Controller")
|
|
|
public class TaskController extends BaseController {
|
|
|
@Autowired
|
|
|
private ITaskService taskService;
|
|
@@ -37,7 +39,7 @@ public class TaskController extends BaseController {
|
|
|
/**
|
|
|
* 查询任务列表
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('sim:task:list')")
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:task:list')")
|
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo list(Task task) {
|
|
|
startPage();
|
|
@@ -48,9 +50,9 @@ public class TaskController extends BaseController {
|
|
|
/**
|
|
|
* 导出任务列表
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('sim:task:export')")
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:task:export')")
|
|
|
@Log(title = "任务", businessType = BusinessType.EXPORT)
|
|
|
- @PostMapping("/export")
|
|
|
+ // @PostMapping("/export")
|
|
|
public void export(HttpServletResponse response, Task task) {
|
|
|
List<Task> list = taskService.selectTaskList(task);
|
|
|
ExcelUtil<Task> util = new ExcelUtil<Task>(Task.class);
|
|
@@ -60,7 +62,7 @@ public class TaskController extends BaseController {
|
|
|
/**
|
|
|
* 获取任务详细信息
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('sim:task:query')")
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:task:query')")
|
|
|
@GetMapping(value = "/{taskId}")
|
|
|
public AjaxResult getInfo(@PathVariable("taskId") Long taskId) {
|
|
|
return success(taskService.selectTaskByTaskId(taskId));
|
|
@@ -69,7 +71,7 @@ public class TaskController extends BaseController {
|
|
|
/**
|
|
|
* 新增任务
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('sim:task:add')")
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:task:add')")
|
|
|
@Log(title = "任务", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody Task task) {
|
|
@@ -79,7 +81,7 @@ public class TaskController extends BaseController {
|
|
|
/**
|
|
|
* 修改任务
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('sim:task:edit')")
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:task:edit')")
|
|
|
@Log(title = "任务", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody Task task) {
|
|
@@ -89,10 +91,22 @@ public class TaskController extends BaseController {
|
|
|
/**
|
|
|
* 删除任务
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('sim:task:remove')")
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:task:remove')")
|
|
|
@Log(title = "任务", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{taskIds}")
|
|
|
public AjaxResult remove(@PathVariable Long[] taskIds) {
|
|
|
return toAjax(taskService.deleteTaskByTaskIds(taskIds));
|
|
|
}
|
|
|
+
|
|
|
+ // -------------------------------- tom add --------------------------------
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ */
|
|
|
+ // @PreAuthorize("@ss.hasPermi('sim:task:query')")
|
|
|
+ @GetMapping("/getInfoForAdd/{simType}")
|
|
|
+ @ApiOperation("getInfoForAdd")
|
|
|
+ public AjaxResult getInfoForAdd(@PathVariable("simType") String simType) {
|
|
|
+ return success(taskService.selectNewTaskViaSimType(simType));
|
|
|
+ }
|
|
|
}
|