코드 정리 및 무중단 테스트
This commit is contained in:
@@ -17,15 +17,11 @@ public class ProfileController {
|
||||
@GetMapping("/profile")
|
||||
public String profile(){
|
||||
List<String> profiles = Arrays.asList(env.getActiveProfiles());
|
||||
|
||||
List<String> realProfiles = Arrays.asList("real", "real1", "real2");
|
||||
|
||||
String defaultProfile = profiles.isEmpty()? "default" : profiles.get(0);
|
||||
|
||||
String defaultProfile = profiles.isEmpty() ? "default" : profiles.get(0);
|
||||
return profiles.stream()
|
||||
.filter(realProfiles::contains)
|
||||
.findAny()
|
||||
.orElse(defaultProfile);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.csrf()
|
||||
.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
|
||||
|
||||
|
||||
// OAuth2 로그인 인증
|
||||
.and()
|
||||
.oauth2Login()
|
||||
|
||||
@@ -10,15 +10,10 @@ import myblog.blog.member.doamin.Member;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class MemberVo {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String username;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String email;
|
||||
|
||||
private String picUrl;
|
||||
|
||||
static public MemberVo from(Member member){
|
||||
|
||||
@@ -14,7 +14,6 @@ import java.util.Map;
|
||||
- 멤버 객체를 래핑한 커스텀 Principal 클래스
|
||||
*/
|
||||
public class PrincipalDetails implements OAuth2User {
|
||||
|
||||
private final Map<String, Object> attributes;
|
||||
private final Member member;
|
||||
private final MemberVo memberVo;
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.Map;
|
||||
|
||||
|
||||
public class NaverUserInfo implements Oauth2UserInfo {
|
||||
|
||||
private final Map<String, Object> attributes;
|
||||
|
||||
public NaverUserInfo(OAuth2User oAuth2User) {
|
||||
|
||||
@@ -10,10 +10,8 @@ import lombok.RequiredArgsConstructor;
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum ProviderType {
|
||||
|
||||
GOOGLE("google"),
|
||||
NAVER("naver");
|
||||
|
||||
private final String value;
|
||||
|
||||
}
|
||||
|
||||
@@ -15,5 +15,4 @@ public enum Role {
|
||||
ADMIN("ROLE_ADMIN");
|
||||
|
||||
private final String value;
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.*;
|
||||
@Transactional
|
||||
@RequiredArgsConstructor
|
||||
public class RssService implements RssUseCase {
|
||||
|
||||
private final ArticleUseCase articleUseCase;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.util.*;
|
||||
@Transactional
|
||||
@RequiredArgsConstructor
|
||||
public class SiteMapService implements SiteMapUseCase {
|
||||
|
||||
private final ArticleUseCase articleUseCase;
|
||||
private final CategoryUseCase categoryUseCase;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user