Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #89

Merged
merged 4 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 4 additions & 2 deletions api-gateway/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down

This file was deleted.

6 changes: 4 additions & 2 deletions photo-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private Mono<ResponseEntity<String>> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,9 @@ Mono<SumoneInviteCodeResponse> getInviteCode(
.findById(userId)
.map(SumoneInviteCodeResponse::fromEntity);
}

@PostMapping("/error")
Mono<String> error() {
return Mono.error(new RuntimeException("error"));
}
}
6 changes: 4 additions & 2 deletions user-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand All @@ -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())
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class MemberEntity implements Persistable<String> {
@Column("name")
private String name;

@Column("is_default_name")
private boolean isDefaultName;

@Column("serial_number")
private Integer serialNumber;

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Mono<MemberEntity> getMemberByMemberId(String memberId) {

@Transactional
public Mono<MemberEntity> 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 ->
Expand All @@ -71,6 +71,7 @@ public Mono<MemberEntity> changeName(String memberId, String name) {
.switchIfEmpty(Mono.error(new MemberNotFoundException()))
.map(member -> {
member.setName(name);
member.setDefaultName(false);
return member;
})
.flatMap(memberRepository::save);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE member
ADD is_default_name TINYINT(1) DEFAULT FALSE AFTER name;
Loading