From 7894fc69ea496dbcc024870d002850af71b68f49 Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Fri, 08 Dec 2017 17:31:37 +0800 Subject: [PATCH] app 接口 --- src/main/java/com/moral/controller/ScreenController.java | 30 ++++-------------------------- 1 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java index f752dc3..54c309f 100644 --- a/src/main/java/com/moral/controller/ScreenController.java +++ b/src/main/java/com/moral/controller/ScreenController.java @@ -4,7 +4,6 @@ import static com.moral.common.util.RedisUtil.hasKey; import static com.moral.common.util.ResourceUtil.getValue; import static com.moral.common.util.WebUtils.getParametersStartingWith; -import static org.springframework.util.ObjectUtils.isEmpty; import java.io.IOException; import java.io.InputStreamReader; @@ -26,15 +25,13 @@ 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") @@ -84,22 +81,6 @@ 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. ��������������������������������������� @@ -155,12 +136,9 @@ */ @GetMapping("sensor-standard") public Map<String, Object> getStandardBySensor(@RequestParam("macKey") String macKey) { + ValidateUtil.notEmpty(macKey, "param.is.null"); Map<String, Object> result = new HashMap<String, Object>(); - if (isEmpty(macKey)) { - throw new BusinessException("���������������������"); - } else { - result.put("standard", getValue(macKey + "-standard")); - } + result.put("standard", getValue(macKey + "-standard")); return result; } -- Gitblit v1.8.0