|
|
|
@ -35,6 +35,7 @@ import org.thingsboard.server.dao.eventsourcing.DeleteEntityEvent; |
|
|
|
import org.thingsboard.server.dao.eventsourcing.SaveEntityEvent; |
|
|
|
import org.thingsboard.server.dao.service.DataValidator; |
|
|
|
|
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
@ -68,7 +69,6 @@ public class OAuth2ClientServiceImpl extends AbstractEntityService implements OA |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public OAuth2Client saveOAuth2Client(TenantId tenantId, OAuth2Client oAuth2Client) { |
|
|
|
log.trace("Executing saveOAuth2Client [{}]", oAuth2Client); |
|
|
|
oAuth2ClientDataValidator.validate(oAuth2Client, OAuth2Client::getTenantId); |
|
|
|
@ -96,7 +96,6 @@ public class OAuth2ClientServiceImpl extends AbstractEntityService implements OA |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void deleteOAuth2ClientById(TenantId tenantId, OAuth2ClientId oAuth2ClientId) { |
|
|
|
log.trace("Executing deleteOAuth2ClientById [{}]", oAuth2ClientId); |
|
|
|
oauth2ClientDao.removeById(tenantId, oAuth2ClientId.getId()); |
|
|
|
@ -126,6 +125,7 @@ public class OAuth2ClientServiceImpl extends AbstractEntityService implements OA |
|
|
|
return oauth2ClientDao.findByIds(tenantId.getId(), oAuth2ClientIds) |
|
|
|
.stream() |
|
|
|
.map(OAuth2ClientInfo::new) |
|
|
|
.sorted(Comparator.comparing(OAuth2ClientInfo::getTitle)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
|