Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ dependencies {

implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// kafka 추가
implementation 'org.springframework.kafka:spring-kafka'
}

tasks.named('test') {
Expand Down
151 changes: 99 additions & 52 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,101 @@
services:
redis:
image: redis:7-alpine
container_name: redis
ports:
- "6379:6379"
restart: unless-stopped
mem_limit: 128m
command: redis-server --appendonly yes
volumes:
- redis_data:/data
# 블루 배포
app-blue:
image: ddhi7/ccapp:latest #이미지는 동일 이미지 사용 : (깃허브 플젝 -> ccapp 이미지)
container_name: ccapp-blue
ports:
- "8081:8080"
env_file:
- .env
restart: unless-stopped
pull_policy: always
mem_limit: 400m
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/actuator/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
depends_on:
- redis
services:
redis:
image: redis:7-alpine
container_name: redis
ports:
- "6379:6379"
restart: unless-stopped
mem_limit: 128m
command: redis-server --appendonly yes
volumes:
- redis_data:/data
# 블루 배포
app-blue:
image: ddhi7/ccapp:latest #이미지는 동일 이미지 사용 : (깃허브 플젝 -> ccapp 이미지)
container_name: ccapp-blue
ports:
- "8081:8080"
env_file:
- .env
restart: unless-stopped
pull_policy: always
mem_limit: 400m
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/actuator/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
depends_on:
- redis
- kafka #추가

Comment on lines +29 to 32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, find and display the docker-compose.yml file
find . -name "docker-compose.yml" -type f 2>/dev/null | head -20

Repository: SeeATheater/CC_Backend

Length of output: 188


🏁 Script executed:

#!/bin/bash
# Let's look at the docker-compose.yml content
find . -name "docker-compose.yml" -type f -exec wc -l {} \; 2>/dev/null

Repository: SeeATheater/CC_Backend

Length of output: 123


🏁 Script executed:

#!/bin/bash
# Read the docker-compose.yml file to see full structure
find . -name "docker-compose.yml" -type f -exec cat -n {} \; 2>/dev/null

Repository: SeeATheater/CC_Backend

Length of output: 5816


Add readiness gating for Kafka and define Kafka healthcheck.

depends_on only enforces start order, not readiness. Without a Kafka healthcheck, the suggested condition: service_healthy cannot work. The Kafka service (lines 55–83) lacks a healthcheck entirely, and app-blue/app-green (lines 29–32, 50–52) depend on Kafka without gating on readiness. This risks startup failures if the app attempts connections before Kafka is ready.

Define a Kafka healthcheck first, then gate the app services on it:

✅ Suggested adjustment

Add to Kafka service:

      kafka:
        image: confluentinc/cp-kafka:latest
        container_name: kafka
        ports:
          - "9092:9092"
          - "29092:29092"
        environment:
          ...
+       healthcheck:
+         test: ["CMD-SHELL", "kafka-broker-api-versions.sh --bootstrap-server=localhost:9092 || exit 1"]
+         interval: 10s
+         timeout: 5s
+         retries: 5
+         start_period: 30s
        volumes:
          - kafka_data:/var/lib/kafka/data
        restart: unless-stopped

Then update app services:

      depends_on:
-       - redis
-       - kafka  `#추가`
+       redis:
+         condition: service_started
+       kafka:
+         condition: service_healthy

Apply to both app-blue and app-green.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
depends_on:
- redis
- kafka #추가
depends_on:
redis:
condition: service_started
kafka:
condition: service_healthy
🤖 Prompt for AI Agents
In `@docker-compose.yml` around lines 29 - 32, The docker-compose uses depends_on
for kafka but no Kafka healthcheck exists and app-blue/app-green should wait for
Kafka readiness; add a healthcheck to the kafka service (e.g., using kafka-ready
check command or curl/kcat against broker/port and appropriate
interval/retries/start_period) and then change the app-blue and app-green
depends_on entries to reference kafka with condition: service_healthy so they
only start after the kafka healthcheck passes; update both app services to gate
on kafka's service_healthy and ensure the healthcheck command and timings are
appropriate for your Kafka startup.

app-green:
#그린 배포
image: ddhi7/ccapp:latest
container_name: ccapp-green
ports:
- "8082:8080"
env_file:
- .env
restart: unless-stopped
pull_policy: always
mem_limit: 400m
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/actuator/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
depends_on:
- redis
app-green:
#그린 배포
image: ddhi7/ccapp:latest
container_name: ccapp-green
ports:
- "8082:8080"
env_file:
- .env
restart: unless-stopped
pull_policy: always
mem_limit: 400m
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/actuator/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
depends_on:
- redis
- kafka #추가

volumes:
redis_data:
driver: local

kafka:
image: confluentinc/cp-kafka:latest
container_name: kafka
ports:
- "9092:9092" # 도커 내부 통신용
- "29092:29092" # 로컬호스트 접속용
environment:
# 필수 KRaft 설정
CLUSTER_ID: "hjeeg3q1SoCw7IKoRw-rMQ"
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: "broker,controller" # 브로커와 컨트롤러 역할
KAFKA_CONTROLLER_QUORUM_VOTERS: "1@kafka:9093" # 컨트롤러 지정

# 리스너 설정 (CONTROLLER 추가 필수)
KAFKA_LISTENERS: 'PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093,PLAINTEXT_HOST://0.0.0.0:29092'
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'

# Mac(ARM) 호환 설정 및 성능 최적화
_JAVA_OPTIONS: "-XX:UseSVE=0"
KAFKA_HEAP_OPTS: "-Xms256M -Xmx256M" # JVM 힙 메모리
Comment on lines +73 to +75
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, locate and examine the docker-compose.yml file
find . -name "docker-compose.yml" -type f

Repository: SeeATheater/CC_Backend

Length of output: 116


🏁 Script executed:

# Also check the repository structure
git ls-files | head -20

Repository: SeeATheater/CC_Backend

Length of output: 545


🌐 Web query:

-XX:UseSVE=0 AArch64 Java JVM x86_64 compatibility

💡 Result:

Short answer

  • -XX:UseSVE= on AArch64 controls the JVM’s vector code generation target (0 = NEON, 1 = SVE, 2 = SVE2) — it tells the JIT which instruction set to emit. [1]
  • Historically the flag only affected the JVM code generator, not the JVM’s reported CPU feature bit ("sve"), so disabling SVE with -XX:UseSVE=0 did NOT clear the “sve” cpu-feature in the VM. That mismatch has caused tests and IR checks to behave oddly. [2][3]
  • On x86 the comparable flags (UseAVX/UseSSE) have been used to mask feature reporting for the VM; OpenJDK work has been done to make AArch64 behavior consistent. If you need a quick workaround on a system where SVE causes failures, passing -XX:UseSVE=0 (or exporting JAVA_TOOL_OPTIONS) is commonly used. [4][2][3]

References
[1] Arm community blog — Java Vector API on AArch64 (explains UseSVE values and default behavior).
[2] OpenJDK hotspot-compiler-dev discussion / RFR about tests failing when UseSVE=0 (explains CPU-feature vs VM-flag mismatch).
[3] OpenJDK bug JDK-8311130 (issue and resolution to sync UseSVE with reported CPU features).
[4] User reports (e.g., Ubuntu/Reddit) showing -XX:UseSVE=0 as a practical workaround.

If you want, I can: check which JDK release on your machine contains the OpenJDK fix, or show the exact command to set JAVA_TOOL_OPTIONS permanently.


🏁 Script executed:

# Read the docker-compose.yml file to see the context
cat -n docker-compose.yml | head -80

Repository: SeeATheater/CC_Backend

Length of output: 3006


🏁 Script executed:

# Check for existing override files and .env files
ls -la | grep -E "docker-compose|\.env"

Repository: SeeATheater/CC_Backend

Length of output: 133


🏁 Script executed:

# Search for .env files throughout the repo
find . -name ".env*" -o -name "docker-compose.override.yml"

Repository: SeeATheater/CC_Backend

Length of output: 48


🏁 Script executed:

# Check if Dockerfile or build config specifies JDK version to understand if OpenJDK fix is in use
cat Dockerfile | head -30

Repository: SeeATheater/CC_Backend

Length of output: 264


🏁 Script executed:

# Verify the exact context: does x86_64 ignore or reject the flag?
# Check any documentation or comments about Kafka setup
grep -r "UseSVE\|architecture\|ARM\|x86" . --include="*.md" --include="*.txt" 2>/dev/null

Repository: SeeATheater/CC_Backend

Length of output: 48


Move _JAVA_OPTIONS=-XX:UseSVE=0 to an ARM-specific environment configuration.

-XX:UseSVE=0 is AArch64-specific and controls SVE vector code generation. While the flag is likely ignored on x86_64, hardcoding it globally prevents portable deployment across architectures. Gate this setting per-environment (e.g., .env or docker-compose.override.yml) so it applies only on ARM.

The suggested approach follows the pattern already used by the app services:

Example approach
-        _JAVA_OPTIONS: "-XX:UseSVE=0"
+        _JAVA_OPTIONS: "${KAFKA_JAVA_OPTIONS:-}"

Then set KAFKA_JAVA_OPTIONS=-XX:UseSVE=0 only in an ARM-specific .env or override file.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Mac(ARM) 호환 설정 및 성능 최적화
_JAVA_OPTIONS: "-XX:UseSVE=0"
KAFKA_HEAP_OPTS: "-Xms256M -Xmx256M" # JVM 힙 메모리
# Mac(ARM) 호환 설정 및 성능 최적화
_JAVA_OPTIONS: "${KAFKA_JAVA_OPTIONS:-}"
KAFKA_HEAP_OPTS: "-Xms256M -Xmx256M" # JVM 힙 메모리
🤖 Prompt for AI Agents
In `@docker-compose.yml` around lines 73 - 75, Remove the hardcoded _JAVA_OPTIONS:
"-XX:UseSVE=0" from the shared docker-compose.yml and instead add that JVM flag
only in an ARM-specific environment file or override (e.g.,
docker-compose.override.yml or a .env.arm) so it applies only on AArch64 hosts;
use a service-specific variable name such as KAFKA_JAVA_OPTIONS (matching
existing pattern) and document/load that ARM-only env file in the ARM deployment
workflow.

KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
volumes:
- kafka_data:/var/lib/kafka/data # <- Docker 내부 볼륨만 사용
restart: unless-stopped

kafka-ui:
image: provectuslabs/kafka-ui:latest
container_name: kafka-ui
ports:
- "8085:8080" # 호스트 8085로 접속 가능
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
KAFKA_CLUSTERS_0_ZOOKEEPER: "" # KRaft 모드라 Zookeeper 필요 없음
depends_on:
- kafka
restart: unless-stopped

volumes:
redis_data:
driver: local
kafka_data:
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
package cc.backend.admin.amateurShow.service;

import cc.backend.admin.amateurShow.dto.AdminAmateurShowListResponseDTO;
import cc.backend.admin.amateurShow.dto.AdminAmateurShowRejectRequestDTO;
import cc.backend.admin.amateurShow.dto.AdminAmateurShowReviseRequestDTO;
import cc.backend.admin.amateurShow.dto.AdminAmateurShowSummaryResponseDTO;
import cc.backend.amateurShow.entity.AmateurShow;
import cc.backend.amateurShow.repository.AmateurShowRepository;
import cc.backend.apiPayLoad.ApiResponse;
import cc.backend.apiPayLoad.SliceResponse;
import cc.backend.apiPayLoad.code.status.ErrorStatus;
import cc.backend.apiPayLoad.exception.GeneralException;
import cc.backend.event.entity.ApproveShowEvent;
import cc.backend.event.entity.NewShowEvent;
import cc.backend.event.entity.RejectShowEvent;
import cc.backend.member.entity.Member;
import lombok.RequiredArgsConstructor;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.domain.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

import static io.micrometer.common.util.StringUtils.isNotBlank;

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import cc.backend.amateurShow.repository.AmateurShowRepository;
import cc.backend.apiPayLoad.code.status.ErrorStatus;
import cc.backend.apiPayLoad.exception.GeneralException;
import cc.backend.event.entity.ApproveShowEvent;
import cc.backend.event.entity.RejectShowEvent;
import cc.backend.member.entity.Member;
import cc.backend.notice.event.ApproveCommitEvent;
import cc.backend.notice.event.RejectCommitEvent;
import lombok.RequiredArgsConstructor;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.domain.*;
Expand All @@ -33,8 +33,13 @@ public AdminAmateurShowSummaryResponseDTO approveShow(Long showId) {

show.approve();

Member member = show.getMember();
eventPublisher.publishEvent(new ApproveShowEvent(show, member)); //공연등록 승인 이벤트 생성
Member performer = show.getMember();

// 등록 승인 트랜잭션 커밋에 대해 이벤트 발행
eventPublisher.publishEvent(
new ApproveCommitEvent(show.getId(), performer.getId()
)
);

return AdminAmateurShowSummaryResponseDTO.from(show);
}
Expand All @@ -47,7 +52,12 @@ public AdminAmateurShowSummaryResponseDTO rejectShow(Long showId, AdminAmateurSh
show.reject(dto.getRejectReason());

Member member = show.getMember();
eventPublisher.publishEvent(new RejectShowEvent(show, member)); //공연등록 반려 이벤트 생성

// 등록 거부 커밋 트랜잭션 이벤트 발행
eventPublisher.publishEvent(
new RejectCommitEvent(show.getId(), member.getId(), show.getRejectReason()
)
);

return AdminAmateurShowSummaryResponseDTO.from(show);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,5 @@ public void reject(String rejectReason){
this.rejectReason = rejectReason;

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,7 @@ List<AmateurShow> findHotShows(
@Query("UPDATE AmateurShow s SET s.status = 'ENDED' " +
"WHERE s.status = 'ONGOING' AND s.end < :today")
int updateShowsToEnded(@Param("today") LocalDate today);

@Query("SELECT s.hashtag FROM AmateurShow s WHERE s.member.id = :memberId")
List<String> findHashtagsByMemberId(@Param("memberId") Long memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,28 @@
import cc.backend.amateurShow.dto.AmateurShowResponseDTO;
import cc.backend.amateurShow.dto.AmateurUpdateRequestDTO;
import cc.backend.amateurShow.entity.*;
import cc.backend.amateurShow.entity.enums.ApprovalStatus;
import cc.backend.amateurShow.repository.*;
import cc.backend.amateurShow.converter.AmateurConverter;
import cc.backend.amateurShow.dto.AmateurEnrollRequestDTO;
import cc.backend.amateurShow.dto.AmateurEnrollResponseDTO;
import cc.backend.amateurShow.repository.specification.AmateurShowSpecification;
import cc.backend.apiPayLoad.code.status.ErrorStatus;
import cc.backend.apiPayLoad.exception.GeneralException;
import cc.backend.board.entity.enums.BoardType;
import cc.backend.event.entity.NewShowEvent;
import cc.backend.image.DTO.ImageRequestDTO;
import cc.backend.image.DTO.ImageResponseDTO;
import cc.backend.image.FilePath;
import cc.backend.image.entity.Image;
import cc.backend.image.repository.ImageRepository;
import cc.backend.image.service.ImageService;
import cc.backend.member.entity.Member;
import cc.backend.member.enumerate.Role;
import cc.backend.member.repository.MemberRepository;
import cc.backend.memberLike.entity.MemberLike;
import cc.backend.memberLike.repository.MemberLikeRepository;
import cc.backend.ticket.dto.response.ReserveListResponseDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.*;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.text.Collator;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;

Expand All @@ -51,10 +40,8 @@ public class AmateurServiceImpl implements AmateurService {
private final AmateurTicketRepository amateurTicketRepository;
private final AmateurStaffRepository amateurStaffRepository;
private final AmateurRoundsRepository amateurRoundsRepository;
private final MemberLikeRepository memberLikeRepository;
private final ImageService imageService;
private final ImageRepository imageRepository;
private final ApplicationEventPublisher eventPublisher; //이벤트 생성

// 소극장 공연 등록
@Transactional
Expand Down Expand Up @@ -92,18 +79,6 @@ public AmateurEnrollResponseDTO.AmateurEnrollResult enrollShow(Long memberId,

imageService.saveImageWithImageUrl(memberId, fullImageRequestDTO, Optional.ofNullable(dto.getImageUrl()));


// 좋아요한 멤버리스트
List<MemberLike> memberLikers = memberLikeRepository.findByPerformerId(memberId);
// 좋아요한 멤버가 한 명 이상일 때만
if(!memberLikers.isEmpty()) {
List<Member> likers = memberLikers.stream()
.map(MemberLike::getLiker)
.collect(Collectors.toList());

eventPublisher.publishEvent(new NewShowEvent(newAmateurShow.getId(), memberId, likers)); //공연등록 이벤트 생성
}

// response
return AmateurConverter.toAmateurEnrollDTO(newAmateurShow);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public enum ErrorStatus implements BaseErrorCode {
AMATEUR_TICKET_NOT_FOUND(HttpStatus.NOT_FOUND, "AMATEURTICKET4000", "존재하지 않는 소극장 공연 티켓입니다."),
AMATEUR_TICKET_STOCK(HttpStatus.BAD_REQUEST, "AMATEURTICKET4001", "주문 수량은 최소 1개 이상이어야 합니다."),
AMATEUR_SHOW_MISMATCH(HttpStatus.NOT_FOUND, "AMATEURTICKET4002", "회차와 티켓에 해당하는 공연이 일치하지 않습니다."),

// PHOTOALBUM ERROR
PHOTOALBUM_NOT_FOUND(HttpStatus.NOT_FOUND, "PHOTOALBUM4000", "존재하지 않는 사진첩입니다."),

Expand All @@ -108,6 +109,7 @@ public enum ErrorStatus implements BaseErrorCode {

//NOTICE ERROR
MEMBERNOTICE_NOT_FOUND(HttpStatus.NOT_FOUND, "MEMBERNOTICE4001", "존재하지 않는 알림입니다."),
NOTICE_NOT_FOUND(HttpStatus.NOT_FOUND, "NOTICE4001", "존재하지 않는 알림입니다."),
Comment on lines 110 to +112
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n src/main/java/cc/backend/apiPayLoad/code/status/ErrorStatus.java | sed -n '100,120p'

Repository: SeeATheater/CC_Backend

Length of output: 1396


🏁 Script executed:

# Search for usages of these constants
rg "MEMBERNOTICE_NOT_FOUND|NOTICE_NOT_FOUND" -B 2 -A 2

Repository: SeeATheater/CC_Backend

Length of output: 1303


🏁 Script executed:

# Check for any comments or documentation about notice vs membernotice
rg -i "notice" src/main/java/cc/backend/apiPayLoad/code/status/ErrorStatus.java -B 1 -A 1 | head -50

Repository: SeeATheater/CC_Backend

Length of output: 270


🏁 Script executed:

# Search for all usages of NOTICE_NOT_FOUND more broadly
rg "NOTICE_NOT_FOUND" -r "Found in: $FILE"

Repository: SeeATheater/CC_Backend

Length of output: 498


🏁 Script executed:

# Check for Notice service/repository files
fd -t f "Notice" src/main/java --type f

Repository: SeeATheater/CC_Backend

Length of output: 953


🏁 Script executed:

# Look at the structure to find notice-related classes
fd -t d "notice" src/main/java

Repository: SeeATheater/CC_Backend

Length of output: 98


🏁 Script executed:

# Check NoticeService for how it handles not found cases
cat -n src/main/java/cc/backend/notice/service/NoticeService.java

Repository: SeeATheater/CC_Backend

Length of output: 933


🏁 Script executed:

# Check NoticeServiceImpl for how it handles not found cases
cat -n src/main/java/cc/backend/notice/service/NoticeServiceImpl.java

Repository: SeeATheater/CC_Backend

Length of output: 12662


🏁 Script executed:

# Check if there's a controller that might retrieve Notice directly
rg "noticeRepository\.findById|getNotice|Notice.*not.*found" -i -A 2 -B 2

Repository: SeeATheater/CC_Backend

Length of output: 10769


🏁 Script executed:

# Check MemberNoticeController to understand the API patterns
head -100 src/main/java/cc/backend/notice/controller/MemberNoticeController.java

Repository: SeeATheater/CC_Backend

Length of output: 2516


Remove unused NOTICE_NOT_FOUND error status.

NOTICE_NOT_FOUND is defined in ErrorStatus but never used anywhere in the codebase. Only MEMBERNOTICE_NOT_FOUND is actually used (in MemberNoticeService). The Notice entity is created through internal event handling in NoticeServiceImpl and is only accessed via MemberNotice relationships. Remove the unused constant or clarify if it should be used in a future feature.

🤖 Prompt for AI Agents
In `@src/main/java/cc/backend/apiPayLoad/code/status/ErrorStatus.java` around
lines 110 - 112, The enum constant NOTICE_NOT_FOUND in ErrorStatus is unused;
remove NOTICE_NOT_FOUND from ErrorStatus (leaving MEMBERNOTICE_NOT_FOUND intact)
unless you intend to use it later—if you do intend to keep it, update usages in
MemberNoticeService or NoticeServiceImpl to reference NOTICE_NOT_FOUND instead
of MEMBERNOTICE_NOT_FOUND; otherwise simply delete the NOTICE_NOT_FOUND enum
entry to eliminate dead code and redundant error codes.

// INQUIRY ERROR
INQUIRY_NOT_FOUND(HttpStatus.NOT_FOUND, "INQUIRY4000", "존재하지 않는 문의글입니다."),
FORBIDDEN_INQUIRY_ACCESS(HttpStatus.NOT_FOUND, "INQUIRY4001", "로그인한 멤버가 작성하지 않는 문의글입니다."),
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/cc/backend/board/service/BoardService.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
import cc.backend.board.entity.enums.BoardType;
import cc.backend.board.repository.BoardLikeRepository;
import cc.backend.board.repository.HotBoardRepository;
import cc.backend.event.entity.PromoteHotEvent;
import cc.backend.kafka.event.commentEvent.CommentProducer;
import cc.backend.kafka.event.hotBoardEvent.HotBoardEvent;
import cc.backend.image.DTO.ImageRequestDTO;
import cc.backend.image.DTO.ImageResponseDTO;
import cc.backend.image.FilePath;
import cc.backend.image.entity.Image;
import cc.backend.image.repository.ImageRepository;
import cc.backend.image.service.ImageService;
import cc.backend.kafka.event.hotBoardEvent.HotBoardProducer;
import cc.backend.kafka.event.replyEvent.ReplyProducer;
import cc.backend.member.entity.Member;
import cc.backend.board.repository.BoardRepository;
import cc.backend.member.enumerate.Role;
Expand Down Expand Up @@ -48,7 +51,7 @@ public class BoardService {
private final ImageService imageService;
private final ImageRepository imageRepository;

private final ApplicationEventPublisher eventPublisher;
private final HotBoardProducer hotBoardProducer;

// 게시글 작성
@Transactional
Expand Down Expand Up @@ -361,7 +364,8 @@ private void promoteToHotBoard(Board board) {
.build();
hotBoardRepository.save(hotBoard);

eventPublisher.publishEvent(new PromoteHotEvent(board.getId(), board.getMember().getId())); //핫게 이벤트 생성
//핫게 알림용 카프카 이벤트 생성
hotBoardProducer.publish(new HotBoardEvent(board.getId(), board.getMember().getId()));
}
}

Expand Down
Loading