인증정보 -> 개발자포탈 반영 기능
This commit is contained in:
@@ -29,4 +29,18 @@ public class CredentialService extends AbstractDataService<Credential, String, C
|
||||
|
||||
return repository.findAll(predicate, pageable);
|
||||
}
|
||||
|
||||
/**
|
||||
* clientId와 orgId로 Credential 조회
|
||||
*
|
||||
* @param clientId 클라이언트 ID
|
||||
* @param orgId 조직 ID
|
||||
* @return Credential 또는 null
|
||||
*/
|
||||
public Credential findByClientidAndOrgid(String clientId, String orgId) {
|
||||
QCredential qCredential = QCredential.credential;
|
||||
BooleanExpression predicate = qCredential.clientid.eq(clientId)
|
||||
.and(qCredential.orgid.eq(orgId));
|
||||
return repository.findOne(predicate).orElse(null);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-9
@@ -26,10 +26,10 @@ import com.eactive.eai.rms.common.base.OnlBaseService;
|
||||
import com.eactive.eai.rms.data.entity.onl.authserver.ClientEntityService;
|
||||
import com.eactive.eai.rms.data.entity.onl.authserver.ClientSearch;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@@ -167,19 +167,15 @@ public class ClientManService extends OnlBaseService {
|
||||
DataSourceContextHolder.setDataSourceType(monitoringType);
|
||||
|
||||
// 5. 기존 Credential 확인
|
||||
Optional<Credential> existingCredential = credentialService.getRepository()
|
||||
.findOne((root, query, cb) -> cb.and(
|
||||
cb.equal(root.get("clientid"), clientId),
|
||||
cb.equal(root.get("orgid"), orgId)
|
||||
));
|
||||
Credential existingCredential = credentialService.findByClientidAndOrgid(clientId, orgId);
|
||||
|
||||
// 6. 데이터 변환 (ClientEntity → CredentialUI)
|
||||
CredentialUI credentialUI = convertToCredentialUI(clientEntity);
|
||||
|
||||
SyncResult.SyncAction action;
|
||||
if (existingCredential.isPresent()) {
|
||||
if (existingCredential != null) {
|
||||
// 업데이트: 기존 값 유지해야 할 필드 처리
|
||||
Credential existing = existingCredential.get();
|
||||
Credential existing = existingCredential;
|
||||
if (StringUtils.isNotBlank(existing.getAppDescription())) {
|
||||
credentialUI.setAppDescription(existing.getAppDescription());
|
||||
}
|
||||
@@ -258,7 +254,9 @@ public class ClientManService extends OnlBaseService {
|
||||
|
||||
// 수정 정보
|
||||
credentialUI.setModifiedby(clientEntity.getModifiedby());
|
||||
credentialUI.setModifiedon(clientEntity.getModifiedon());
|
||||
if (clientEntity.getModifiedon() != null) {
|
||||
credentialUI.setModifiedon(clientEntity.getModifiedon().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
|
||||
}
|
||||
|
||||
// API 목록 변환
|
||||
List<ApiSpecInfoUI> apiList = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user