Skip to content

Commit

Permalink
Merge pull request #28 from kusitms-28th-Meetup-E/feat/bubble
Browse files Browse the repository at this point in the history
Feat/bubble
  • Loading branch information
seungueonn authored Nov 23, 2023
2 parents 62e0be0 + 79c2538 commit a709dc8
Show file tree
Hide file tree
Showing 24 changed files with 308 additions and 122 deletions.
16 changes: 16 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.0.11'
id 'io.spring.dependency-management' version '1.1.3'

}

group = 'gwangjang'
Expand Down Expand Up @@ -100,3 +101,18 @@ bootJar{
archiveVersion = "0.0.1"
}

// === Querydsl 빌드 옵션 (선택사항) ===

def querydslDir = "src/main/generated/querydsl"

sourceSets {
main.java.srcDirs += [ querydslDir ]
}

tasks.withType(JavaCompile) {
options.annotationProcessorGeneratedSourcesDirectory = file(querydslDir)
}

clean.doLast {
file(querydslDir).deleteDir()
}
2 changes: 2 additions & 0 deletions src/main/java/gwangjang/server/MemberServiceApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.web.bind.annotation.CrossOrigin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public Member createLocalMember(LocalSignUpRequest localSignUpRequest) {
.gender(localSignUpRequest.getGender())
.loginId(localSignUpRequest.getId())
.loginPw(localSignUpRequest.getPw())
.profileImage("https://gwang-jang.s3.ap-northeast-2.amazonaws.com/%EA%B8%B0%EB%B3%B8%ED%94%84%EB%A1%9C%ED%95%84.png")
.build();
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import com.querydsl.jpa.impl.JPAQueryFactory;
import jakarta.persistence.EntityManager;

import static gwangjang.server.domain.member.domain.entity.QMember.member;
import gwangjang.server.domain.member.domain.entity.QMember;

import static gwangjang.server.domain.member.domain.entity.QMember.member;

public class MemberCustomRepositoryImpl implements MemberCustomRepository {

Expand Down
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());
// }
//}
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);
////
//// };
//// }
//}
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();
// }
//}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gwangjang.server.domain.member.adapter.producer.client;//package gwangjang.server.domain.adapter.out.client;
package gwangjang.server.domain.subscribe.adapter.producer.client;//package gwangjang.server.domain.adapter.out.client;
//
//import gwangjang.server.domain.domain.repository.CommunityRepository;
//import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gwangjang.server.domain.member.adapter.producer.client;//package gwangjang.server.domain.adapter.out.client;
package gwangjang.server.domain.subscribe.adapter.producer.client;//package gwangjang.server.domain.adapter.out.client;
//
//
//import org.apache.kafka.clients.consumer.ConsumerConfig;
Expand Down
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();
// };
// }
//
//}
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;
}

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;
}
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;
}
Loading

0 comments on commit a709dc8

Please sign in to comment.