-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from kusitms-28th-Meetup-E/feat/bubble
Feat/bubble
- Loading branch information
Showing
24 changed files
with
308 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
src/main/java/gwangjang/server/domain/member/adapter/consumer/message/CommunityChannels.java
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
...jang/server/domain/member/adapter/consumer/message/model/CommunityCustomDeserializer.java
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
src/main/java/gwangjang/server/domain/member/adapter/producer/message/MemberChannels.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/gwangjang/server/domain/subscribe/adapter/PublishSubscribeChange.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//package gwangjang.server.domain.subscribe.adapter; | ||
// | ||
//import gwangjang.server.domain.subscribe.adapter.producer.web.dto.SubscribeData; | ||
//import gwangjang.server.domain.subscribe.adapter.producer.web.dto.SubscribersByIssueDto; | ||
//import gwangjang.server.domain.subscribe.application.service.SubscribeReadUseCase; | ||
//import org.springframework.beans.factory.annotation.Autowired; | ||
//import org.springframework.cloud.stream.messaging.Source; | ||
//import org.springframework.messaging.support.MessageBuilder; | ||
//import org.springframework.stereotype.Component; | ||
// | ||
//import java.util.List; | ||
// | ||
//@Component | ||
//public class PublishSubscribeChange { | ||
// | ||
// @Autowired | ||
// private Source source; | ||
// @Autowired | ||
// private SubscribeReadUseCase subscribeReadUseCase; | ||
// | ||
// public void publishMemberChange() { | ||
// List<SubscribeData> allIssueBySubscribers = subscribeReadUseCase.getAllIssueBySubscribers(); | ||
// | ||
// source.output().send(MessageBuilder.withPayload(allIssueBySubscribers).build()); | ||
// } | ||
//} |
53 changes: 53 additions & 0 deletions
53
...main/java/gwangjang/server/domain/subscribe/adapter/consumer/message/KeywordChannels.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//package gwangjang.server.domain.subscribe.adapter.consumer.message; | ||
//import gwangjang.server.domain.auth.application.mapper.MemberMapper; | ||
//import gwangjang.server.domain.subscribe.adapter.producer.web.dto.SubscribeData; | ||
//import gwangjang.server.domain.subscribe.adapter.producer.web.dto.SubscribersByIssueDto; | ||
//import gwangjang.server.global.feign.dto.response.MemberDto; | ||
//import gwangjang.server.domain.member.domain.entity.Member; | ||
//import gwangjang.server.domain.member.domain.service.MemberQueryService; | ||
//import lombok.RequiredArgsConstructor; | ||
//import org.springframework.context.annotation.Bean; | ||
//import org.springframework.context.annotation.Configuration; | ||
// | ||
//import java.util.List; | ||
//import java.util.function.Consumer; | ||
//import java.util.function.Function; | ||
// | ||
//@Configuration | ||
//@RequiredArgsConstructor | ||
//public class KeywordChannels { | ||
// | ||
// private final MemberQueryService memberQueryService; | ||
// private final MemberMapper memberMapper; | ||
// | ||
//// @Bean | ||
//// public Function<String, String> uppercase() { // 메시지를 받아 처리한 후 결과를 반환 | ||
//// return message -> { | ||
//// // 메시지 처리 로직 | ||
//// return message.toUpperCase(); | ||
//// }; | ||
////} | ||
// @Bean | ||
// public Consumer<List<SubscribeData>> receiveFromKeyword() { //메시지를 받아 처리하는 데 사용되지만 반환 값이 없 | ||
// return message -> { | ||
// // 메시지 처리 로직 ( 역직렬화 ) | ||
//// System.out.println("Member Received: " + message); | ||
// | ||
// | ||
// System.out.println("hihi"+message); | ||
// }; | ||
// } | ||
// | ||
//// @Bean | ||
//// public Function<String, SubscribersByIssueDto> receiveFromKeyword() { | ||
//// return memberId -> { | ||
//// // memberId를 사용하여 Member 객체를 조회 | ||
//// | ||
//// | ||
//// Member member = memberQueryService.getMemberBySocialId(memberId); | ||
//// | ||
//// return memberMapper.mapToMemberDto(member); | ||
//// | ||
//// }; | ||
//// } | ||
//} |
43 changes: 43 additions & 0 deletions
43
...ang/server/domain/subscribe/adapter/consumer/message/model/KeywordCustomDeserializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//package gwangjang.server.domain.subscribe.adapter.consumer.message.model; | ||
// | ||
//import com.fasterxml.jackson.databind.ObjectMapper; | ||
//import gwangjang.server.global.feign.dto.response.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 KeywordCustomDeserializer implements Deserializer<MemberDto> { | ||
// | ||
// private final ObjectMapper objectMapper; | ||
// | ||
// @Override | ||
// public void configure(Map<String, ?> 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(); | ||
// } | ||
//} |
2 changes: 1 addition & 1 deletion
2
...dapter/producer/client/KafkaConsumer.java → ...dapter/producer/client/KafkaConsumer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../producer/client/KafkaConsumerConfig.java → .../producer/client/KafkaConsumerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...in/java/gwangjang/server/domain/subscribe/adapter/producer/message/SubscribeChannels.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//package gwangjang.server.domain.subscribe.adapter.producer.message; | ||
//import gwangjang.server.domain.subscribe.adapter.producer.web.dto.SubscribeData; | ||
//import gwangjang.server.domain.subscribe.adapter.producer.web.dto.SubscribersByIssueDto; | ||
//import gwangjang.server.domain.subscribe.application.service.SubscribeReadUseCase; | ||
//import gwangjang.server.global.feign.dto.response.MemberDto; | ||
//import lombok.RequiredArgsConstructor; | ||
//import lombok.extern.slf4j.Slf4j; | ||
//import org.springframework.beans.factory.annotation.Autowired; | ||
//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.List; | ||
//import java.util.function.Supplier; | ||
// | ||
//@Slf4j | ||
//@Configuration | ||
//@RequiredArgsConstructor | ||
//public class SubscribeChannels { | ||
// | ||
// private final SubscribeReadUseCase subscribeReadUseCase; | ||
// | ||
// @Bean | ||
// public Supplier<Message<List<SubscribeData>>> sendToKeyword() { // 메시지를 주기적으로 생성하고 보내는 데 사용 | ||
// return () -> { | ||
// | ||
// log.info("send To Keyword !!!!"); | ||
// | ||
// | ||
// List<SubscribeData> allIssueBySubscribers = subscribeReadUseCase.getAllIssueBySubscribers(); | ||
// // 메시지 생성 로직 | ||
//// MemberDto memberInfo = new MemberDto("LOCAL-323","nickname", "https://img"); | ||
// // dto to string | ||
// return MessageBuilder.withPayload(allIssueBySubscribers).build(); | ||
// }; | ||
// } | ||
// | ||
//} |
14 changes: 14 additions & 0 deletions
14
src/main/java/gwangjang/server/domain/subscribe/adapter/producer/web/dto/MainBubbleData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package gwangjang.server.domain.subscribe.adapter.producer.web.dto; | ||
|
||
import lombok.*; | ||
|
||
@Setter | ||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class MainBubbleData { | ||
private String name; | ||
private Long value; | ||
} | ||
|
15 changes: 15 additions & 0 deletions
15
src/main/java/gwangjang/server/domain/subscribe/adapter/producer/web/dto/MainBubbleRes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package gwangjang.server.domain.subscribe.adapter.producer.web.dto; | ||
|
||
import lombok.*; | ||
|
||
import java.util.List; | ||
|
||
@Setter | ||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class MainBubbleRes { | ||
private String name; | ||
private List<MainBubbleData> data; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/gwangjang/server/domain/subscribe/adapter/producer/web/dto/SubscribeData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package gwangjang.server.domain.subscribe.adapter.producer.web.dto; | ||
|
||
import lombok.*; | ||
|
||
@Setter | ||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class SubscribeData { | ||
private Long issueId; | ||
private Long count; | ||
} |
Oops, something went wrong.