Skip to content

Commit

Permalink
[chore] spotless 적용 #141
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdtkdgns committed Aug 28, 2023
1 parent e06a9be commit 8c90eda
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.List;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;

@UseCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package allchive.server.core.async;


import java.lang.reflect.Method;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

@Slf4j
@Component
@RequiredArgsConstructor
Expand All @@ -20,4 +20,4 @@ public void handleUncaughtException(Throwable throwable, Method method, Object..
log.error("Parameter value - " + param);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package allchive.server.core.config;

import static allchive.server.core.consts.AllchiveConst.*;

import allchive.server.core.async.CustomAsyncExceptionHandler;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import lombok.RequiredArgsConstructor;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Bean;
Expand All @@ -9,11 +13,6 @@
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;

import static allchive.server.core.consts.AllchiveConst.*;

@EnableAsync
@Configuration
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package allchive.server.core.event.events.s3;

import lombok.Builder;
import lombok.Getter;

import java.util.List;
import lombok.Builder;
import lombok.Getter;

@Getter
public class S3ImageDeleteEvent {
Expand All @@ -15,8 +15,6 @@ private S3ImageDeleteEvent(List<String> keys) {
}

public static S3ImageDeleteEvent from(List<String> keys) {
return S3ImageDeleteEvent.builder()
.keys(keys)
.build();
return S3ImageDeleteEvent.builder().keys(keys).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import allchive.server.core.error.exception.S3ObjectNotFoundException;
import allchive.server.core.event.events.s3.S3ImageDeleteEvent;
import com.amazonaws.services.s3.AmazonS3;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
Expand All @@ -22,14 +20,17 @@ public class S3DeleteObjectService {
private String bucket;

@Async(value = "s3ImageTaskExecutor")
@TransactionalEventListener(value = S3ImageDeleteEvent.class
,phase = TransactionPhase.AFTER_COMMIT)
@TransactionalEventListener(
value = S3ImageDeleteEvent.class,
phase = TransactionPhase.AFTER_COMMIT)
public void deleteS3Object(S3ImageDeleteEvent s3ImageDeleteEvent) {
s3ImageDeleteEvent.getKeys().forEach(
key -> {
validateExistObject(key);
amazonS3.deleteObject(bucket, key);
});
s3ImageDeleteEvent
.getKeys()
.forEach(
key -> {
validateExistObject(key);
amazonS3.deleteObject(bucket, key);
});
}

private void validateExistObject(String key) {
Expand Down

0 comments on commit 8c90eda

Please sign in to comment.