Skip to content

Commit

Permalink
merge: 충돌 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekks committed Dec 8, 2024
2 parents 1f75c21 + 2398c9b commit 45c5db4
Show file tree
Hide file tree
Showing 45 changed files with 978 additions and 166 deletions.
10 changes: 5 additions & 5 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ version: "3.7"
services:
swagger:
labels:
caddy: localhost crew.api.dev.sopt.org
caddy: localhost

nestjs-green:
environment:
- NODE_ENV=dev
labels:
caddy: localhost crew.api.dev.sopt.org
caddy: localhost

spring-green:
environment:
- SPRING_PROFILES_ACTIVE=dev
labels:
caddy: localhost crew.api.dev.sopt.org
caddy: localhost

nestjs-blue:
environment:
- NODE_ENV=dev
labels:
caddy: localhost crew.api.dev.sopt.org
caddy: localhost

spring-blue:
environment:
- SPRING_PROFILES_ACTIVE=dev
labels:
caddy: localhost crew.api.dev.sopt.org
caddy: localhost
101 changes: 90 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ services:
caddy.log.output: stdout
caddy.log.format: json
caddy.log.include: http.log.access.localhost
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"

swagger:
image: swaggerapi/swagger-ui
Expand All @@ -42,9 +47,23 @@ services:
labels:
caddy.route: /docs*
caddy.route.reverse_proxy: "{{ upstreams 8080 }}"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"

redis:
image: redis:alpine
container_name: redis
hostname: redis
ports:
- 6379:6379
networks:
- caddy

nestjs-green:
image: makerscrew/server:latest
image: makerscrew/server:develop
container_name: nestjs-green
ports:
- 3001:3000
Expand Down Expand Up @@ -107,17 +126,28 @@ services:
caddy.route_14.reverse_proxy: "{{ upstreams 3000 }}"

spring-green:
image: makerscrew/main:latest
image: makerscrew/main:develop
environment:
- TZ=Asia/Seoul
TZ: Asia/Seoul
container_name: spring-green
ports:
- 4001:4000
- 5556:5555
restart: unless-stopped
depends_on:
- nestjs-green
- pinpoint-agent
- redis
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "100"
networks:
- caddy
volumes:
- data-volume:/pinpoint-agent

labels:
caddy.log: "localhost"
# for Swagger spec
Expand Down Expand Up @@ -152,9 +182,17 @@ services:
caddy.route_13.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_14: /auth/v2/*
caddy.route_14.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_15: /8da2d7e6-72aa-4120-9e84-8f459a2584a1/*
caddy.route_15.reverse_proxy: "{{ upstreams 5555 }}"
caddy.route_16: /internal/*
caddy.route_16.reverse_proxy: "{{ upstreams 4000 }}"

nestjs-blue:
image: makerscrew/server:latest
image: makerscrew/server:develop
container_name: nestjs-blue
ports:
- 3002:3000
restart: unless-stopped
env_file:
- ./.env
environment:
Expand All @@ -170,10 +208,11 @@ services:
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_REGION=${AWS_REGION}
- JWT_SECRET=${JWT_SECRET}
container_name: nestjs-blue
ports:
- 3002:3000
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
networks:
- caddy
labels:
Expand Down Expand Up @@ -212,17 +251,27 @@ services:
caddy.route_14.reverse_proxy: "{{ upstreams 3000 }}"

spring-blue:
image: makerscrew/main:latest
image: makerscrew/main:develop
environment:
- TZ=Asia/Seoul
TZ: Asia/Seoul
container_name: spring-blue
ports:
- 4002:4000
- 5557:5555
restart: unless-stopped
depends_on:
- nestjs-blue
- pinpoint-agent
- redis
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "100"
networks:
- caddy
volumes:
- data-volume:/pinpoint-agent
labels:
caddy.log: "localhost"
# for Swagger spec
Expand Down Expand Up @@ -257,7 +306,37 @@ services:
caddy.route_13.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_14: /auth/v2/*
caddy.route_14.reverse_proxy: "{{ upstreams 4000 }}"
caddy.route_15: /8da2d7e6-72aa-4120-9e84-8f459a2584a1/*
caddy.route_15.reverse_proxy: "{{ upstreams 5555 }}"
caddy.route_16: /internal/*
caddy.route_16.reverse_proxy: "{{ upstreams 4000 }}"

pinpoint-agent:
image: pinpointdocker/pinpoint-agent:2.5.3
container_name: pinpoint-agent
restart: always
networks:
- caddy
volumes:
- data-volume:/pinpoint-agent
environment:
- SPRING_PROFILES=release
- COLLECTOR_IP=13.125.50.135
- PROFILER_TRANSPORT_AGENT_COLLECTOR_PORT=9991
- PROFILER_TRANSPORT_METADATA_COLLECTOR_PORT=9991
- PROFILER_TRANSPORT_STAT_COLLECTOR_PORT=9992
- PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT=9993
- PROFILER_SAMPLING_TYPE=COUNTING
- PROFILER_SAMPLING_COUNTING_SAMPLING_RATE=1
- PROFILER_SAMPLING_PERCENT_SAMPLING_RATE=100
- PROFILER_SAMPLING_NEW_THROUGHPUT=0
- PROFILER_SAMPLING_CONTINUE_THROUGHPUT=0
- DEBUG_LEVEL=INFO
- PROFILER_TRANSPORT_MODULE=GRPC

volumes:
data-volume:

networks:
caddy:
external: true
external: true
55 changes: 33 additions & 22 deletions main/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,72 +23,83 @@ repositories {
}

dependencies {
// Spring Boot Dependencies
implementation 'org.springframework.boot:spring-boot-starter-web'
// https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-ui
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
implementation 'org.springframework.boot:spring-boot-starter-webflux:3.1.5'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'

// lombok
// Lombok Dependencies (Compile-time code generation library)
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

// Development Tools
developmentOnly 'org.springframework.boot:spring-boot-devtools'

// Test Dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.testcontainers:testcontainers:1.17.3'
testImplementation 'org.testcontainers:junit-jupiter:1.16.2'
testImplementation 'org.testcontainers:postgresql:1.17.3'
testImplementation 'org.testcontainers:jdbc'

// Apache Commons Dependencies
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0'

// AOP (Aspect-Oriented Programming) for cross-cutting concerns
implementation 'org.springframework.boot:spring-boot-starter-aop'

// Database and Persistence Dependencies
implementation group: 'org.postgresql', name: 'postgresql', version: '42.6.0'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.postgresql:postgresql:42.3.0'

// jsonb 타입 핸들링 위함
// jsonb Type Handling
implementation 'io.hypersistence:hypersistence-utils-hibernate-62:3.6.0'

// JWT Dependencies for Security and Authentication
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5'
implementation group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5'
implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5'
implementation 'com.auth0:java-jwt:4.4.0'

// h2
// H2 Database (for testing and in-memory DB)
runtimeOnly 'com.h2database:h2'

// mac m1 setting
// macOS M1 Support (Network Resolver for macOS)
implementation 'io.netty:netty-resolver-dns-native-macos:4.1.68.Final:osx-aarch_64'

// Spring Cloud OpenFeign (Service-to-service communication)
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:4.0.3'

// test container
testImplementation 'org.testcontainers:testcontainers:1.17.3' // TC 의존성
testImplementation 'org.testcontainers:junit-jupiter:1.16.2' // TC 의존성
testImplementation 'org.testcontainers:postgresql:1.17.3' // PostgreSQL 컨테이너 사용
testImplementation 'org.testcontainers:jdbc' // DB와의 JDBC connection
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0'

// aop
implementation 'org.springframework.boot:spring-boot-starter-aop'

// MapStruct
// MapStruct (DTO transformation code generation)
implementation 'org.mapstruct:mapstruct:1.5.3.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.3.Final'

// queryDsl
// QueryDSL (JPA Query Generation)
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"

// AWS SDK for S3
// AWS SDK for S3 (for file upload and download)
implementation "software.amazon.awssdk:s3:2.27.0"

// csv 관련
// CSV Processing Library
implementation 'com.opencsv:opencsv:5.5.2'

// prometheus
// Prometheus (Monitoring and Metrics Collection)
implementation 'io.micrometer:micrometer-registry-prometheus'

// Sentry Logback (Error Tracking)
implementation 'io.sentry:sentry-logback:7.17.0'

// Slack Webhook
implementation 'com.github.maricn:logback-slack-appender:1.4.0'

// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-cache'
Expand Down Expand Up @@ -164,4 +175,4 @@ jacocoTestCoverageVerification {
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.sopt.makers.crew.main.comment.v2.service;

import static org.sopt.makers.crew.main.internal.notification.PushNotificationEnums.NEW_COMMENT_MENTION_PUSH_NOTIFICATION_TITLE;
import static org.sopt.makers.crew.main.internal.notification.PushNotificationEnums.NEW_COMMENT_PUSH_NOTIFICATION_TITLE;
import static org.sopt.makers.crew.main.internal.notification.PushNotificationEnums.PUSH_NOTIFICATION_CATEGORY;
import static org.sopt.makers.crew.main.external.notification.PushNotificationEnums.NEW_COMMENT_MENTION_PUSH_NOTIFICATION_TITLE;
import static org.sopt.makers.crew.main.external.notification.PushNotificationEnums.NEW_COMMENT_PUSH_NOTIFICATION_TITLE;
import static org.sopt.makers.crew.main.external.notification.PushNotificationEnums.PUSH_NOTIFICATION_CATEGORY;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -42,8 +42,8 @@
import org.sopt.makers.crew.main.entity.user.User;
import org.sopt.makers.crew.main.entity.user.UserRepository;
import org.sopt.makers.crew.main.external.playground.service.MemberBlockService;
import org.sopt.makers.crew.main.internal.notification.PushNotificationService;
import org.sopt.makers.crew.main.internal.notification.dto.PushNotificationRequestDto;
import org.sopt.makers.crew.main.external.notification.PushNotificationService;
import org.sopt.makers.crew.main.external.notification.dto.PushNotificationRequestDto;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down Expand Up @@ -174,7 +174,11 @@ public CommentV2GetCommentsResponseDto getComments(Integer postId, Integer page,
User user = userRepository.findByIdOrThrow(userId);
Long orgId = user.getOrgId().longValue();

Map<Long, Boolean> blockedUsers = memberBlockService.getBlockedUsers(orgId);
List<Long> userOrgIds = comments.stream()
.map(comment -> comment.getUser().getOrgId().longValue())
.toList();

Map<Long, Boolean> blockedUsers = memberBlockService.getBlockedUsers(orgId, userOrgIds);

MyLikes myLikes = new MyLikes(likeRepository.findAllByUserIdAndCommentIdNotNull(userId));

Expand Down
Loading

0 comments on commit 45c5db4

Please sign in to comment.