Skip to content

Commit

Permalink
Merge pull request #38 from st-yclee/main
Browse files Browse the repository at this point in the history
oss 계정 조회시 대소문자 허용
  • Loading branch information
st-yclee authored Sep 19, 2024
2 parents c150c3e + 0ce8377 commit 4b9bd55
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/kr/co/mcmp/oss/repository/OssRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
public interface OssRepository extends JpaRepository<Oss, Long> {
List<Oss> findAll();
Oss findByOssName(String ossName);
Oss findByOssNameIgnoreCase(String ossName);
@Query("SELECT o FROM Oss o WHERE o.ossType.ossTypeIdx IN :ossTypeIdxs")
List<Oss> findByOssTypeIdxIn(@Param("ossTypeIdxs") List<Long> ossTypeIdxs);
Boolean existsByOssNameAndOssUrlAndOssUsername(String ossName, String ossUrl, String ossUsername);
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/kr/co/mcmp/oss/service/OssServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,21 @@ public OssDto detailOssByOssName(String ossName) {
.build();
}

public OssDto detailOssByOssNameIgnoreCase(String ossName) {
Oss oss = ossRepository.findByOssNameIgnoreCase(ossName);
String pwd = oss.getOssPassword();
String decodePwd = AES256Utils.decrypt(pwd);
return OssDto.builder()
.ossIdx(oss.getOssIdx())
.ossTypeIdx(oss.getOssType().getOssTypeIdx())
.ossName(oss.getOssName())
.ossDesc(oss.getOssDesc())
.ossUrl(oss.getOssUrl())
.ossUsername(oss.getOssUsername())
.ossPassword(decodePwd)
.build();
}

// /**
// * OSS 정보 상세 조회
// * @param ossCd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class NexusComponentAdapterClient {

private void getOssInfo() {
try {
OssDto nexus = ossService.detailOssByOssName("NEXUS");
OssDto nexus = ossService.detailOssByOssNameIgnoreCase("NEXUS");
this.nexusId = nexus.getOssUsername();
this.nexusPwd = Base64Utils.base64Decoding(nexus.getOssPassword());
this.baseUrl = nexus.getOssUrl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class NexusRepositoryAdapterClient {

private void getOssInfo() {
try {
OssDto nexus = ossService.detailOssByOssName("NEXUS");
OssDto nexus = ossService.detailOssByOssNameIgnoreCase("NEXUS");
this.nexusId = nexus.getOssUsername();
this.nexusPwd = Base64Utils.base64Decoding(nexus.getOssPassword());
this.baseUrl = nexus.getOssUrl();
Expand Down

0 comments on commit 4b9bd55

Please sign in to comment.