diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 00000000..ce5b24a9
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1 @@
+* @Jaeyeop-Jung @Pull-Stack @kdomo
\ No newline at end of file
diff --git a/pull_request_template.md b/.github/pull_request_template.md
similarity index 68%
rename from pull_request_template.md
rename to .github/pull_request_template.md
index f7317f15..88b7bd54 100644
--- a/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,8 +1,11 @@
## 관련 이슈 번호
+
+
## 설명
## 변경사항
+
diff --git a/.gitignore b/.gitignore
index e48b6be6..5d47a5fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,4 +34,8 @@ out/
/.nb-gradle/
### VS Code ###
-.vscode/
\ No newline at end of file
+.vscode/
+
+### Custom ###
+logs/
+*.pem
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index fc72faee..243d1272 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ plugins {
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}
-group = 'com.recodeit'
+group = 'com.recordit'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
@@ -12,6 +12,10 @@ configurations {
compileOnly {
extendsFrom annotationProcessor
}
+ all {
+ // log4j2를 위해 logback 의존성 제거
+ exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
+ }
}
repositories {
@@ -24,14 +28,39 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.session:spring-session-data-redis'
+ implementation 'io.springfox:springfox-boot-starter:3.0.0'
+ implementation 'io.springfox:springfox-swagger-ui:3.0.0'
+
+ // embedded redis
+ implementation('it.ozimov:embedded-redis:0.7.3') {
+ exclude group: "org.slf4j", module: "slf4j-simple"
+ }
+
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
+
+ // use static mock
+ testImplementation 'org.mockito:mockito-inline:4.5.1'
+
+ // use ConfigurationProperties
+ annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
+
+ // use s3
+ implementation 'com.amazonaws:aws-java-sdk-s3:1.12.372'
+
+ // log4j2
+ implementation 'org.springframework.boot:spring-boot-starter-log4j2'
+
}
tasks.named('test') {
useJUnitPlatform()
}
+
+jar {
+ enabled = false
+}
\ No newline at end of file
diff --git a/dockerfile b/dockerfile
new file mode 100644
index 00000000..6428fde0
--- /dev/null
+++ b/dockerfile
@@ -0,0 +1,4 @@
+FROM adoptopenjdk/openjdk11
+ARG JAR_FILE=target/*.jar
+COPY ${JAR_FILE} app.jar
+ENTRYPOINT ["java","-jar","/app.jar"]
\ No newline at end of file
diff --git a/naver-checkstyle-rules.xml b/naver-checkstyle-rules.xml
new file mode 100644
index 00000000..5eefb788
--- /dev/null
+++ b/naver-checkstyle-rules.xml
@@ -0,0 +1,439 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/naver-checkstyle-suppressions.xml b/naver-checkstyle-suppressions.xml
new file mode 100644
index 00000000..efd97d80
--- /dev/null
+++ b/naver-checkstyle-suppressions.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/naver-intellij-formatter.xml b/naver-intellij-formatter.xml
new file mode 100644
index 00000000..a4f6cc7d
--- /dev/null
+++ b/naver-intellij-formatter.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/schema/category.sql b/schema/category.sql
new file mode 100644
index 00000000..260ac2aa
--- /dev/null
+++ b/schema/category.sql
@@ -0,0 +1,22 @@
+insert into RECORD_CATEGORY(NAME, CREATED_AT, MODIFIED_AT, PARENT_RECORD_CATEGORY_ID)
+ value ('축하 레코드', now(), now(), null);
+insert into RECORD_CATEGORY(NAME, CREATED_AT, MODIFIED_AT, PARENT_RECORD_CATEGORY_ID)
+ value ('위로 레코드', now(), now(), null);
+
+insert into RECORD_CATEGORY(NAME, CREATED_AT, MODIFIED_AT, PARENT_RECORD_CATEGORY_ID)
+ value ('축하해주세요', now(), now(), 1);
+insert into RECORD_CATEGORY(NAME, CREATED_AT, MODIFIED_AT, PARENT_RECORD_CATEGORY_ID)
+ value ('기념일이에요', now(), now(), 1);
+insert into RECORD_CATEGORY(NAME, CREATED_AT, MODIFIED_AT, PARENT_RECORD_CATEGORY_ID)
+ value ('연애중이에요', now(), now(), 1);
+insert into RECORD_CATEGORY(NAME, CREATED_AT, MODIFIED_AT, PARENT_RECORD_CATEGORY_ID)
+ value ('행복해요', now(), now(), 1);
+
+insert into RECORD_CATEGORY(NAME, CREATED_AT, MODIFIED_AT, PARENT_RECORD_CATEGORY_ID)
+ value ('위로해주세요', now(), now(), 2);
+insert into RECORD_CATEGORY(NAME, CREATED_AT, MODIFIED_AT, PARENT_RECORD_CATEGORY_ID)
+ value ('공감이 필요해요', now(), now(), 2);
+insert into RECORD_CATEGORY(NAME, CREATED_AT, MODIFIED_AT, PARENT_RECORD_CATEGORY_ID)
+ value ('내편이 되어주세요', now(), now(), 2);
+insert into RECORD_CATEGORY(NAME, CREATED_AT, MODIFIED_AT, PARENT_RECORD_CATEGORY_ID)
+ value ('우울해요', now(), now(), 2);
\ No newline at end of file
diff --git a/schema/color.sql b/schema/color.sql
new file mode 100644
index 00000000..e1c269d6
--- /dev/null
+++ b/schema/color.sql
@@ -0,0 +1,10 @@
+INSERT INTO RECORD_COLOR(RECORD_COLOR_ID, NAME, HEX_CODE, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'icon-purple', '#9067E5', now(), now(), null);
+INSERT INTO RECORD_COLOR(RECORD_COLOR_ID, NAME, HEX_CODE, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'icon-yellow', '#F3D06C', now(), now(), null);
+INSERT INTO RECORD_COLOR(RECORD_COLOR_ID, NAME, HEX_CODE, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'icon-pink', '#D78A86', now(), now(), null);
+INSERT INTO RECORD_COLOR(RECORD_COLOR_ID, NAME, HEX_CODE, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'icon-blue', '#6F99F2', now(), now(), null);
+INSERT INTO RECORD_COLOR(RECORD_COLOR_ID, NAME, HEX_CODE, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'icon-green', '#78BCB7', now(), now(), null);
\ No newline at end of file
diff --git a/schema/icon.sql b/schema/icon.sql
new file mode 100644
index 00000000..dd858fcc
--- /dev/null
+++ b/schema/icon.sql
@@ -0,0 +1,26 @@
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'crown', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'gift', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'heart', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'like', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'lock', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'modal', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'moon', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'music', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'rocket', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'speechbubble', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'trashcan', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'umbrella', now(), now(), null);
+INSERT INTO RECORD_ICON(RECORD_ICON_ID, NAME, CREATED_AT, MODIFIED_AT, DELETED_AT)
+VALUES (null, 'wine', now(), now(), null);
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index 86a18c1d..e6d960dd 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1 @@
-rootProject.name = 'recodeIt-server'
+rootProject.name = 'recordIt-server'
diff --git a/src/main/java/com/recodeit/server/RecodeItServerApplication.java b/src/main/java/com/recodeit/server/RecodeItServerApplication.java
deleted file mode 100644
index 2d4cbae3..00000000
--- a/src/main/java/com/recodeit/server/RecodeItServerApplication.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.recodeit.server;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class RecodeItServerApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(RecodeItServerApplication.class, args);
- }
-
-}
diff --git a/src/main/java/com/recordit/server/RecordItServerApplication.java b/src/main/java/com/recordit/server/RecordItServerApplication.java
new file mode 100644
index 00000000..fc245572
--- /dev/null
+++ b/src/main/java/com/recordit/server/RecordItServerApplication.java
@@ -0,0 +1,21 @@
+package com.recordit.server;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
+
+@SpringBootApplication
+@EnableConfigurationProperties
+@ConfigurationPropertiesScan
+@EnableJpaAuditing
+@EnableCaching
+public class RecordItServerApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(RecordItServerApplication.class, args);
+ }
+
+}
diff --git a/src/main/java/com/recordit/server/configuration/CacheConfiguration.java b/src/main/java/com/recordit/server/configuration/CacheConfiguration.java
new file mode 100644
index 00000000..44af4e68
--- /dev/null
+++ b/src/main/java/com/recordit/server/configuration/CacheConfiguration.java
@@ -0,0 +1,40 @@
+package com.recordit.server.configuration;
+
+import org.springframework.cache.CacheManager;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.cache.RedisCacheConfiguration;
+import org.springframework.data.redis.cache.RedisCacheManager;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializationContext;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+import lombok.RequiredArgsConstructor;
+
+@Configuration
+@RequiredArgsConstructor
+public class CacheConfiguration {
+
+ @Bean
+ public CacheManager redisCacheManager(RedisConnectionFactory redisConnectionFactory) {
+ RedisCacheConfiguration configuration = RedisCacheConfiguration.defaultCacheConfig()
+ .disableCachingNullValues()
+ .prefixCacheNameWith("cache:")
+ .serializeKeysWith(
+ RedisSerializationContext
+ .SerializationPair
+ .fromSerializer(new StringRedisSerializer())
+ )
+ .serializeValuesWith(
+ RedisSerializationContext
+ .SerializationPair
+ .fromSerializer(new Jackson2JsonRedisSerializer<>(Object.class))
+ );
+
+ return RedisCacheManager.RedisCacheManagerBuilder
+ .fromConnectionFactory(redisConnectionFactory)
+ .cacheDefaults(configuration)
+ .build();
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/recordit/server/configuration/RedisConfiguration.java b/src/main/java/com/recordit/server/configuration/RedisConfiguration.java
new file mode 100644
index 00000000..5401acac
--- /dev/null
+++ b/src/main/java/com/recordit/server/configuration/RedisConfiguration.java
@@ -0,0 +1,53 @@
+package com.recordit.server.configuration;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
+import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+@Configuration
+public class RedisConfiguration {
+
+ private final String host;
+ private final int port;
+ private final String password;
+
+ public RedisConfiguration(
+ @Value("${spring.redis.host}") String host,
+ @Value("${spring.redis.port}") int port,
+ @Value("${spring.redis.password}") String password
+ ) {
+ this.host = host;
+ this.port = port;
+ this.password = password;
+ }
+
+ @Bean
+ public RedisConnectionFactory redisConnectionFactory() {
+ RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration();
+ configuration.setHostName(host);
+ configuration.setPort(port);
+ configuration.setPassword(password);
+ return new LettuceConnectionFactory(configuration);
+ }
+
+ @Bean
+ public StringRedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) {
+ StringRedisTemplate redisTemplate = new StringRedisTemplate();
+ redisTemplate.setConnectionFactory(redisConnectionFactory);
+ redisTemplate.setKeySerializer(new StringRedisSerializer());
+ redisTemplate.setValueSerializer(new StringRedisSerializer());
+ return redisTemplate;
+ }
+
+ @Bean
+ public RedisSerializer