Skip to content

Commit

Permalink
feat : 심사 계정
Browse files Browse the repository at this point in the history
  • Loading branch information
wellbeing-dough committed Oct 12, 2023
1 parent 14c8bfa commit 4be8c46
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public LoginToken generate(String providerId, boolean isNewUser) {
);
}

private String generateRefreshToken(Long userId) {
public String generateRefreshToken(Long userId) {
return jwtTokenProvider.makeJwtToken(userId, MONTH_TO_MINITES);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import co.kr.jurumarble.user.dto.request.UpdateUserRequest;
import co.kr.jurumarble.user.dto.response.GetUserResponse;
import co.kr.jurumarble.user.dto.response.TokenResponse;
import co.kr.jurumarble.user.dto.response.TokenTestResponse;
import co.kr.jurumarble.user.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
Expand Down Expand Up @@ -73,4 +74,11 @@ public ResponseEntity<HttpStatus> validBirth(@PathVariable Long year) {
userService.validBirth(year);
return ResponseEntity.ok().build();
}

@Operation(summary = "심사용 계정 로그인")
@GetMapping("/test")
public ResponseEntity<TokenTestResponse> tokenTest() {
String token = userService.testToken();
return ResponseEntity.ok().body(new TokenTestResponse(token));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package co.kr.jurumarble.user.dto.response;

import lombok.Getter;

@Getter
public class TokenTestResponse {
private String accessToken;
private String refreshToken;
private boolean isNewUser;

public TokenTestResponse(String token) {
this.accessToken = token;
this.refreshToken = token;
this.isNewUser = true;
}
}
5 changes: 5 additions & 0 deletions src/main/java/co/kr/jurumarble/user/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ public void updateUser(Long userId, UpdateUserInfo updateUserInfo) {
public void validBirth(Long year) {
userManager.validBirth(year);
}

public String testToken() {
String token = tokenGenerator.generateRefreshToken(19L);
return token;
}
}

0 comments on commit 4be8c46

Please sign in to comment.