|  |  | 
 |  |  | 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;
 | 
 |  |  | 
 |  |  |     * @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);  | 
 |  |  |    }
 | 
 |  |  |    
 | 
 |  |  |    /**
 | 
 |  |  | 
 |  |  |     * @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);  | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    /**
 | 
 |  |  | 
 |  |  |     * @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>("");
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    /**
 | 
 |  |  | 
 |  |  |     * @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);
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    /**
 | 
 |  |  | 
 |  |  |     * @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);
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    /**
 | 
 |  |  | 
 |  |  |     * @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);
 | 
 |  |  |    }
 | 
 |  |  | 
 | 
 |  |  |    /**
 | 
 |  |  | 
 |  |  |     * @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);
 | 
 |  |  |    }
 | 
 |  |  | }
 |