xufenglei
2017-12-07 dba72443e05e7b0a52ee85bfd9f4641aebc42c60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.moral.controller;
 
import java.util.List;
 
import javax.annotation.Resource;
 
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.RestController;
 
import com.github.pagehelper.PageHelper;
import com.moral.common.bean.PageBean;
import com.moral.common.bean.ResultBean;
import com.moral.entity.Device;
import com.moral.entity.OperateUser;
import com.moral.service.DeviceService;
import com.moral.service.OperateUserService;
 
@RestController
@RequestMapping(value = "mobile")
@CrossOrigin(origins = "*", maxAge = 3600)
public class MobileController {
 
    @Resource
    private OperateUserService operateUserService;
 
    @Resource
    private DeviceService deviceService;
 
    // 1登录
    @GetMapping(value = "accountlogin")
    public ResultBean<OperateUser> mobileLogin(String username, String password) {
        OperateUser operateUser = operateUserService.mobileLogin(username,password);
        return new ResultBean<OperateUser>(operateUser); 
    }
    
    // 4修改密码
    @GetMapping(value = "upPassword")
    public ResultBean<OperateUser> updatePassword(Integer uid, String password, String newpassword) {
        OperateUser operateUser = operateUserService.updatePassword(uid,password,newpassword);
        return new ResultBean<OperateUser>(operateUser); 
    }
 
    // 11终端采集
    @GetMapping(value = "reportDevice")
    public ResultBean<String> installDevice(Device device) {
        deviceService.saveOrUpdateDevice(device);
        return new ResultBean<String>("");
    }
 
    // 5我安装的设备(分页)
    @GetMapping(value = "myRelease")
    public ResultBean<List<Device>> getInstallDevicesByOperateUser(Integer uid, Integer pageIndex, Integer pageSize) {
        List<Device> devices = deviceService.getInstallDevicesByOperateUser(uid,pageIndex,pageSize);
        return new ResultBean<List<Device>>(devices);
    }
 
    @GetMapping(value = "getEquInfoByMac")
    public void getEquInfoByMac(String mac) {
    }
 
    @GetMapping(value = "getMpointsByAreaName")
    public void getMpointsByAreaName(String areaName) {
    }
 
    @GetMapping(value = "getOrgsByAreaName")
    public void getOrgsByAreaName(String areaName) {
 
    }
}