-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: 로그인 여부 확인 API #913
feat: 로그인 여부 확인 API #913
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
|
||
import java.net.URI; | ||
|
||
import in.koreatech.koin.domain.user.dto.*; | ||
import org.springdoc.core.annotations.ParameterObject; | ||
import org.springframework.http.HttpStatusCode; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
|
@@ -18,24 +20,6 @@ | |
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A안 쓰는 import 정리 굿 |
||
import in.koreatech.koin.domain.user.dto.AuthResponse; | ||
import in.koreatech.koin.domain.user.dto.AuthTokenRequest; | ||
import in.koreatech.koin.domain.user.dto.CoopResponse; | ||
import in.koreatech.koin.domain.user.dto.EmailCheckExistsRequest; | ||
import in.koreatech.koin.domain.user.dto.FindPasswordRequest; | ||
import in.koreatech.koin.domain.user.dto.NicknameCheckExistsRequest; | ||
import in.koreatech.koin.domain.user.dto.StudentLoginRequest; | ||
import in.koreatech.koin.domain.user.dto.StudentLoginResponse; | ||
import in.koreatech.koin.domain.user.dto.StudentRegisterRequest; | ||
import in.koreatech.koin.domain.user.dto.StudentResponse; | ||
import in.koreatech.koin.domain.user.dto.StudentUpdateRequest; | ||
import in.koreatech.koin.domain.user.dto.StudentUpdateResponse; | ||
import in.koreatech.koin.domain.user.dto.UserLoginRequest; | ||
import in.koreatech.koin.domain.user.dto.UserLoginResponse; | ||
import in.koreatech.koin.domain.user.dto.UserPasswordChangeRequest; | ||
import in.koreatech.koin.domain.user.dto.UserPasswordCheckRequest; | ||
import in.koreatech.koin.domain.user.dto.UserTokenRefreshRequest; | ||
import in.koreatech.koin.domain.user.dto.UserTokenRefreshResponse; | ||
import in.koreatech.koin.domain.user.service.StudentService; | ||
import in.koreatech.koin.domain.user.service.UserService; | ||
import in.koreatech.koin.global.auth.Auth; | ||
|
@@ -171,6 +155,15 @@ public ResponseEntity<Void> findPassword( | |
return new ResponseEntity<>(HttpStatusCode.valueOf(201)); | ||
} | ||
|
||
@GetMapping("/user/check/login") | ||
public ResponseEntity<Void> checklogin( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이곳도 동일하게 checkLogin 으로 바꿔주시면 좋겠습니다! |
||
@ParameterObject @ModelAttribute(value = "access_token") | ||
@Valid UserAccessTokenRequest request | ||
) { | ||
userService.checkLogin(request.accessToken()); | ||
return ResponseEntity.ok().build(); | ||
} | ||
|
||
@PostMapping("/user/check/password") | ||
public ResponseEntity<Void> checkPassword( | ||
@Valid @RequestBody UserPasswordCheckRequest request, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package in.koreatech.koin.domain.user.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotNull; | ||
|
||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED; | ||
|
||
public record UserAccessTokenRequest( | ||
@Schema(description = "access_token", example = "eyJ0eXAiOiJKV1QiLCJhbGcIUzUxMic9.eyJpZCI6NTM5NhwIjoxkzI3MTA5ODE5fQ.rLEYGQfKI5_24ZlwLVwlgwnriqySPKwXNOeTRrbmxoCtlOzCVvM8FFcO9BA2vkqsmhf-w", requiredMode = REQUIRED) | ||
@NotNull(message = "access_token을 입력해주세요.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 그 부분을 깜빡했네요.. 지적 감사합니다ㅣ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아...맞다..ㅋㅋ 감사합니다 |
||
@JsonProperty("access_token") | ||
String accessToken | ||
) { | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
밑에보니 checkLogin인데 통일하는 것이 좋을것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헉 감사합니다!