-
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 #250 from Team-Sopetit/develop
[CHORE] 실서버 배포
- Loading branch information
Showing
238 changed files
with
5,665 additions
and
5,400 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
135 changes: 135 additions & 0 deletions
135
src/main/java/com/soptie/server/auth/controller/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,135 @@ | ||
package com.soptie.server.auth.controller; | ||
|
||
import java.security.Principal; | ||
|
||
import com.soptie.server.auth.controller.dto.response.SignInResponse; | ||
import com.soptie.server.auth.controller.dto.response.TokenGetResponse; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
|
||
import com.soptie.server.auth.controller.dto.request.SignInRequest; | ||
import com.soptie.server.auth.service.dto.response.TokenGetServiceResponse; | ||
import com.soptie.server.common.dto.BaseResponse; | ||
import com.soptie.server.common.dto.ErrorResponse; | ||
import com.soptie.server.common.dto.SuccessResponse; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
|
||
@Tag(name = "auth", description = "인증 API") | ||
public interface AuthApi { | ||
|
||
@Operation( | ||
summary = "소셜 로그인", | ||
description = "소셜 로그인을 진행한다.", | ||
responses = { | ||
@ApiResponse(responseCode = "200", description = "성공"), | ||
@ApiResponse( | ||
responseCode = "4xx", | ||
description = "클라이언트(요청) 오류", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
) | ||
} | ||
) | ||
ResponseEntity<SuccessResponse<SignInResponse>> signIn( | ||
@RequestHeader("Authorization") String socialAccessToken, | ||
@RequestBody SignInRequest request | ||
); | ||
|
||
@Operation( | ||
summary = "토큰 재발급", | ||
description = "리프레시 토큰을 이용해 액세스 토큰을 재발급 받는다.", | ||
responses = { | ||
@ApiResponse(responseCode = "200", description = "성공"), | ||
@ApiResponse( | ||
responseCode = "4xx", | ||
description = "클라이언트(요청) 오류", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "404", | ||
description = "유효하지 않은 회원", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "4xx", | ||
description = "클라이언트(요청) 오류", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
) | ||
} | ||
) | ||
ResponseEntity<SuccessResponse<TokenGetResponse>> reissueToken( | ||
@RequestHeader("Authorization") String refreshToken | ||
); | ||
|
||
@Operation( | ||
summary = "로그 아웃", | ||
description = "로그 아웃을 한다.", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", | ||
description = "성공", | ||
content = @Content(schema = @Schema(implementation = SuccessResponse.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "404", | ||
description = "유효하지 않은 회원", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "4xx", | ||
description = "클라이언트(요청) 오류", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
) | ||
} | ||
) | ||
ResponseEntity<BaseResponse> signOut(@Parameter(hidden = true) Principal principal); | ||
|
||
@Operation( | ||
summary = "회원 탈퇴", | ||
description = "회원 탈퇴를 진행한다.", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", | ||
description = "성공", | ||
content = @Content(schema = @Schema(implementation = SuccessResponse.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "404", | ||
description = "유효하지 않은 회원", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "4xx", | ||
description = "클라이언트(요청) 오류", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)) | ||
) | ||
} | ||
) | ||
ResponseEntity<BaseResponse> withdrawal(@Parameter(hidden = true) Principal principal); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...soptie/server/auth/dto/SignInRequest.java → ...controller/dto/request/SignInRequest.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
23 changes: 23 additions & 0 deletions
23
src/main/java/com/soptie/server/auth/controller/dto/response/SignInResponse.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,23 @@ | ||
package com.soptie.server.auth.controller.dto.response; | ||
|
||
import com.soptie.server.auth.service.dto.response.SignInServiceResponse; | ||
import lombok.Builder; | ||
import lombok.NonNull; | ||
|
||
import static lombok.AccessLevel.PRIVATE; | ||
|
||
@Builder(access = PRIVATE) | ||
public record SignInResponse( | ||
@NonNull String accessToken, | ||
@NonNull String refreshToken, | ||
boolean isMemberDollExist | ||
) { | ||
|
||
public static SignInResponse of(SignInServiceResponse response) { | ||
return SignInResponse.builder() | ||
.accessToken(response.accessToken()) | ||
.refreshToken(response.refreshToken()) | ||
.isMemberDollExist(response.isMemberDollExist()) | ||
.build(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/soptie/server/auth/controller/dto/response/TokenGetResponse.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.soptie.server.auth.controller.dto.response; | ||
|
||
import com.soptie.server.auth.service.dto.response.TokenGetServiceResponse; | ||
import lombok.Builder; | ||
import lombok.NonNull; | ||
|
||
import static lombok.AccessLevel.PRIVATE; | ||
|
||
@Builder(access = PRIVATE) | ||
public record TokenGetResponse( | ||
@NonNull String accessToken | ||
) { | ||
|
||
public static TokenGetResponse of(TokenGetServiceResponse response) { | ||
return TokenGetResponse.builder() | ||
.accessToken(response.accessToken()) | ||
.build(); | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
src/main/java/com/soptie/server/auth/dto/TokenResponse.java
This file was deleted.
Oops, something went wrong.
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
11 changes: 6 additions & 5 deletions
11
src/main/java/com/soptie/server/auth/service/AuthService.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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
package com.soptie.server.auth.service; | ||
|
||
import com.soptie.server.auth.dto.SignInRequest; | ||
import com.soptie.server.auth.dto.SignInResponse; | ||
import com.soptie.server.auth.dto.TokenResponse; | ||
import com.soptie.server.auth.service.dto.request.SignInServiceRequest; | ||
import com.soptie.server.auth.service.dto.request.TokenGetServiceRequest; | ||
import com.soptie.server.auth.service.dto.response.SignInServiceResponse; | ||
import com.soptie.server.auth.service.dto.response.TokenGetServiceResponse; | ||
|
||
public interface AuthService { | ||
|
||
SignInResponse signIn(String socialAccessToken, SignInRequest request); | ||
SignInServiceResponse signIn(SignInServiceRequest request); | ||
void signOut(long memberId); | ||
void withdraw(long memberId); | ||
TokenResponse reissueToken(String refreshToken); | ||
TokenGetServiceResponse reissueToken(TokenGetServiceRequest request); | ||
} |
Oops, something went wrong.