Skip to content

Commit

Permalink
feat: create naver key api class
Browse files Browse the repository at this point in the history
  • Loading branch information
cyzlcyzl committed Dec 10, 2023
1 parent e5c2265 commit d9c0a76
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ out/

### custom ###
/src/main/resources/db-application.properties
/src/main/resources/application-api-key.properties
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ dependencies {
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

implementation 'com.amazonaws:aws-java-sdk-s3:1.12.609'

}

tasks.named('test') {
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/mvc/promiseme/common/NaverKey.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package mvc.promiseme.common;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class NaverKey {

@Value("${ACCESS_KEY_ID}")
private String accessKey;
@Value("${KEY}")
private String key;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package mvc.promiseme.meeting.service;

import org.springframework.web.multipart.MultipartFile;

public interface MeetingService {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package mvc.promiseme.meeting.service;

import lombok.RequiredArgsConstructor;
import mvc.promiseme.common.NaverKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

@Service
@RequiredArgsConstructor
@Transactional
public class MeetingServiceImpl implements MeetingService {

private final NaverKey naverKey;
}
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
spring.config.import=db-application.properties
spring.config.import=db-application.properties
spring.profiles.include=api-key
22 changes: 22 additions & 0 deletions src/test/java/mvc/promiseme/common/ApiTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mvc.promiseme.common;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import static org.junit.jupiter.api.Assertions.assertNotNull;

@SpringBootTest
public class ApiTest {

@Autowired
private NaverKey naverKey;

@Test
public void testNaverKeyValues() {
assertNotNull(naverKey, "NaverKey instance should not be null");

System.out.println(naverKey.getAccessKey());
System.out.println(naverKey.getKey());
}
}

0 comments on commit d9c0a76

Please sign in to comment.