소스 검색

:bug: 修复 BUG. 代码修改,对于批量删除的处理

冷冷 7 년 전
부모
커밋
8d59163bfb

+ 66 - 65
pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/controller/ExecutionLogController.java

@@ -26,80 +26,81 @@ import com.pig4cloud.pigx.daemon.service.ExecutionLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
 import java.util.Map;
 
 
 /**
- *
- *
  * @author lengleng
  * @date 2018-08-03 22:15:56
  */
 @RestController
 @RequestMapping("/executionlog")
 public class ExecutionLogController {
-    @Autowired
-    private ExecutionLogService executionLogService;
-
-
-    /**
-    *  列表
-    * @param params
-    * @return
-    */
-    @GetMapping("/page")
-    public Page page(@RequestParam Map<String, Object> params) {
-      return  executionLogService.selectPage(new Query<>(params), new EntityWrapper<>());
-    }
-
-
-    /**
-     * 信息
-     * @param id
-     * @return R
-     */
-    @GetMapping("/{id}")
-    public R info(@PathVariable("id") String id){
-			ExecutionLog executionLog = executionLogService.selectById(id);
-
-			  return new R<>(executionLog);
-    }
-
-    /**
-     * 保存
-     * @param executionLog
-     * @return R
-     */
-    @PostMapping("/save")
-    public R save(@RequestBody ExecutionLog executionLog){
-			executionLogService.insert(executionLog);
-
-			  return new R<>(Boolean.TRUE);
-    }
-
-    /**
-     * 修改
-     * @param executionLog
-     * @return R
-     */
-    @PutMapping("/update")
-    public R update(@RequestBody ExecutionLog executionLog){
-			executionLogService.updateById(executionLog);
-
-      return new R<>(Boolean.TRUE);
-    }
-
-    /**
-     * 删除
-     * @param ids
-     * @return R
-     */
-    @DeleteMapping("/delete")
-    public R delete(@RequestBody String[] ids){
-			executionLogService.deleteBatchIds(Arrays.asList(ids));
-
-      return new R<>(Boolean.TRUE);
-    }
+	@Autowired
+	private ExecutionLogService executionLogService;
+
+
+	/**
+	 * 列表
+	 *
+	 * @param params
+	 * @return
+	 */
+	@GetMapping("/page")
+	public Page page(@RequestParam Map<String, Object> params) {
+		return executionLogService.selectPage(new Query<>(params), new EntityWrapper<>());
+	}
+
+
+	/**
+	 * 信息
+	 *
+	 * @param id
+	 * @return R
+	 */
+	@GetMapping("/{id}")
+	public R info(@PathVariable("id") String id) {
+		ExecutionLog executionLog = executionLogService.selectById(id);
+
+		return new R<>(executionLog);
+	}
+
+	/**
+	 * 保存
+	 *
+	 * @param executionLog
+	 * @return R
+	 */
+	@PostMapping("/save")
+	public R save(@RequestBody ExecutionLog executionLog) {
+		executionLogService.insert(executionLog);
+
+		return new R<>(Boolean.TRUE);
+	}
+
+	/**
+	 * 修改
+	 *
+	 * @param executionLog
+	 * @return R
+	 */
+	@PutMapping("/update")
+	public R update(@RequestBody ExecutionLog executionLog) {
+		executionLogService.updateById(executionLog);
+
+		return new R<>(Boolean.TRUE);
+	}
+
+	/**
+	 * 删除
+	 *
+	 * @param id
+	 * @return R
+	 */
+	@DeleteMapping("/{id}")
+	public R delete(@PathVariable String id) {
+
+		return new R<>(executionLogService.deleteById(id));
+	}
 
 }

+ 65 - 65
pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/controller/StatusTraceLogController.java

@@ -26,80 +26,80 @@ import com.pig4cloud.pigx.daemon.service.StatusTraceLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
 import java.util.Map;
 
 
 /**
- *
- *
  * @author lengleng
  * @date 2018-08-03 22:15:45
  */
 @RestController
 @RequestMapping("/statustracelog")
 public class StatusTraceLogController {
-    @Autowired
-    private StatusTraceLogService statusTraceLogService;
-
-
-    /**
-    *  列表
-    * @param params
-    * @return
-    */
-    @GetMapping("/page")
-    public Page page(@RequestParam Map<String, Object> params) {
-      return  statusTraceLogService.selectPage(new Query<>(params), new EntityWrapper<>());
-    }
-
-
-    /**
-     * 信息
-     * @param id
-     * @return R
-     */
-    @GetMapping("/{id}")
-    public R info(@PathVariable("id") String id){
-			StatusTraceLog statusTraceLog = statusTraceLogService.selectById(id);
-
-			  return new R<>(statusTraceLog);
-    }
-
-    /**
-     * 保存
-     * @param statusTraceLog
-     * @return R
-     */
-    @PostMapping("/save")
-    public R save(@RequestBody StatusTraceLog statusTraceLog){
-			statusTraceLogService.insert(statusTraceLog);
-
-			  return new R<>(Boolean.TRUE);
-    }
-
-    /**
-     * 修改
-     * @param statusTraceLog
-     * @return R
-     */
-    @PutMapping("/update")
-    public R update(@RequestBody StatusTraceLog statusTraceLog){
-			statusTraceLogService.updateById(statusTraceLog);
-
-      return new R<>(Boolean.TRUE);
-    }
-
-    /**
-     * 删除
-     * @param ids
-     * @return R
-     */
-    @DeleteMapping("/delete")
-    public R delete(@RequestBody String[] ids){
-			statusTraceLogService.deleteBatchIds(Arrays.asList(ids));
-
-      return new R<>(Boolean.TRUE);
-    }
+	@Autowired
+	private StatusTraceLogService statusTraceLogService;
+
+
+	/**
+	 * 列表
+	 *
+	 * @param params
+	 * @return
+	 */
+	@GetMapping("/page")
+	public Page page(@RequestParam Map<String, Object> params) {
+		return statusTraceLogService.selectPage(new Query<>(params), new EntityWrapper<>());
+	}
+
+
+	/**
+	 * 信息
+	 *
+	 * @param id
+	 * @return R
+	 */
+	@GetMapping("/{id}")
+	public R info(@PathVariable("id") String id) {
+		StatusTraceLog statusTraceLog = statusTraceLogService.selectById(id);
+
+		return new R<>(statusTraceLog);
+	}
+
+	/**
+	 * 保存
+	 *
+	 * @param statusTraceLog
+	 * @return R
+	 */
+	@PostMapping("/save")
+	public R save(@RequestBody StatusTraceLog statusTraceLog) {
+		statusTraceLogService.insert(statusTraceLog);
+
+		return new R<>(Boolean.TRUE);
+	}
+
+	/**
+	 * 修改
+	 *
+	 * @param statusTraceLog
+	 * @return R
+	 */
+	@PutMapping("/update")
+	public R update(@RequestBody StatusTraceLog statusTraceLog) {
+		statusTraceLogService.updateById(statusTraceLog);
+
+		return new R<>(Boolean.TRUE);
+	}
+
+	/**
+	 * 删除
+	 *
+	 * @param id
+	 * @return R
+	 */
+	@DeleteMapping("/{id}")
+	public R delete(@PathVariable("id") String id) {
+		return new R<>(statusTraceLogService.deleteById(id));
+	}
 
 }