Procházet zdrojové kódy

优化代码结构

yangxiaokun před 2 roky
rodič
revize
598057f339

+ 5 - 6
src/main/java/com/zy/bms/controller/LogsController.java

@@ -1,13 +1,12 @@
 package com.zy.bms.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.zy.bms.common.ServerResponse;
+import com.zy.bms.entity.Instructions;
 import com.zy.bms.pojo.io.LogsIO;
 import com.zy.bms.service.IInstructionsService;
 import com.zy.bms.service.ILogsService;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 
@@ -38,7 +37,7 @@ public class LogsController {
      * 获取全部的指令
      */
     @GetMapping("instruction.do")
-    public ServerResponse getAllInstruction() {
-        return ServerResponse.success(instructionsService.list());
+    public ServerResponse getAllInstruction(@RequestParam(required = false) Integer type) {
+        return ServerResponse.success(instructionsService.list(new QueryWrapper<Instructions>().in("type", 0, type)));
     }
 }