From 00e38ff225eb948f5234934afc01aa54c94e0de6 Mon Sep 17 00:00:00 2001
From: 于紫祥_1901 <email@yuzixiang_1910>
Date: Sat, 10 Oct 2020 11:29:36 +0800
Subject: [PATCH] update

---
 src/main/java/com/moral/controller/MonitorPointController.java |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/moral/controller/MonitorPointController.java b/src/main/java/com/moral/controller/MonitorPointController.java
index 73d7170..b32c4ba 100644
--- a/src/main/java/com/moral/controller/MonitorPointController.java
+++ b/src/main/java/com/moral/controller/MonitorPointController.java
@@ -6,7 +6,13 @@
 import com.moral.service.MonitorPointService;
 import org.springframework.web.bind.annotation.*;
 
+import static com.moral.common.util.WebUtils.getParametersStartingWith;
+
+import java.util.List;
+import java.util.Map;
+
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 
 
 @RestController
@@ -33,7 +39,7 @@
      */
     @GetMapping("get-by-id")
     public ResultBean getById(Integer id){
-        MonitorPoint monitorPoint = monitorPointService.selectWithRelationById(id);
+        MonitorPoint monitorPoint = monitorPointService.queryWithRelationById(id);
         ResultBean resultBean = new ResultBean(ResultBean.SUCCESS);
         resultBean.setData(monitorPoint);
         return resultBean;
@@ -44,4 +50,18 @@
         ResultBean resultBean = new ResultBean(ResultBean.SUCCESS);
         return resultBean;
     }
+    
+    @GetMapping("list/{name}")
+	public ResultBean<List<MonitorPoint>> getMonitorPointsByName(@PathVariable("name") String name) {
+		List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByName(name);
+		return new ResultBean<List<MonitorPoint>>(monitorPoints);
+	}
+    
+    @GetMapping("list/region")
+	public ResultBean<List<MonitorPoint>> getMonitorPointsByRegion(HttpServletRequest request) {
+    	Map<String, Object> parameters = getParametersStartingWith(request, null);
+		List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByRegion(parameters);
+		return new ResultBean<List<MonitorPoint>>(monitorPoints);
+	}
+
 }

--
Gitblit v1.8.0