diff --git a/api-gateway/build.gradle.kts b/api-gateway/build.gradle.kts index e271149..e23a53f 100644 --- a/api-gateway/build.gradle.kts +++ b/api-gateway/build.gradle.kts @@ -73,8 +73,10 @@ jib { "-XX:+UnlockExperimentalVMOptions", "-XX:+UseContainerSupport", "-XX:+UseG1GC", - "-XX:InitialHeapSize=1g", - "-XX:MaxHeapSize=1g", + "-Xms1500M", + "-Xmx3G", + "-XX:MaxRAMPercentage=80", + "-XX:MaxGCPauseMillis=200", "-XX:+DisableExplicitGC", // System.gc() 방어 "-server", ) diff --git a/api-gateway/src/test/java/kr/mafoo/gateway/ApiGatewayApplicationTests.java b/api-gateway/src/test/java/kr/mafoo/gateway/ApiGatewayApplicationTests.java deleted file mode 100644 index 1eb6b90..0000000 --- a/api-gateway/src/test/java/kr/mafoo/gateway/ApiGatewayApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package kr.mafoo.gateway; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class ApiGatewayApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/photo-service/build.gradle.kts b/photo-service/build.gradle.kts index cda793e..0b5474c 100644 --- a/photo-service/build.gradle.kts +++ b/photo-service/build.gradle.kts @@ -70,8 +70,10 @@ jib { "-XX:+UnlockExperimentalVMOptions", "-XX:+UseContainerSupport", "-XX:+UseG1GC", - "-XX:InitialHeapSize=1g", - "-XX:MaxHeapSize=1g", + "-Xms1500M", + "-Xmx3G", + "-XX:MaxRAMPercentage=80", + "-XX:MaxGCPauseMillis=200", "-XX:+DisableExplicitGC", // System.gc() 방어 "-server", ) diff --git a/photo-service/src/main/java/kr/mafoo/photo/config/WebExceptionHandler.java b/photo-service/src/main/java/kr/mafoo/photo/config/WebExceptionHandler.java index 3b27e99..1a79d9d 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/config/WebExceptionHandler.java +++ b/photo-service/src/main/java/kr/mafoo/photo/config/WebExceptionHandler.java @@ -113,7 +113,7 @@ private Mono> handleExceptionInternal(ServerWebExchange e if (status == HttpStatus.INTERNAL_SERVER_ERROR) { return slackService.sendErrorNotification( requestMemberId, method, fullPath, requestBody, originIp, userAgent, exception.getMessage() - ).then(Mono.just(new ResponseEntity<>("Internal Server Error", status))); + ).then(Mono.error(exception)); } return Mono.just(new ResponseEntity<>(status.getReasonPhrase(), status)); diff --git a/photo-service/src/main/java/kr/mafoo/photo/controller/SumoneController.java b/photo-service/src/main/java/kr/mafoo/photo/controller/SumoneController.java index 21db1d6..72d33f0 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/controller/SumoneController.java +++ b/photo-service/src/main/java/kr/mafoo/photo/controller/SumoneController.java @@ -162,4 +162,9 @@ Mono getInviteCode( .findById(userId) .map(SumoneInviteCodeResponse::fromEntity); } + + @PostMapping("/error") + Mono error() { + return Mono.error(new RuntimeException("error")); + } } diff --git a/user-service/build.gradle.kts b/user-service/build.gradle.kts index caa2d23..e88d69c 100644 --- a/user-service/build.gradle.kts +++ b/user-service/build.gradle.kts @@ -88,8 +88,10 @@ jib { "-XX:+UnlockExperimentalVMOptions", "-XX:+UseContainerSupport", "-XX:+UseG1GC", - "-XX:InitialHeapSize=1g", - "-XX:MaxHeapSize=1g", + "-Xms1500M", + "-Xmx3G", + "-XX:MaxRAMPercentage=80", + "-XX:MaxGCPauseMillis=200", "-XX:+DisableExplicitGC", // System.gc() 방어 "-server", ) diff --git a/user-service/src/main/java/kr/mafoo/user/controller/dto/response/MemberResponse.java b/user-service/src/main/java/kr/mafoo/user/controller/dto/response/MemberResponse.java index 298cc88..53fa8f6 100644 --- a/user-service/src/main/java/kr/mafoo/user/controller/dto/response/MemberResponse.java +++ b/user-service/src/main/java/kr/mafoo/user/controller/dto/response/MemberResponse.java @@ -11,6 +11,9 @@ public record MemberResponse( @Schema(description = "사용자 이름", example = "송영민") String name, + @Schema(description = "닉네임 기본값 여부", example = "false") + boolean isDefaultName, + @Schema(description = "프로필 이미지 URL", example = "https://mafoo.kr/profile.jpg") String profileImageUrl, @@ -21,6 +24,7 @@ public static MemberResponse fromEntity(MemberEntity memberEntity) { return new MemberResponse( memberEntity.getId(), memberEntity.getName(), + memberEntity.isDefaultName(), memberEntity.getProfileImageUrl(), String.format("%04d", memberEntity.getSerialNumber()) ); diff --git a/user-service/src/main/java/kr/mafoo/user/domain/MemberEntity.java b/user-service/src/main/java/kr/mafoo/user/domain/MemberEntity.java index 2b82635..fb3f0aa 100644 --- a/user-service/src/main/java/kr/mafoo/user/domain/MemberEntity.java +++ b/user-service/src/main/java/kr/mafoo/user/domain/MemberEntity.java @@ -23,6 +23,9 @@ public class MemberEntity implements Persistable { @Column("name") private String name; + @Column("is_default_name") + private boolean isDefaultName; + @Column("serial_number") private Integer serialNumber; @@ -50,7 +53,7 @@ public int hashCode() { return id.hashCode(); } - public static MemberEntity newMember(String id, String name, String profileImageUrl) { + public static MemberEntity newMember(String id, String name, String profileImageUrl, boolean isDefaultName) { MemberEntity member = new MemberEntity(); member.id = id; member.name = name; diff --git a/user-service/src/main/java/kr/mafoo/user/service/MemberService.java b/user-service/src/main/java/kr/mafoo/user/service/MemberService.java index 7afa507..5c0f1ce 100644 --- a/user-service/src/main/java/kr/mafoo/user/service/MemberService.java +++ b/user-service/src/main/java/kr/mafoo/user/service/MemberService.java @@ -49,7 +49,7 @@ public Mono getMemberByMemberId(String memberId) { @Transactional public Mono createNewMember(String username, String profileImageUrl, String userAgent) { - MemberEntity memberEntity = MemberEntity.newMember(IdGenerator.generate(), username, profileImageUrl); + MemberEntity memberEntity = MemberEntity.newMember(IdGenerator.generate(), username, profileImageUrl, true); return memberRepository.save(memberEntity) .flatMap(savedMember -> @@ -71,6 +71,7 @@ public Mono changeName(String memberId, String name) { .switchIfEmpty(Mono.error(new MemberNotFoundException())) .map(member -> { member.setName(name); + member.setDefaultName(false); return member; }) .flatMap(memberRepository::save); diff --git a/user-service/src/main/resources/db/migration/V4__add_is_default_name_field.sql b/user-service/src/main/resources/db/migration/V4__add_is_default_name_field.sql new file mode 100644 index 0000000..64bff32 --- /dev/null +++ b/user-service/src/main/resources/db/migration/V4__add_is_default_name_field.sql @@ -0,0 +1,2 @@ +ALTER TABLE member + ADD is_default_name TINYINT(1) DEFAULT FALSE AFTER name;