Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public class PlaygroundAuthService {
@Value("${makers.playground.web-page}")
private String playgroundWebPageUrl;

public PlaygroundProfile getPlaygroundMemberProfile(Long userId) {
try {
return playgroundClient.getPlaygroundMemberProfiles(userId).getFirst();
} catch (BadRequest e) {
throw new BadRequestException(ErrorCode.PLAYGROUND_PROFILE_NOT_EXISTS);
}
}
// public PlaygroundProfile getPlaygroundMemberProfile(Long userId) {
// try {
// return playgroundClient.getPlaygroundMemberProfiles(userId).getFirst();
// } catch (BadRequest e) {
// throw new BadRequestException(ErrorCode.PLAYGROUND_PROFILE_NOT_EXISTS);
// }
// }

public List<PlaygroundProfile> getPlaygroundMemberProfiles(List<Long> userIds) {
String stringifyIds = userIds.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@
public interface PlaygroundClient {

// headers 제외
@RequestLine("GET /internal/api/v1/members/profile?memberIds={memberId}")
List<PlaygroundProfile> getPlaygroundMemberProfiles(@Param("memberId") Long playgroundId);
// @RequestLine("GET /internal/api/v1/members/profile?memberIds={memberId}")
// List<PlaygroundProfile> getPlaygroundMemberProfiles(@Param("memberId") Long playgroundId);

// headers 제외
@RequestLine("GET /internal/api/v1/members/profile?memberIds={encodedIds}")
List<PlaygroundProfile> getPlaygroundMemberProfiles(@Param(value = "encodedIds") String encodedIds);

// headers 제외, userId
@RequestLine("GET /api/v1/members/profile/me?memberId={memberId}")
@RequestLine("GET /internal/api/v1/members/profile/me?memberId={memberId}")
OwnPlaygroundProfile getOwnPlaygroundProfile(@Param("memberId") Long userId);

// headermap 제외 memberId 추가
@RequestLine("GET /internal/api/v1/members/profile/me?memberId={memberId}")
PlaygroundProfile getPlayGroundProfile(@Param("memberId") Long memberId);

// header 제외
@RequestLine("POST /internal/api/v1/members/profile/recommend")
PlaygroundUserIds getPlaygroundUserIdsByCondition(@RequestBody PlaygroundUserFindCondition condition);

// headermap 제외
@RequestLine("GET /internal/api/v1/members/{memberId}/project")
PlayGroundUserSoptLevelResponse getPlayGroundUserSoptLevel(@Param Long memberId);

// headermap 제외 memberId 추가
@RequestLine("GET /api/v1/members/profile/me?memberId={memberId}")
PlaygroundProfile getPlayGroundProfile(@Param Long memberId);
PlayGroundUserSoptLevelResponse getPlayGroundUserSoptLevel(@Param("memberId") Long memberId);

// headermap 제외
@RequestLine("GET /internal/api/v1/community/posts/latest")
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/sopt/app/common/config/OpenApiConfig.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.sopt.app.common.config;

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
Expand All @@ -22,8 +21,9 @@
)
@SecurityScheme(
name = "Authorization",
type = SecuritySchemeType.APIKEY,
in = SecuritySchemeIn.HEADER
type = SecuritySchemeType.HTTP,
scheme = "bearer",
bearerFormat = "JWT"
)
@Component
public class OpenApiConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ protected void doFilterInternal(
}

private String getAuthorizationToken(final HttpServletRequest request) {
return request.getHeader(HttpHeaders.AUTHORIZATION);
String header = request.getHeader(HttpHeaders.AUTHORIZATION);
if (header != null && header.startsWith(ACCESS_TOKEN_PREFIX)) {
return header.substring(ACCESS_TOKEN_PREFIX.length());
}
return null;
}
}