| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/list", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/list", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "info",method = RequestMethod.POST) |
| | | public Msg timerInfo(@RequestBody ReqParams reqParams){ |
| | | rateLimiter.acquire(1); |
| | | |
| | | Long userId = accessService.getUserId(reqParams.getAccessToken()); |
| | | |
| | | |
| | | if(userId == null){ |
| | | return Msg.error("accessToken exception!!!"); |
| | | } |
| | | |
| | | reqParams.setApiKey(reqParams.getApiKey()); |
| | | reqParams.setUserId(userId); |
| | | |
| | | TimerRequest timerRequest = new TimerRequest(); |
| | | |
| | | timerRequest.setTimerId(reqParams.getTimerId()); |
| | | reqParams.setTimerRequest(timerRequest); |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/getStreetlightListByTimerId", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | | Map msg = JSON.parseObject(result, HashMap.class); |
| | | |
| | | System.out.println(result); |
| | | if (msg.get("msg").equals("success")){ |
| | | |
| | | return Msg.ok().put("data",msg.get("list")); |
| | | } |
| | | else { |
| | | return Msg.error(msg.get("msg").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查看定时任务ID对应绑定的灯杆列表 |
| | | * */ |
| | | @RequestMapping(value = "listByTimerId",method = RequestMethod.POST) |
| | | @RequestMapping(value = "getSyncStatusByTimerId",method = RequestMethod.POST) |
| | | public Msg getStreetlightListByTimerId(@RequestBody ReqParams reqParams){ |
| | | System.out.println(reqParams); |
| | | rateLimiter.acquire(1); |
| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/listByTimerId", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/listByTimerId", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/deleteTimerByTimerId", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/deleteTimerByTimerId", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/addTimer", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/addTimer", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/updateTimer", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/updateTimer", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |