Skip to content

Commit

Permalink
chore(merge): merge refactor/module to master
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobhboy committed Apr 18, 2024
2 parents 65a9615 + 41838f8 commit 8caaedb
Show file tree
Hide file tree
Showing 204 changed files with 84 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ out/

### VS Code ###
.vscode/
/main-service/src/main/generated/com/sickgyun/server
/main-server/src/main/generated/com/sickgyun/server
17 changes: 0 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,13 @@ subprojects {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'

//p6psy query extractor
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

testRuntimeOnly 'com.h2database:h2'

repositories {
mavenCentral()
}
Expand All @@ -50,17 +44,6 @@ subprojects {
extendsFrom annotationProcessor
}
}

//openFeign
ext {
set('springCloudVersion', "2023.0.0")
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
}

fileTree(dir: 'setting', include: '*.gradle').each { file ->
Expand Down
4 changes: 2 additions & 2 deletions logging/build.gradle → logging-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ dependencies {
}

bootJar {
enabled = false
enabled = true
}

jar {
enabled = true
enabled = false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.sickgyun.server.domain;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class LoggingApplication {

public static void main(String[] args) {
SpringApplication.run(LoggingApplication.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.sickgyun.server.domain.logging;

import static org.springframework.http.HttpHeaders.*;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import lombok.RequiredArgsConstructor;

@Configuration
@RequiredArgsConstructor
public class CorsConfig implements WebMvcConfigurer {

private static final String ALLOW_ALL_PATH = "/**";
private static final String ALLOWED_METHODS = "*";
private static final String MAIN_SERVER_DOMAIN = "https://sickgyun.com";
private static final String FRONTEND_LOCALHOST = "http://localhost:3000";
private static final String HTTPS_FRONTEND_LOCALHOST = "https://localhost:3000";

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping(ALLOW_ALL_PATH)
.allowedMethods(ALLOWED_METHODS)
.allowedOrigins(
MAIN_SERVER_DOMAIN,
FRONTEND_LOCALHOST,
HTTPS_FRONTEND_LOCALHOST
)
.allowCredentials(true)
.exposedHeaders(LOCATION, SET_COOKIE);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sickgyun.server.domain;
package com.sickgyun.server.domain.logging;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sickgyun.server.domain;
package com.sickgyun.server.domain.logging;

import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sickgyun.server.domain;
package com.sickgyun.server.domain.logging;

import org.springframework.data.mongodb.repository.MongoRepository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sickgyun.server.domain;
package com.sickgyun.server.domain.logging;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
Expand Down
10 changes: 10 additions & 0 deletions logging-server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
server:
port: 8081
servlet:
contextPath: /api

spring:
data:
mongodb:
uri: ${MONGO_URL}
database: ${MONGO_DB}
20 changes: 19 additions & 1 deletion main-service/build.gradle → main-server/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
dependencies {
implementation project(":logging")
//jpa
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

//p6psy query extractor
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'

//querydsl
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
Expand Down Expand Up @@ -27,6 +31,20 @@ dependencies {
//aws s3
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.638'
runtimeOnly 'com.mysql:mysql-connector-j'

//test h2
testRuntimeOnly 'com.h2database:h2'
}

//openFeign
ext {
set('springCloudVersion', "2023.0.0")
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

//queryDsl
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rootProject.name = 'server'
include 'logging'
include 'main-service'
include 'logging-server'
include 'main-server'

0 comments on commit 8caaedb

Please sign in to comment.