| | |
| | | List<Map<String, Object>> getDeviceStatesByAccount(Map<String, Object> parameters);
|
| | | List<Device> selectWithRelationData(Example example);
|
| | | List<Map<String, Object>> getSensorsByDevice(@Param("mac")String mac);
|
| | | List<String> getDeviceMacByMonitorPointAndDeviceVersion(@Param("monitorPointId")Integer monitorPointId,@Param("deviceVersionId")Integer deviceVersionId);
|
| | |
|
| | | List<Map<String, Object>> getDeviceVersionIdByMonitorPoint(Integer monitorPointId);
|
| | | List<Device> selectByOrgIdAndDevName(@Param("orgId")Integer orgId,@Param("devName")String devName);
|
| | | } |
| | |
| | | |
| | | Claims claims = Jwts.claims().setSubject(userContext.getUsername()); |
| | | claims.put("mode",userContext.getMode()); |
| | | // claims.put("scopes", Arrays.asList(Scopes.REFRESH_TOKEN.authority())); |
| | | |
| | | claims.put("scopes", Arrays.asList(Scopes.REFRESH_TOKEN.authority())); |
| | | String token = Jwts.builder() |
| | | .setClaims(claims) |
| | | .setIssuer(settings.getTokenIssuer()) |
| | |
| | | Jws<Claims> claims = token.parseClaims(signingKey); |
| | | |
| | | List<String> scopes = claims.getBody().get("scopes", List.class); |
| | | if (scopes == null || scopes.isEmpty() |
| | | if (scopes == null || scopes.isEmpty() |
| | | || !scopes.stream().filter(scope -> Scopes.REFRESH_TOKEN.authority().equals(scope)).findFirst().isPresent()) { |
| | | return Optional.empty(); |
| | | } |
| | |
| | | ORDER BY |
| | | s.id |
| | | </select> |
| | | <select id="getDeviceVersionIdByMonitorPoint" resultType="map"> |
| | | SELECT |
| | | device_version_id deviceVersionId |
| | | FROM |
| | | device |
| | | WHERE |
| | | monitor_point_id = #{monitorPoint} |
| | | GROUP BY |
| | | device_version_id |
| | | </select> |
| | | <select id="getDeviceMacByMonitorPointAndDeviceVersion" resultType="string"> |
| | | SELECT |
| | | mac |
| | | FROM |
| | | device |
| | | WHERE |
| | | monitor_point_id = #{monitorPointId} |
| | | AND device_version_id = #{deviceVersionId} |
| | | </select> |
| | | </mapper> |