| | |
| | | package com.ycl.smoke.controller.smoke; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ycl.service.redis.RedisService; |
| | | import com.ycl.smoke.dto.*; |
| | | import com.ycl.smoke.entity.OdsTenMinData; |
| | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | @GetMapping(value = "/login") |
| | | public String login() { |
| | | |
| | | LoginParamDto loginParamDto = LoginParamDto.builder().username("遂昌城管局").password("123456").noCode(true).build(); |
| | | String json = smokeDetectionService.loginAction(loginParamDto); |
| | | SmokeResultResponseDto responseDto = JSON.parseObject(json, SmokeResultResponseDto.class); |
| | | if (responseDto.getStatus() == 200) { |
| | | LoginResponseDto loginResponseDto = JSON.parseObject(responseDto.getData().toString(), LoginResponseDto.class); |
| | | System.out.println(loginResponseDto.getToken()); |
| | | redisService.set(RedisKey.SMOKE_TOKEN, loginResponseDto.getToken()); |
| | | return "登录成功"; |
| | | } else { |
| | | return json; |
| | | } |
| | | } |
| | | |
| | | @PostMapping(value = "/listAlarmMsg") |
| | | public String getListAlarmMsg(@RequestBody AlarmMsgParamDto params) { |
| | | |