沈斌
2017-12-14 96fd5ae925bcdfa19772da24b1f94a0c027284ff
src/main/java/com/moral/controller/MobileController.java
@@ -1,12 +1,17 @@
package com.moral.controller;
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;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.moral.common.bean.ResultBean;
@@ -91,7 +96,7 @@
    * @return the install devices by operate user
    */
   @GetMapping(value = "myRelease")
   public ResultBean<List<Device>> getInstallDevicesByOperateUser(Integer uid, Integer pageIndex, Integer pageSize) {
   public ResultBean<List<Device>> getInstallDevicesByOperateUser(@RequestParam(value="uid", required=true)Integer uid, @RequestParam(defaultValue="0")Integer pageIndex, @RequestParam(defaultValue="0")Integer pageSize) {
      List<Device> devices = deviceService.getInstallDevicesByOperateUser(uid,pageIndex,pageSize);
      return new ResultBean<List<Device>>(devices);
   }
@@ -103,7 +108,7 @@
    * @return the device by mac
    */
   @GetMapping(value = "getEquInfoByMac")
   public ResultBean<Device> getDeviceByMac(String mac) {
   public ResultBean<Device> getDeviceByMac(@RequestParam(value="mac", required=true)String mac) {
      Device device = deviceService.getDeviceByMac(mac);
      return new ResultBean<Device>(device);
   }
@@ -115,8 +120,9 @@
    * @return the monitor points by area name
    */
   @GetMapping(value = "getMpointsByAreaName")
   public ResultBean<List<MonitorPoint>> getMonitorPointsByAreaName(String areaName) {
      List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByAreaName(areaName);
   public ResultBean<List<MonitorPoint>> getMonitorPointsByAreaName(HttpServletRequest request) {
      Map<String, Object> parameters = getParametersStartingWith(request, null);
      List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByAreaName(parameters);
      return new ResultBean<List<MonitorPoint>>(monitorPoints);
   }
@@ -127,8 +133,9 @@
    * @return the organizations by area name
    */
   @GetMapping(value = "getOrgsByAreaName")
   public ResultBean<List<Organization>> getOrganizationsByAreaName(String areaName) {
      List<Organization> organizations = organizationService.getOrganizationsByAreaName(areaName);
   public ResultBean<List<Organization>> getOrganizationsByAreaName(HttpServletRequest request) {
      Map<String, Object> parameters = getParametersStartingWith(request, null);
      List<Organization> organizations = organizationService.getOrganizationsByAreaName(parameters);
      return new ResultBean<List<Organization>>(organizations);
   }
}