Skip to content

Commit

Permalink
style(#448): Apply Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
ImKunYoung committed Nov 23, 2023
1 parent 09a4b1c commit f500681
Show file tree
Hide file tree
Showing 108 changed files with 714 additions and 736 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,53 @@
@Slf4j
public class AuthApplication {

public static void main(String[] args) {
SpringApplication app = new SpringApplication(AuthApplication.class);
Environment env = app.run(args).getEnvironment();
logApplicationStartup(env);
}
public static void main(String[] args) {
SpringApplication app = new SpringApplication(AuthApplication.class);
Environment env = app.run(args).getEnvironment();
logApplicationStartup(env);
}

private static void logApplicationStartup(Environment env) {
String protocol = Optional.ofNullable(env.getProperty("server.ssl.key-store")).map(key -> "https").orElse("http");
String serverPort = env.getProperty("server.port");
String contextPath = Optional
.ofNullable(env.getProperty("server.servlet.context-path"))
.filter(StringUtils::isNotBlank)
.orElse("/");
String hostAddress = "localhost";
try {
hostAddress = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e) {
log.warn("The host name could not be determined, using `localhost` as fallback");
}
log.info(
CRLFLogConverter.CRLF_SAFE_MARKER,
"\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" +
"Local: \t\t{}://localhost:{}{}\n\t" +
"External: \t{}://{}:{}{}\n\t" +
"Profile(s): \t{}\n----------------------------------------------------------",
env.getProperty("spring.application.name"),
protocol,
serverPort,
contextPath,
protocol,
hostAddress,
serverPort,
contextPath,
env.getActiveProfiles().length == 0 ? env.getDefaultProfiles() : env.getActiveProfiles()
);
private static void logApplicationStartup(Environment env) {
String protocol = Optional.ofNullable(env.getProperty("server.ssl.key-store")).map(key -> "https").orElse("http");
String serverPort = env.getProperty("server.port");
String contextPath = Optional
.ofNullable(env.getProperty("server.servlet.context-path"))
.filter(StringUtils::isNotBlank)
.orElse("/");
String hostAddress = "localhost";
try {
hostAddress = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e) {
log.warn("The host name could not be determined, using `localhost` as fallback");
}
log.info(
CRLFLogConverter.CRLF_SAFE_MARKER,
"\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" +
"Local: \t\t{}://localhost:{}{}\n\t" +
"External: \t{}://{}:{}{}\n\t" +
"Profile(s): \t{}\n----------------------------------------------------------",
env.getProperty("spring.application.name"),
protocol,
serverPort,
contextPath,
protocol,
hostAddress,
serverPort,
contextPath,
env.getActiveProfiles().length == 0 ? env.getDefaultProfiles() : env.getActiveProfiles()
);

String configServerStatus = env.getProperty("configserver.status");
if (configServerStatus == null) {
configServerStatus = "Not found or not setup for this application";
}
log.info(
CRLFLogConverter.CRLF_SAFE_MARKER,
"\n----------------------------------------------------------\n\t" +
"Config Server: \t{}\n----------------------------------------------------------",
configServerStatus
);
}
String configServerStatus = env.getProperty("configserver.status");
if (configServerStatus == null) {
configServerStatus = "Not found or not setup for this application";
}
log.info(
CRLFLogConverter.CRLF_SAFE_MARKER,
"\n----------------------------------------------------------\n\t" +
"Config Server: \t{}\n----------------------------------------------------------",
configServerStatus
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ private String getExtension(MultipartFile multipartFile) throws NullValueExcepti
return multipartFile.getOriginalFilename().substring(extensionIndex);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new RequestLoggingInterceptor());
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public AbstractApiException(AuthErrorCode errorCode, String msg) {
errorName = errorCode.getErrorName();
errorMessage = msg;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ public enum AuthErrorCode implements ErrorCode{
public String getErrorName() {
return this.name();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public String toString() {
", path='" + path + '\'' +
'}';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
log.info("Response Status: {}", response.getStatus());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@ private String reIssueRefreshToken(Auth user) {
return reIssuedRefreshToken;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,3 @@ public String createTokensAndAddHeaders(Auth auth, boolean isAutoLogin, HttpServ
return refreshToken;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ public CustomOAuth2User(Collection<? extends GrantedAuthority> authorities,
this.role = role;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ private Auth saveUser(OAuthAttributes attributes, SocialLoginType socialType) {
return createdUser;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ public String getName() {
return (String) response.get(NAVER_NAME_KEY);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ public void onAuthenticationFailure(HttpServletRequest request, HttpServletRespo
log.info("소셜 로그인에 실패했습니다. 에러 메시지 : {}", exception.getMessage());
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ private Tokens loginSuccess(HttpServletResponse response, CustomOAuth2User oAuth
return new Tokens(authorizationTypePrefix + accessToken, refreshToken);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ public OAuth2UserInfo(Map<String, Object> attributes) {

public abstract String getName();
}

Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,3 @@ public Auth toAuthEntity(OAuth2UserInfo oauth2UserInfo) {
.build();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ public static void checkRole(String role) {
throw new InvalidAdminRoleException(role);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public class EmailPageFormatter {
+ "</table>";

/**
*
*
* @param mainText 주요 문구
* @param subText 서브 문구
* @param name 고객 이름
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ public static String generateRandomPassword() {
return password.toString();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public interface NoticeRepository extends JpaRepository<Notice, String> {

Page<Notice> findAllByOrderByCreatedAtDesc(Pageable pageable);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
@RequiredArgsConstructor
@Transactional
public class NoticeCreateServiceImpl implements NoticeCreateService {

private final NoticeRepository noticeRepository;

@Override
public void createNoticeByAdmin(String role, NoticeCreateRequestDto dto) {
AdminRoleUtils.checkRole(role);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public ResponseEntity<Void> deleteNoticeByAdmin(@RequestHeader("LB-Role") String
noticeDeleteService.deleteNoticeByAdmin(role, noticeId);
return ResponseEntity.noContent().build();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
import org.springframework.data.jpa.repository.JpaRepository;

public interface QuestionReplyRepository extends JpaRepository<QuestionReply, String> {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public interface QuestionRepository extends JpaRepository<Question, String> {
Page<Question> findAllByWriterId(String writerId, PageRequest pageable);

void deleteAllByWriterId(String writerId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ public enum Role {

private final String key;
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
public interface SocialLoginRepository extends JpaRepository<SocialLogin, String> {
Optional<SocialLogin> findByEmail(String email);
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
@SpringBootTest(classes = AuthApplication.class)
class AuthApplicationTests {

@Test
void contextLoads() {
}
@Test
void contextLoads() {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public class RedisTestContainer {
System.setProperty("spring.data.redis.host", REDIS_CONTAINER.getHost());
System.setProperty("spring.data.redis.port", REDIS_CONTAINER.getMappedPort(6379).toString());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ void basicPath() {
void InvalidAdminRoleException() {
assertThrows(InvalidAdminRoleException.class, () -> service.retrieveCustomerInfoByAdmin(Role.USER.name(), PageRequest.of(0, 1)));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ class EmailSignUpServiceImplTest {
@Autowired
private EmailSignUpService emailSignUpService;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ void deleteByUserId () throws Exception{
//then
assertThat(result).isNotPresent();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ private String randomContent() {
private String randomString(int min, int max) {
return "?".repeat(new Random().nextInt(min, max));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ void test_retrieveNoticeDetailByAdmin_when_wrongNoticeId_throw_NoticeNotFoundByI
);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ void test_updatePassword() throws Exception {
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ void retrieveReviewerProfile () throws Exception{
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ void retrieveUserNoticeDetail_NoticeNotFoundById () throws Exception{
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ CustomerInfoListResponseDto nextGiven(List<CustomerInfoResponseDto> elements, in
.willReturn(dto);
return dto;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ void retrieveReviewerProfile () throws Exception{
actions.andDo(print());
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ void findAuthAndSocialLoginByEmail () throws Exception{

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public boolean isValid(String value, ConstraintValidatorContext context) {
return false;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public boolean isValid(Number value, ConstraintValidatorContext context) {
return false;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new RequestLoggingInterceptor());
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public AbstractApiException(ProductErrorCode errorCode, String errorMessage) {
this.errorName = errorCode.getErrorName();
this.errorMessage = errorMessage;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ public String toString() {
", path='" + path + '\'' +
'}';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ public enum ProductErrorCode implements ErrorCode {
public String getErrorName() {
return this.name();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ public SameOrderStatusRequestException() {
super("현재와 같은 상태 변경 요청입니다.");
logger.error("SameOrderStatusRequestException: {}, {}, {}", getHttpStatus(), getErrorMessage(), getErrorCode());
}
}
}
Loading

0 comments on commit f500681

Please sign in to comment.