于紫祥_1901
2020-12-23 94d4a4e7600665f6b40b6d791b798b498196191b
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
@@ -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);
   }
}