| | |
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alibaba.fastjson.JSONReader;
|
| | | import com.alibaba.fastjson.TypeReference;
|
| | | import com.moral.common.bean.ResultBean;
|
| | | import com.moral.common.exception.BusinessException;
|
| | | import com.moral.entity.Account;
|
| | | import com.moral.common.util.ValidateUtil;
|
| | | import com.moral.service.AccountService;
|
| | | import com.moral.service.DeviceService;
|
| | | import com.moral.service.HistoryService;
|
| | |
|
| | | /**
|
| | | * The Class ScreenController.
|
| | | * The Class ScreenController.大屏接口
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping(value = "screen")
|
| | |
| | | return resultMap;
|
| | | }
|
| | |
|
| | | @GetMapping("login1")
|
| | | public ResultBean<Account> screenLogin1(HttpServletRequest request) {
|
| | | ResultBean<Account> resultBean = new ResultBean<Account>(ResultBean.FAIL);
|
| | | try {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | if (!(parameters.containsKey("account") && parameters.containsKey("password"))) {
|
| | | resultBean.setMsg("用户名及密码不允许为空!");
|
| | | } else {
|
| | | resultBean = accountService.screenLogin1(parameters);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | resultBean = new ResultBean<Account>(e);
|
| | | }
|
| | | return resultBean;
|
| | | }
|
| | |
|
| | | /**
|
| | | * Gets the equipment states. 获取该账号下所有设备的状态
|
| | |
| | | @GetMapping("sensor-standard")
|
| | | public Map<String, Object> getStandardBySensor(@RequestParam("macKey") String macKey) {
|
| | | Map<String, Object> result = new HashMap<String, Object>();
|
| | | if (isEmpty(macKey)) {
|
| | | throw new BusinessException("参数不能为空!");
|
| | | } else {
|
| | | result.put("standard", getValue(macKey + "-standard"));
|
| | | }
|
| | | ValidateUtil.notEmpty(macKey, "参数不能为空!");
|
| | | result.put("standard", getValue(macKey + "-standard"));
|
| | | return result;
|
| | | }
|
| | |
|