xufenglei
2017-12-19 409696535bdc86f09b57582a355087a2120cb74c
src/main/java/com/moral/controller/MobileController.java
@@ -14,7 +14,7 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.moral.common.bean.ResultBean;
import com.moral.common.bean.AppData;
import com.moral.entity.Device;
import com.moral.entity.MonitorPoint;
import com.moral.entity.OperateUser;
@@ -56,9 +56,9 @@
    * @return the result bean
    */
   @GetMapping("accountlogin")
   public ResultBean<OperateUser> mobileLogin(String username, String password) {
   public AppData<OperateUser> mobileLogin(String username, String password) {
      OperateUser operateUser = operateUserService.mobileLogin(username,password);
      return new ResultBean<OperateUser>(operateUser);
      return new AppData<OperateUser>(operateUser);
   }
   
   /**
@@ -70,9 +70,9 @@
    * @return the result bean
    */
   @GetMapping("upPassword")
   public ResultBean<OperateUser> updatePassword(Integer uid, String password, String newpassword) {
   public AppData<OperateUser> updatePassword(Integer uid, String password, String newpassword) {
      OperateUser operateUser = operateUserService.updatePassword(uid,password,newpassword);
      return new ResultBean<OperateUser>(operateUser);
      return new AppData<OperateUser>(operateUser);
   }
   /**
@@ -82,9 +82,9 @@
    * @return the result bean
    */
   @GetMapping("reportDevice")
   public ResultBean<String> installDevice(Device device) {
   public AppData<String> installDevice(Device device) {
      deviceService.saveOrUpdateDevice(device);
      return new ResultBean<String>("");
      return new AppData<String>("");
   }
   /**
@@ -96,10 +96,10 @@
    * @return the install devices by operate user
    */
   @GetMapping("myRelease")
   public ResultBean<List<Device>> getInstallDevicesByOperateUser(@RequestParam(value="uid", required=true)Integer uid,
   public AppData<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);
      return new AppData<List<Device>>(devices);
   }
   /**
@@ -109,9 +109,9 @@
    * @return the device by mac
    */
   @GetMapping("getEquInfoByMac")
   public ResultBean<Device> getDeviceByMac(@RequestParam(value="mac", required=true)String mac) {
   public AppData<Device> getDeviceByMac(@RequestParam(value="mac", required=true)String mac) {
      Device device = deviceService.getDeviceByMac(mac);
      return new ResultBean<Device>(device);
      return new AppData<Device>(device);
   }
   /**
@@ -121,10 +121,10 @@
    * @return the monitor points by area name
    */
   @GetMapping("getMpointsByAreaName")
   public ResultBean<List<MonitorPoint>> getMonitorPointsByAreaName(HttpServletRequest request) {
   public AppData<List<MonitorPoint>> getMonitorPointsByAreaName(HttpServletRequest request) {
      Map<String, Object> parameters = getParametersStartingWith(request, null);
      List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByAreaName(parameters);
      return new ResultBean<List<MonitorPoint>>(monitorPoints);
      return new AppData<List<MonitorPoint>>(monitorPoints);
   }
   /**
@@ -134,9 +134,9 @@
    * @return the organizations by area name
    */
   @GetMapping("getOrgsByAreaName")
   public ResultBean<List<Organization>> getOrganizationsByAreaName(HttpServletRequest request) {
   public AppData<List<Organization>> getOrganizationsByAreaName(HttpServletRequest request) {
      Map<String, Object> parameters = getParametersStartingWith(request, null);
      List<Organization> organizations = organizationService.getOrganizationsByAreaName(parameters);
      return new ResultBean<List<Organization>>(organizations);
      return new AppData<List<Organization>>(organizations);
   }
}