diff --git a/config b/config index 9b0654f..b9b8ab7 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 9b0654fef81b7f0d149242e17e28b1d776e4df67 +Subproject commit b9b8ab7883e56c0c1982030261262f612f2f1b6e diff --git a/src/main/java/icurriculum/domain/curriculum/service/AdminCurriculumService.java b/src/main/java/icurriculum/domain/curriculum/service/AdminCurriculumService.java index f912b81..9e627d7 100644 --- a/src/main/java/icurriculum/domain/curriculum/service/AdminCurriculumService.java +++ b/src/main/java/icurriculum/domain/curriculum/service/AdminCurriculumService.java @@ -30,6 +30,7 @@ public Curriculum getCurriculum( ) { CurriculumDecider decider = convertToDecider(majorType, departmentName, joinYear); + return repository.findByDecider(decider) .orElseThrow(() -> new GeneralException(ErrorStatus.CURRICULUM_NOT_FOUND)); } diff --git a/src/main/java/icurriculum/global/config/SSHMongoConfig.java b/src/main/java/icurriculum/global/config/SSHMongoConfig.java index 29d52f5..ca4de50 100644 --- a/src/main/java/icurriculum/global/config/SSHMongoConfig.java +++ b/src/main/java/icurriculum/global/config/SSHMongoConfig.java @@ -38,33 +38,39 @@ public class SSHMongoConfig { @Value("${spring.data.mongodb.database}") private String databaseName; + @Value("${spring.data.mongodb.connection_string}") + private String connectionCommand; + + @Value("${spring.data.mongodb.app_name") + private String appName; + @Bean public MongoClient mongoClient() { String host = databaseEndpoint; int port = databasePort; // if (isServer.equals("false")) { - log.info("isServer value: {}", isServer); - Integer forwardedPort = initializer.buildSshConnection(databaseEndpoint, databasePort); - host = "localhost"; - port = forwardedPort; +// log.info("isServer value: {}", isServer); +// Integer forwardedPort = initializer.buildSshConnection(databaseEndpoint, databasePort); +// host = "localhost"; +// port = forwardedPort; // } try { ConnectionString connectionString = new ConnectionString(String.format( - "mongodb://%s:%s@%s:%s/%s?readPreference=secondaryPreferred&retryWrites=false", + connectionCommand, mongoUser, mongoPassword, - host, - port, - databaseName + databaseEndpoint, + databaseName, + appName )); MongoClientSettings mongoClientSettings = MongoClientSettings.builder() .applyConnectionString(connectionString) .build(); - log.info("mongo connection through SSH: host={}, port={}", host, port); + log.info("mongo connection through SVG: end_point={}", databaseEndpoint); return MongoClients.create(mongoClientSettings); } catch (Exception e) {