Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHORE] prod 서버 재배포 #233

Merged
merged 116 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
62a2c5b
[DELETE] 첨삭 기능 삭제
thguss Jan 16, 2024
a48a4a5
Merge pull request #185 from Team-Smeme/sohyeon_#184
thguss Jan 16, 2024
3d47867
[DELETE] 스웨거 코드 삭제
thguss Jan 16, 2024
3956633
[FIX] 뱃지 전체 조회로 수정
thguss Jan 16, 2024
0a17961
[DELETE] 미사용 메서드 삭제
thguss Jan 16, 2024
ff2e989
[DELETE] 미사용 메서드 삭제
thguss Jan 16, 2024
bd464e5
Merge pull request #189 from Team-Smeme/sohyeon_#188
thguss Jan 17, 2024
f91a9b1
Merge branch 'develop' into sohyeon_#187
thguss Jan 17, 2024
d329e55
Merge pull request #190 from Team-Smeme/sohyeon_#187
thguss Jan 17, 2024
fa7d953
[TEST] 뱃지 조회 테스트
thguss Jan 23, 2024
91b2df0
[FIX] 뱃지 조회 정렬 추가
thguss Jan 23, 2024
c38e7eb
[FIX] 뱃지 조회 정렬 추가
thguss Jan 23, 2024
cd6e247
Merge pull request #193 from Team-Smeme/sohyeon_#192
thguss Jan 24, 2024
5386cdb
[FIX] 회원이 임시 삭제한 일기 데이터 삭제
thguss Jan 28, 2024
6e6ff7d
Merge pull request #196 from Team-Smeme/sohyeon_#194
thguss Jan 28, 2024
db8a8e6
[ADD] 획득한 뱃지에 타입 데이터 추가
thguss Jan 30, 2024
2596051
[FIX] 메소드명 수정
thguss Jan 30, 2024
aff6927
[FIX] 테스트 반영
thguss Jan 30, 2024
6748419
Merge pull request #197 from Team-Smeme/sohyeon_#191
thguss Jan 30, 2024
beedb29
[REFACTOR] 모듈 1차 분리
thguss Feb 6, 2024
b82ea75
[REFACTOR] 모듈 분리
thguss Feb 6, 2024
ce7acf3
Refactor: 멀티모듈 구조 리팩토링
unanchoi Feb 6, 2024
caecdcb
Refactor: Test Directory Package 이동
unanchoi Feb 6, 2024
c80dc5d
[ADD] Success Code 추가
thguss Feb 6, 2024
fcf8110
[REFACTOR] API 공통 Response DTO 리팩토링
thguss Feb 6, 2024
390612c
[FIX] Auth : Success Code 및 DTO 반영
thguss Feb 6, 2024
f7da888
[FIX] Badge : Success Code 및 DTO 반영
thguss Feb 6, 2024
c2b6f40
[FIX] Diary : Success Code 및 DTO 반영
thguss Feb 6, 2024
5a1cca2
[FIX] Diary : Success Code 및 DTO 반영
thguss Feb 6, 2024
e779e42
[FIX] Goal : Success Code 및 DTO 반영
thguss Feb 6, 2024
2d96bd7
[FIX] Member : Success Code 및 DTO 반영
thguss Feb 6, 2024
3750165
[FIX] Test : Success Code 및 DTO 반영
thguss Feb 6, 2024
edb1c5a
[FIX] Topic : Success Code 및 DTO 반영
thguss Feb 6, 2024
1bf276a
[FIX] Member : Success Code 및 DTO 반영
thguss Feb 6, 2024
b2103df
[ADD] Failure Code 추가
thguss Feb 7, 2024
4bba734
[ADD] Failure Code 적용 형태 추가
thguss Feb 7, 2024
8c171cf
[ADD] 예외 커스텀
thguss Feb 7, 2024
1e90249
[REFACTOR] batch 리팩토링
thguss Feb 7, 2024
3c614a3
[FIX] 테스트 리팩토링 반영
thguss Feb 7, 2024
a84afb0
[FIX] script 파일 내 경로 변경
thguss Feb 7, 2024
e55f846
Merge pull request #200 from Team-Smeme/sohyeon_#198
thguss Feb 9, 2024
dfb52bf
[TEST] 테스트 코드 임시 중단
thguss Feb 9, 2024
7f7b4a5
[REFACTOR] Diary 리팩토링
thguss Feb 12, 2024
3903b80
[REFACTOR] Diary 리팩토링
thguss Feb 12, 2024
1708f3e
[REFACTOR] Test 리팩토링
thguss Feb 12, 2024
30148bb
[REFACTOR] Topic 리팩토링
thguss Feb 12, 2024
3cee0d1
[REFACTOR] Goal 리팩토링
thguss Feb 12, 2024
cd3c1a2
[REFACTOR] domain 모듈 리팩토링
thguss Feb 12, 2024
1600065
[REFACTOR] build 실행
thguss Feb 12, 2024
1cfec62
[REFACTOR] 스케줄링 및 FCM API 호출 코드 리팩토링
thguss Feb 12, 2024
acfd9c0
Member, Badge, Auth domain 리팩토링
unanchoi Feb 13, 2024
aaa7dd1
Merge pull request #201 from Team-Smeme/sohyeon_#198
thguss Feb 13, 2024
457d34c
[FIX] merge conflict 해결
unanchoi Feb 13, 2024
bb333e4
[FIX] settings.gradle 불필요한 코드 삭제
unanchoi Feb 13, 2024
1948af8
Merge pull request #202 from Team-Smeme/refactor_#198_unan
unanchoi Feb 13, 2024
4ba3fbe
[REFACTOR] api: final 추가, 선public 후private, Response DTO (Service, Co…
thguss Feb 20, 2024
17d6460
[REFACTOR] 리팩토링 반영
thguss Feb 20, 2024
c477caf
[REFACTOR] domain: PROTECTED 추가, 기타 리팩토링
thguss Feb 20, 2024
c4d33d4
[REFACTOR] external: DTO 분리
thguss Feb 20, 2024
90fb18d
[REFACTOR] 2차 리팩토링
unanchoi Feb 20, 2024
354e0b9
Merge pull request #206 from Team-Smeme/refactor_#198_unan2
unanchoi Feb 20, 2024
6e1bc45
Merge branch 'refactor_#198' into sohyeon_#198
thguss Feb 20, 2024
6c2e655
Merge pull request #204 from Team-Smeme/sohyeon_#198
thguss Feb 20, 2024
56cc739
[REFACTOR] DTO 리팩토링
unanchoi Feb 22, 2024
c7a9e26
[REFACTOR] 파라미터 수정 및 불필요한 import 삭제
unanchoi Feb 22, 2024
5825e55
[REFACTOR] 버전업
thguss Feb 22, 2024
0bd4397
[REFACTOR] 외부 API 호출 : RestClient 으로 변경
thguss Feb 22, 2024
ce2b3a6
[REFACTOR] 람다식 수정 및 메소드 재활용
thguss Feb 22, 2024
745fdcb
[REFACTOR] 3차 리팩토링
unanchoi Feb 23, 2024
3783004
[REFACTOR] 불변성 보장을 위한 final 적용
unanchoi Feb 23, 2024
316c512
Merge pull request #208 from Team-Smeme/sohyeon_#198
thguss Feb 27, 2024
edb3492
[FIX] 리뷰 반영
unanchoi Feb 27, 2024
78b3ada
[CHORE] BadgeListResponse 컨벤션에 맞춰 리팩토링
unanchoi Feb 27, 2024
a595bf9
[CHORE] static import 적용 및 코드 정렬
unanchoi Feb 27, 2024
469e0bb
Merge branch 'refactor_#198' into refactor_#198_unan3
unanchoi Feb 27, 2024
0f41821
Merge pull request #209 from Team-Smeme/refactor_#198_unan3
unanchoi Feb 27, 2024
57688ca
Merge pull request #203 from Team-Smeme/refactor_#198
thguss Feb 27, 2024
bf37a67
[FIX] jar 파일 경로 수정
thguss Feb 27, 2024
efe702f
Merge pull request #212 from Team-Smeme/sohyeon_#211
thguss Feb 27, 2024
d5ad78c
[FIX] 테스트 URI 수정
thguss Feb 27, 2024
bd3d35c
Merge pull request #213 from Team-Smeme/sohyeon_#211
thguss Feb 27, 2024
4e35c29
[FIX] Bearer 중복으로 들어가는 코드 삭제
unanchoi Mar 2, 2024
31d17c7
Merge pull request #216 from Team-Smeme/fix_#214_unan
unanchoi Mar 2, 2024
a26094a
[FIX] MemberController Response DTO 교체
unanchoi Mar 3, 2024
08279ee
[FIX] Badge 목록 조회 API DTO 수정
unanchoi Mar 3, 2024
db7057e
[CHORE] 스웨거 이사(인터페이스) 초기 세팅
thguss Mar 5, 2024
1404e99
Merge pull request #218 from Team-Smeme/fix_#217_unan
unanchoi Mar 5, 2024
1120d01
Merge pull request #220 from Team-Smeme/sohyeon_#219
thguss Mar 5, 2024
d630dab
[FEAT] Discord 알람 기능 구현
unanchoi Mar 5, 2024
200afe3
[SETTING] 설정 파일에 Discord Webhook Uri 추가
unanchoi Mar 5, 2024
150d353
[FEAT] 디스코드 회원가입 알람 구현
unanchoi Mar 5, 2024
f257ce1
[CHORE] 디스코드 알람시에 실행 환경 확인 가능하게 수정
unanchoi Mar 5, 2024
ad0102c
[STYLE]: FailureCode static import로 변경
unanchoi Mar 5, 2024
6f48524
Merge pull request #221 from Team-Smeme/feat_#215_unan
unanchoi Mar 5, 2024
5255368
[FIX] 유연성을 위해 GoalType 타입으로 변경
thguss Mar 6, 2024
b7dc49c
[ADD] 목표 제목 추가
thguss Mar 6, 2024
d3d85f6
Merge pull request #223 from Team-Smeme/sohyeon_#222
thguss Mar 8, 2024
df0bc74
[FIX] 중복 작성된 로직 삭제
unanchoi Mar 11, 2024
cd8800e
[CHORE] 미사용 코드 import 삭제
unanchoi Mar 11, 2024
c36c997
[SETTING] Spring Boot version 3.2.0 -> 3.2.1
unanchoi Mar 11, 2024
fd6c775
[FIX] TrainingTimeRequest를 null로 보내는 것에 대응
unanchoi Mar 11, 2024
26a03a3
[CHORE] null 조건문 Objects.isNull()로 수정
unanchoi Mar 11, 2024
8618e8e
Merge pull request #225 from Team-Smeme/fix_#224_unan
unanchoi Mar 11, 2024
12af42e
[CHORE] 스웨거 이사
thguss Mar 12, 2024
d0e0249
[REFACTOR] Swagger Interface로 분리 작업
unanchoi Mar 12, 2024
35f935a
[ADD] 스웨거 컨벤션 통일 반영
thguss Mar 12, 2024
e5dd9ed
[REFACTOR] Swagger 컨벤션에 맞춰서 Member, Auth, Badge API 수정
unanchoi Mar 12, 2024
3fc2a0f
[FIX] Swagger 400 response 4xx로 수정
unanchoi Mar 12, 2024
4427a56
[CHORE] controller package -> api로 변경
unanchoi Mar 12, 2024
09c77b6
[FIX] 토큰 필드명 통일 반영
thguss Mar 12, 2024
9441d14
[FIX] 토큰 필드명 통일 반영
unanchoi Mar 12, 2024
1f5a926
Merge pull request #226 from Team-Smeme/sohyeon_#186
unanchoi Mar 12, 2024
e77b535
Merge branch 'develop' into refactor_#186_unan
unanchoi Mar 12, 2024
565b614
Merge pull request #227 from Team-Smeme/refactor_#186_unan
unanchoi Mar 12, 2024
77a8d79
[CHORE] Auth API implements 키워드 추가
unanchoi Mar 12, 2024
a9bb1c5
Merge pull request #229 from Team-Smeme/refactor_#228_unan
unanchoi Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/cd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
- name: Create application-secret.yml
run: |
pwd
touch src/main/resources/application-secret.yml
echo "${{ secrets.APPLICATION_SECRET_YML }}" >> src/main/resources/application-secret.yml
cat src/main/resources/application-secret.yml
cd ./smeem-api/src/main/resources
touch ./application-secret.yml
echo "${{ secrets.APPLICATION_SECRET_YML }}" >> ./application-secret.yml
cat ./application-secret.yml

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
- name: Create application-secret.yml
run: |
pwd
touch src/main/resources/application-secret.yml
echo "${{ secrets.APPLICATION_SECRET_YML }}" >> src/main/resources/application-secret.yml
cat src/main/resources/application-secret.yml
cd ./smeem-api/src/main/resources
touch ./application-secret.yml
echo "${{ secrets.APPLICATION_SECRET_YML }}" >> ./application-secret.yml
cat ./application-secret.yml

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
- name: Create application-secret.yml
run: |
pwd
touch src/main/resources/application-secret.yml
echo "${{ secrets.APPLICATION_SECRET_YML }}" >> src/main/resources/application-secret.yml
cat src/main/resources/application-secret.yml
cd ./smeem-api/src/main/resources
touch ./application-secret.yml
echo "${{ secrets.APPLICATION_SECRET_YML }}" >> ./application-secret.yml
cat ./application-secret.yml

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HELP.md
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
!**/src/com.smeem.test/**/build/

### STS ###
.apt_generated
Expand All @@ -15,7 +15,7 @@ build/
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
!**/src/com.smeem.test/**/bin/

### IntelliJ IDEA ###
.idea
Expand All @@ -24,7 +24,7 @@ bin/
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
!**/src/com.smeem.test/**/out/

### NetBeans ###
/nbproject/private/
Expand Down
150 changes: 32 additions & 118 deletions build.gradle
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 }
4 changes: 2 additions & 2 deletions scripts/run_new_was.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ fi

if [ "$DEPLOYMENT_GROUP_NAME" == "prod-group" ]
then
nohup java -jar -Dserver.port=${TARGET_PORT} -Dspring.profiles.active=prod /home/ubuntu/smeme/build/libs/server-0.0.1-SNAPSHOT.jar > /dev/null 2> /dev/null < /dev/null &
nohup java -jar -Dserver.port=${TARGET_PORT} -Dspring.profiles.active=prod /home/ubuntu/smeme/smeem-api/build/libs/smeem-api-0.0.1-SNAPSHOT.jar > /dev/null 2> /dev/null < /dev/null &
echo "> Now new WAS runs at ${TARGET_PORT}."
fi

if [ "$DEPLOYMENT_GROUP_NAME" == "smeme-group" ]
then
nohup java -jar -Dserver.port=${TARGET_PORT} -Dspring.profiles.active=dev /home/ubuntu/smeme/build/libs/server-0.0.1-SNAPSHOT.jar > /dev/null 2> /dev/null < /dev/null &
nohup java -jar -Dserver.port=${TARGET_PORT} -Dspring.profiles.active=dev /home/ubuntu/smeme/smeem-api/build/libs/smeem-api-0.0.1-SNAPSHOT.jar > /dev/null 2> /dev/null < /dev/null &
echo "> Now new WAS runs at ${TARGET_PORT}."
fi

Expand Down
6 changes: 6 additions & 0 deletions settings.gradle
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'

27 changes: 27 additions & 0 deletions smeem-api/build.gradle
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()
}
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 smeem-api/src/main/java/com/smeem/api/auth/api/AuthApi.java
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);

}
Loading
Loading