-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #233 from Team-Smeme/develop
[CHORE] prod 서버 재배포
- Loading branch information
Showing
297 changed files
with
6,301 additions
and
6,111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,138 +1,52 @@ | ||
import org.hidetake.gradle.swagger.generator.GenerateSwaggerUI | ||
import org.springframework.boot.gradle.tasks.bundling.BootJar | ||
|
||
buildscript { | ||
ext { | ||
queryDslVersion = "5.0.0" | ||
restdocsApiSpecVersion = "0.18.2" | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.0.1' | ||
id 'io.spring.dependency-management' version '1.1.0' | ||
// jacoco | ||
id 'jacoco' | ||
// restdocs-api-spec | ||
id 'com.epages.restdocs-api-spec' version "${restdocsApiSpecVersion}" | ||
// swagger generator | ||
id 'org.hidetake.swagger.generator' version '2.18.2' | ||
} | ||
|
||
swaggerSources { | ||
sample { | ||
setInputFile(file("${project.buildDir}/api-spec/openapi3.yaml")) | ||
} | ||
} | ||
|
||
openapi3 { | ||
server('http://localhost:8080') | ||
title = 'restdocs-swagger API Documentation' | ||
description = 'Spring REST Docs with SwaggerUI.' | ||
version = '0.0.1' | ||
format = 'yaml' | ||
id 'org.springframework.boot' version '3.2.1' | ||
id 'io.spring.dependency-management' version '1.1.4' | ||
} | ||
|
||
allprojects { | ||
apply plugin: 'java' | ||
apply plugin: 'org.springframework.boot' | ||
apply plugin: 'io.spring.dependency-management' | ||
|
||
jacoco { | ||
toolVersion = "0.8.7" | ||
} | ||
|
||
tasks.withType(Test) { | ||
jacoco.includeNoLocationClasses = true | ||
jacoco.excludes = ['jdk.internal.*'] | ||
group = 'com.smeme' | ||
version = '0.0.1-SNAPSHOT' | ||
sourceCompatibility = '17' | ||
|
||
} | ||
|
||
group = 'com.smeme' | ||
version = '0.0.1-SNAPSHOT' | ||
sourceCompatibility = '17' | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
ext { | ||
set('snippetsDir', file("build/generated-snippets")) | ||
} | ||
|
||
dependencies { | ||
// Spring Boot Starter | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
|
||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
|
||
// JWT | ||
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5' | ||
implementation group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5' | ||
implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5' | ||
|
||
|
||
implementation 'com.google.code.gson:gson:2.10.1' | ||
implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359' | ||
|
||
// Swagger & RestDocs | ||
testImplementation "com.epages:restdocs-api-spec-mockmvc:${restdocsApiSpecVersion}" | ||
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc' | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' | ||
|
||
// fcm | ||
implementation 'com.google.firebase:firebase-admin:9.1.1' | ||
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.2.2' | ||
|
||
// QueryDSL | ||
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' | ||
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" | ||
annotationProcessor "jakarta.annotation:jakarta.annotation-api" | ||
annotationProcessor "jakarta.persistence:jakarta.persistence-api" | ||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
// lombok | ||
compileOnly 'org.projectlombok:lombok' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testCompileOnly 'org.projectlombok:lombok' | ||
testAnnotationProcessor 'org.projectlombok:lombok' | ||
dependencies { | ||
|
||
// DB | ||
runtimeOnly 'com.h2database:h2' | ||
runtimeOnly 'org.postgresql:postgresql' | ||
} | ||
// test | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} | ||
// lombok | ||
compileOnly 'org.projectlombok:lombok' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testAnnotationProcessor 'org.projectlombok:lombok' | ||
testCompileOnly 'org.projectlombok:lombok' | ||
} | ||
|
||
tasks.withType(GenerateSwaggerUI) { | ||
dependsOn 'openapi3' | ||
copy { | ||
from "build/resources/main/static/docs" | ||
into "src/main/resources/static/docs/" | ||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} | ||
} | ||
|
||
bootJar { | ||
dependsOn(':openapi3') | ||
} | ||
// bootJar 실행 전, copySwaggerUI 를 실행하도록 설정 | ||
openapi3 { | ||
server = "http://localhost:8080" | ||
title = "smeme api documentation" | ||
description = "Spring REST Docs with SwaggerUI." | ||
version = "0.0.1" | ||
outputFileNamePrefix = 'open-api-3.0.1' | ||
format = 'json' | ||
jar { enabled = true } | ||
|
||
outputDirectory = 'build/resources/main/static/docs' | ||
} | ||
bootJar { enabled = false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
rootProject.name = 'server' | ||
include 'smeem-api' | ||
include 'smeem-domain' | ||
include 'smeem-batch' | ||
include 'smeem-external' | ||
include 'smeem-common' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
dependencies { | ||
implementation project(':smeem-common') | ||
implementation project(':smeem-domain') | ||
implementation project(':smeem-external') | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
|
||
// JWT | ||
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5' | ||
implementation group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5' | ||
implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5' | ||
|
||
// Swagger | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' | ||
|
||
} | ||
|
||
ext { | ||
set('snippetsDir', file("build/generated-snippets")) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
19 changes: 19 additions & 0 deletions
19
smeem-api/src/main/java/com/smeem/api/SmemeServerRenewalApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.smeem.api; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.autoconfigure.domain.EntityScan; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
|
||
@SpringBootApplication | ||
@ComponentScan(basePackages = {"com.smeem.common", "com.smeem.api", "com.smeem.domain", "com.smeem.external"}) | ||
@EnableJpaRepositories(basePackages = {"com.smeem.domain"}) | ||
@EntityScan(basePackages = {"com.smeem.domain"}) | ||
public class SmemeServerRenewalApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(SmemeServerRenewalApplication.class, args); | ||
} | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
smeem-api/src/main/java/com/smeem/api/auth/api/AuthApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package com.smeem.api.auth.api; | ||
|
||
import com.smeem.api.auth.api.dto.request.SignInRequest; | ||
import com.smeem.api.common.BaseResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
|
||
import java.security.NoSuchAlgorithmException; | ||
import java.security.Principal; | ||
import java.security.spec.InvalidKeySpecException; | ||
|
||
import static io.swagger.v3.oas.annotations.enums.ParameterIn.HEADER; | ||
|
||
@Tag(name = "[Auth] 인증 관련 API (V2)") | ||
public interface AuthApi { | ||
|
||
@Operation(summary = "소셜 로그인 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Social Platform Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "201", description = "소셜로그인 성공"), | ||
@ApiResponse(responseCode = "4xx", description = "유효하지 않은 요청"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> signIn(@RequestHeader("Authorization") final String socialAccessToken, @RequestBody SignInRequest request) throws NoSuchAlgorithmException, InvalidKeySpecException; | ||
|
||
@Operation(summary = "토큰 재발급 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Refresh Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "토큰 재발급 성공"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> reissueToken(Principal principal); | ||
|
||
|
||
@Operation(summary = "사용자 로그아웃 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "로그아웃 성공"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> signOut(Principal principal); | ||
|
||
|
||
@Operation(summary = "회원 탈퇴 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "회원 탈퇴 성공"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> withDrawl(Principal principal); | ||
|
||
} |
Oops, something went wrong.