| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Service |
| | | @Slf4j |
| | |
| | | */ |
| | | public String getJSession(Integer type) { |
| | | String key = "monitor:device:jsession:now"; |
| | | String jsession = redisTemplate.opsForValue().get(key).toString(); |
| | | String jsession = (String) redisTemplate.opsForValue().get(key); |
| | | Long timeOut = 604800L; |
| | | if (jsession == null || type == 1) { |
| | | String loginUrl = String.format( |
| | |
| | | throw new ServiceException("视频服务器连接失败"); |
| | | } |
| | | } |
| | | redisTemplate.opsForValue().set(key, jsession, timeOut); |
| | | redisTemplate.opsForValue().set(key, jsession, timeOut, TimeUnit.SECONDS); |
| | | return jsession; |
| | | } |
| | | |