minor refactoring

This commit is contained in:
dashevchenko 2024-08-26 10:51:13 +03:00
parent 3eb7efe0ad
commit 6f833a3b18
5 changed files with 5 additions and 5 deletions

View File

@ -42,7 +42,7 @@ public class DefaultTbDomainService extends AbstractTbEntityService implements T
TenantId tenantId = domain.getTenantId(); TenantId tenantId = domain.getTenantId();
try { try {
Domain savedDomain = checkNotNull(domainService.saveDomain(tenantId, domain)); Domain savedDomain = checkNotNull(domainService.saveDomain(tenantId, domain));
if (!CollectionUtils.isEmpty(oAuth2Clients)) { if (CollectionUtils.isNotEmpty(oAuth2Clients)) {
domainService.updateOauth2Clients(domain.getTenantId(), savedDomain.getId(), oAuth2Clients); domainService.updateOauth2Clients(domain.getTenantId(), savedDomain.getId(), oAuth2Clients);
} }
logEntityActionService.logEntityAction(tenantId, savedDomain.getId(), savedDomain, actionType, user, oAuth2Clients); logEntityActionService.logEntityAction(tenantId, savedDomain.getId(), savedDomain, actionType, user, oAuth2Clients);

View File

@ -42,7 +42,7 @@ public class DefaultTbMobileAppService extends AbstractTbEntityService implement
TenantId tenantId = mobileApp.getTenantId(); TenantId tenantId = mobileApp.getTenantId();
try { try {
MobileApp savedMobileApp = checkNotNull(mobileAppService.saveMobileApp(tenantId, mobileApp)); MobileApp savedMobileApp = checkNotNull(mobileAppService.saveMobileApp(tenantId, mobileApp));
if (!CollectionUtils.isEmpty(oauth2Clients)) { if (CollectionUtils.isNotEmpty(oauth2Clients)) {
mobileAppService.updateOauth2Clients(tenantId, savedMobileApp.getId(), oauth2Clients); mobileAppService.updateOauth2Clients(tenantId, savedMobileApp.getId(), oauth2Clients);
} }
logEntityActionService.logEntityAction(tenantId, savedMobileApp.getId(), savedMobileApp, actionType, user); logEntityActionService.logEntityAction(tenantId, savedMobileApp.getId(), savedMobileApp, actionType, user);

View File

@ -32,7 +32,7 @@ public interface OAuth2ClientDao extends Dao<OAuth2Client> {
List<OAuth2Client> findEnabledByDomainName(String domainName); List<OAuth2Client> findEnabledByDomainName(String domainName);
List<OAuth2Client> findEnabledByPckNameAndPlatformType(String pkgName, PlatformType platformType); List<OAuth2Client> findEnabledByPkgNameAndPlatformType(String pkgName, PlatformType platformType);
List<OAuth2Client> findByDomainId(UUID domainId); List<OAuth2Client> findByDomainId(UUID domainId);

View File

@ -61,7 +61,7 @@ public class OAuth2ClientServiceImpl extends AbstractEntityService implements OA
@Override @Override
public List<OAuth2ClientLoginInfo> findOAuth2ClientLoginInfosByMobilePkgNameAndPlatformType(String pkgName, PlatformType platformType) { public List<OAuth2ClientLoginInfo> findOAuth2ClientLoginInfosByMobilePkgNameAndPlatformType(String pkgName, PlatformType platformType) {
log.trace("Executing findOAuth2ClientLoginInfosByMobilePkgNameAndPlatformType pkgName=[{}] platformType=[{}]",pkgName, platformType); log.trace("Executing findOAuth2ClientLoginInfosByMobilePkgNameAndPlatformType pkgName=[{}] platformType=[{}]",pkgName, platformType);
return oauth2ClientDao.findEnabledByPckNameAndPlatformType(pkgName, platformType) return oauth2ClientDao.findEnabledByPkgNameAndPlatformType(pkgName, platformType)
.stream() .stream()
.map(OAuth2Utils::toClientLoginInfo) .map(OAuth2Utils::toClientLoginInfo)
.collect(Collectors.toList()); .collect(Collectors.toList());

View File

@ -64,7 +64,7 @@ public class JpaOAuth2ClientDao extends JpaAbstractDao<OAuth2ClientEntity, OAuth
} }
@Override @Override
public List<OAuth2Client> findEnabledByPckNameAndPlatformType(String pkgName, PlatformType platformType) { public List<OAuth2Client> findEnabledByPkgNameAndPlatformType(String pkgName, PlatformType platformType) {
return DaoUtil.convertDataList(repository.findEnabledByPkgNameAndPlatformType(pkgName, return DaoUtil.convertDataList(repository.findEnabledByPkgNameAndPlatformType(pkgName,
platformType != null ? platformType.name() : null)); platformType != null ? platformType.name() : null));
} }