diff --git a/src/main/java/gwangjang/server/domain/community/adapter/in/message/MemberChannels.java b/src/main/java/gwangjang/server/domain/community/adapter/in/message/MemberChannels.java deleted file mode 100644 index 1c634b4..0000000 --- a/src/main/java/gwangjang/server/domain/community/adapter/in/message/MemberChannels.java +++ /dev/null @@ -1,26 +0,0 @@ -package gwangjang.server.domain.community.adapter.in.message; -import lombok.RequiredArgsConstructor; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.messaging.Message; -import org.springframework.messaging.support.MessageBuilder; - -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.function.Supplier; -@Configuration -@RequiredArgsConstructor -public class MemberChannels { - - @Bean - public Supplier> sendToMember() { // 메시지를 주기적으로 생성하고 보내는 데 사용 - return () -> { - // 메시지 생성 로직 - String jsonMessage = "{\"key\":\"value\"}"; - - // dto to string - return MessageBuilder.withPayload(jsonMessage).build(); - }; - } - -} diff --git a/src/main/java/gwangjang/server/domain/community/adapter/in/message/model/CommunityCustomDeserializer.java b/src/main/java/gwangjang/server/domain/community/adapter/in/message/model/CommunityCustomDeserializer.java deleted file mode 100644 index 7ddecc7..0000000 --- a/src/main/java/gwangjang/server/domain/community/adapter/in/message/model/CommunityCustomDeserializer.java +++ /dev/null @@ -1,43 +0,0 @@ -package gwangjang.server.domain.community.adapter.in.message.model; - -import com.fasterxml.jackson.databind.ObjectMapper; -import gwangjang.server.domain.community.application.dto.res.MemberDto; -import lombok.RequiredArgsConstructor; -import org.apache.kafka.common.header.Headers; -import org.apache.kafka.common.serialization.Deserializer; - -import java.util.Map; - -@RequiredArgsConstructor -public class CommunityCustomDeserializer implements Deserializer { - - private final ObjectMapper objectMapper; - - @Override - public void configure(Map configs, boolean isKey) { - Deserializer.super.configure(configs, isKey); - } - - @Override - public MemberDto deserialize(String topic, byte[] data) { - if (data == null) { - return null; - } - - try { - return objectMapper.readValue(data, MemberDto.class); - } catch (Exception e) { - throw new RuntimeException("Deserialization error: " + e.getMessage(), e); - } - } - - @Override - public MemberDto deserialize(String topic, Headers headers, byte[] data) { - return Deserializer.super.deserialize(topic, headers, data); - } - - @Override - public void close() { - Deserializer.super.close(); - } -} diff --git a/src/main/java/gwangjang/server/domain/community/adapter/out/client/FindMemberFeignClient.java b/src/main/java/gwangjang/server/domain/community/adapter/out/client/FindMemberFeignClient.java deleted file mode 100644 index 697d06f..0000000 --- a/src/main/java/gwangjang/server/domain/community/adapter/out/client/FindMemberFeignClient.java +++ /dev/null @@ -1,17 +0,0 @@ -//package gwangjang.server.domain.adapter.out.client; -// -//import org.springframework.cloud.openfeign.FeignClient; -//import org.springframework.web.bind.annotation.PathVariable; -//import org.springframework.web.bind.annotation.RequestMapping; -//import org.springframework.web.bind.annotation.RequestMethod; -// -//import java.util.concurrent.TimeoutException; -// -//@FeignClient("memberService") -//public interface FindMemberFeignClient { -// -//// @CircuitBreaker(name="memberService") -//// @RequestMapping(method= RequestMethod.GET,value="/writer/{writerId}",consumes = "application/json") -//// Long findWriterById(@PathVariable("memberId")Long writerId) throws TimeoutException; -// -//} diff --git a/src/main/java/gwangjang/server/domain/community/adapter/out/client/KafkaConsumer.java b/src/main/java/gwangjang/server/domain/community/adapter/out/client/KafkaConsumer.java deleted file mode 100644 index 823d908..0000000 --- a/src/main/java/gwangjang/server/domain/community/adapter/out/client/KafkaConsumer.java +++ /dev/null @@ -1,28 +0,0 @@ -//package gwangjang.server.domain.adapter.out.client; -// -//import gwangjang.server.domain.domain.repository.CommunityRepository; -//import lombok.extern.slf4j.Slf4j; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.kafka.annotation.KafkaListener; -//import org.springframework.stereotype.Service; -// -//@Service -//@Slf4j -//public class KafkaConsumer { -// -// CommunityRepository communityRepository; -// -// @Autowired -// public KafkaConsumer(CommunityRepository communityRepository) { -// this.communityRepository = communityRepository; -// } -// -// @KafkaListener(topics = "gugbab-services-kafka-users-star-cnt-topic", groupId = "serviesConsumerGroupId") -// public void updateUserStarCnt(String kafkaMessage) { -// -// log.info("kafka Message : " + kafkaMessage); -// -// -// } -// -//} diff --git a/src/main/java/gwangjang/server/domain/community/adapter/out/client/KafkaConsumerConfig.java b/src/main/java/gwangjang/server/domain/community/adapter/out/client/KafkaConsumerConfig.java deleted file mode 100644 index 1a72b05..0000000 --- a/src/main/java/gwangjang/server/domain/community/adapter/out/client/KafkaConsumerConfig.java +++ /dev/null @@ -1,51 +0,0 @@ -//package gwangjang.server.domain.adapter.out.client; -// -// -//import org.apache.kafka.clients.consumer.ConsumerConfig; -//import org.apache.kafka.common.serialization.StringDeserializer; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.context.annotation.Bean; -//import org.springframework.context.annotation.Configuration; -//import org.springframework.core.env.Environment; -//import org.springframework.kafka.annotation.EnableKafka; -//import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory; -//import org.springframework.kafka.core.ConsumerFactory; -//import org.springframework.kafka.core.DefaultKafkaConsumerFactory; -// -//import java.util.HashMap; -//import java.util.Map; -// -//@EnableKafka -//@Configuration -//public class KafkaConsumerConfig { -// -// Environment env; -// -// @Autowired -// public KafkaConsumerConfig(Environment env) { -// this.env = env; -// } -// -// -// @Bean -// // Topic에 접속에 필요한 정보 -// public ConsumerFactory consumerFactory() { -// Map properties = new HashMap<>(); -// properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, env.getProperty("gugbab.public.url.local.kafka_server")); -// properties.put(ConsumerConfig.GROUP_ID_CONFIG, "serviesConsumerGroupId"); -// properties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); -// properties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); -// return new DefaultKafkaConsumerFactory<>(properties); -// } -// -// @Bean -// // Topic Listener -// public ConcurrentKafkaListenerContainerFactory KafkaListenerContatinerFactory() { -// ConcurrentKafkaListenerContainerFactory kafkaListenerContainerFactory = new ConcurrentKafkaListenerContainerFactory<>(); -// kafkaListenerContainerFactory.setConsumerFactory(consumerFactory()); -// -// return kafkaListenerContainerFactory; -// } -// -// -//} \ No newline at end of file diff --git a/src/main/java/gwangjang/server/domain/community/adapter/out/message/CommunityChannels.java b/src/main/java/gwangjang/server/domain/community/adapter/out/message/CommunityChannels.java deleted file mode 100644 index 9a19d50..0000000 --- a/src/main/java/gwangjang/server/domain/community/adapter/out/message/CommunityChannels.java +++ /dev/null @@ -1,27 +0,0 @@ -package gwangjang.server.domain.community.adapter.out.message; -import lombok.RequiredArgsConstructor; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.messaging.MessageChannel; - -import java.util.function.Consumer; - -@Configuration -@RequiredArgsConstructor -public class CommunityChannels { - - // @Bean -// public Function uppercase() { // 메시지를 받아 처리한 후 결과를 반환 -// return message -> { -// // 메시지 처리 로직 -// return message.toUpperCase(); -// }; -//} - @Bean - public Consumer receiveFromMember() { //메시지를 받아 처리하는 데 사용되지만 반환 값이 없 - return message -> { - // 메시지 처리 로직 ( 역직렬화 ) - System.out.println("Received: " + message); - }; - } -} diff --git a/src/main/java/gwangjang/server/domain/community/adapter/out/source/KafkaSourceBean.java b/src/main/java/gwangjang/server/domain/community/adapter/out/source/KafkaSourceBean.java deleted file mode 100644 index 7d8b270..0000000 --- a/src/main/java/gwangjang/server/domain/community/adapter/out/source/KafkaSourceBean.java +++ /dev/null @@ -1,4 +0,0 @@ -package gwangjang.server.domain.community.adapter.out.source; - -public class KafkaSourceBean { -} diff --git a/src/main/java/gwangjang/server/domain/community/application/dto/res/CommunityRes.java b/src/main/java/gwangjang/server/domain/community/application/dto/res/CommunityRes.java index 7d7b0e8..97328cc 100644 --- a/src/main/java/gwangjang/server/domain/community/application/dto/res/CommunityRes.java +++ b/src/main/java/gwangjang/server/domain/community/application/dto/res/CommunityRes.java @@ -29,6 +29,7 @@ public class CommunityRes { private Long contentsId; private String contents; private String contentsTitle; + private String contentsUrl; private String likeStatus; @@ -63,5 +64,6 @@ public void updateContentsDto(ContentsDto contentsDto) { this.keyword = contentsDto.getKeyword(); this.contents = contentsDto.getUrl(); this.contentsTitle = contentsDto.getTitle(); + this.contentsUrl = contentsDto.getImgUrl(); } }