diff --git a/src/main/java/com/example/jolvre/exhibition/service/ExhibitService.java b/src/main/java/com/example/jolvre/exhibition/service/ExhibitService.java index 655735e..eb8dab3 100644 --- a/src/main/java/com/example/jolvre/exhibition/service/ExhibitService.java +++ b/src/main/java/com/example/jolvre/exhibition/service/ExhibitService.java @@ -15,7 +15,6 @@ import com.example.jolvre.exhibition.repository.ExhibitImageRepository; import com.example.jolvre.exhibition.repository.ExhibitQueryDslRepository; import com.example.jolvre.exhibition.repository.ExhibitRepository; -import com.example.jolvre.notification.entity.NotificationType; import com.example.jolvre.notification.service.NotificationService; import com.example.jolvre.user.entity.User; import com.example.jolvre.user.service.UserService; @@ -41,12 +40,11 @@ public class ExhibitService { private final DiaryRepository diaryRepository; private final ExhibitCommentRepository exhibitCommentRepository; - private final WebClient webClient; private final NotificationService notificationService; private final ExhibitQueryDslRepository exhibitQueryDslRepository; - + @Transactional public ExhibitUploadResponse uploadExhibit(ExhibitUploadRequest request, Long userId) { @@ -240,52 +238,7 @@ public ExhibitInvitationResponse createInvitation(Long exhibitId) { } - - @Transactional - public void uploadComment(Long exhibitId, Long loginUserId, ExhibitCommentUploadRequest request) { - Exhibit exhibit = exhibitRepository.findById(exhibitId).orElseThrow( - ExhibitNotFoundException::new); - User user = userService.getUserById(loginUserId); - - ExhibitComment comment = ExhibitComment.builder() - .exhibit(exhibit) - .user(user) - .content(request.getContent()).build(); - - exhibitCommentRepository.save(comment); - - notificationService.commentNotificationCreate(loginUserId, exhibit.getUser().getId(), - user.getNickname() + "님이 감상평을 남겼습니다", NotificationType.EXHIBIT_COMMENT); - } - - @Transactional - public ExhibitCommentInfoResponses getAllCommentInfo(Long exhibitId) { - List comments = exhibitCommentRepository.findAllByExhibitId(exhibitId); - - return ExhibitCommentInfoResponses.toDTO(comments); - } - - @Transactional - public void updateComment(Long commentId, Long loginUserId, ExhibitCommentUpdateRequest request) { - ExhibitComment comment = exhibitCommentRepository.findByIdAndUserId(commentId, loginUserId) - .orElseThrow(CommentNotFoundException::new); - - comment.updateContent(request.getContent()); - - exhibitCommentRepository.save(comment); - } - - @Transactional - public void deleteComment(Long commentId, Long loginUserId) { - ExhibitComment comment = exhibitCommentRepository.findByIdAndUserId(commentId, loginUserId) - .orElseThrow(CommentNotFoundException::new); - - exhibitCommentRepository.delete(comment); - } - - // 키워드 기반 전시 조회 - public Page getExhibitInfoByKeyword(String keyword, Pageable pageable) { return exhibitQueryDslRepository.findAllByFilter(true, keyword, pageable); } diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index ab092cb..8a350ef 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -46,6 +46,9 @@ spring.mail.properties.mail.transport.protocol=smtp #Redis spring.data.redis.host=${REDIS_HOST} spring.data.redis.port=${REDIS_PORT} +#Kafka +spring.kafka.bootstrap-servers=localhost:9092 +spring.kafka.consumer.group-id=jolvre #Model API model.api.url=${MODEL_API_URL} diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index edb3308..fd57134 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -46,3 +46,6 @@ spring.mail.properties.mail.transport.protocol=smtp #Redis spring.data.redis.host=${REDIS_HOST} spring.data.redis.port=${REDIS_PORT} +#Kafka +spring.kafka.bootstrap-servers=localhost:9092 +spring.kafka.consumer.group-id=jolvre diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index d00fc71..94896b4 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,38 +1,4 @@ spring.application.name=Graduate_Minions - -spring.profiles.include=oauth,swagger,email,redis,actuator,aws -spring.datasource.driver-class-name=${DB_CLASS} -spring.datasource.url=${DB_URL} -spring.datasource.username=${DB_USERNAME} -spring.datasource.password=${DB_PASSWORD} -#devtools -spring.devtools.restart.enabled=false -#JPA -spring.jpa.show-sql=true -spring.jpa.hibernate.ddl-auto=update -spring.jpa.properties.hibernate.format_sql=true -spring.jpa.generate-ddl=true -#jwt -jwt.secretKey=${JWT_SECRET_KEY} -jwt.access.expiration=3600000 -jwt.access.header=Authorization -jwt.refresh.expiration=1209600000 -jwt.refresh.header=Authorization-refresh -#verifyStudent -verify.student.apiKey=${VERIFY_STUDENT_APIKEY} -#File -spring.servlet.multipart.maxFileSize=20MB -spring.servlet.multipart.maxRequestSize=20MB -#Kafka -spring.kafka.bootstrap-servers=localhost:9092 -spring.kafka.consumer.group-id=jolvre -#spring.kafka.consumer.auto-offset-reset=earliest -#spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer -#spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer -#spring.kafka.consumer.client-id= -#spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer -#spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer - spring.profiles.active=dev,prod spring.profiles.include=oauth