Skip to content

Commit

Permalink
[MOA-505] Visible -> Visibility 로 이름 통일 (#117)
Browse files Browse the repository at this point in the history
* MOA-505: 펀딩 visible -> visibility

* MOA-505: 펀딩 메세지 visible -> visibility

* MOA-505: 참가자 상태 응답 수정

* MOA-505: flyway 변경
  • Loading branch information
shin-mallang committed Mar 2, 2024
1 parent 775785f commit 6d470ec
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private static Participant of(
Member member,
List<Friend> friends
) {
if (participant.getFundingMessage().getVisible() == PRIVATE
if (participant.getFundingMessage().getVisibility() == PRIVATE
&& !isFundingOwner(funding, member) && !isMessageOwner(participant, member)) {
return new Participant(
null,
Expand All @@ -119,7 +119,7 @@ private static Participant getParticipant(FundingParticipant participant, List<F
participant.getMember().getProfileImageUrl(),
participant.getFundingMessage().getId(),
participant.getFundingMessage().getContent(),
participant.getFundingMessage().getVisible(),
participant.getFundingMessage().getVisibility(),
participant.getCreatedDate()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public record ParticipatedFundingResponse(
Long amount,

@Schema(description = "참여 상태", example = "PARTICIPATING")
ParticipantStatus participateStatus
ParticipantStatus participantStatus
) {
public static ParticipatedFundingResponse of(FundingParticipant participant, List<Friend> friends) {
Funding funding = participant.getFunding();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public record FundingMessageUpdateRequest(
@NotBlank String message,

@Schema(example = "메시지 공개 여부")
@NotNull MessageVisibility visible
@NotNull MessageVisibility visibility
) {
public FundingMessageUpdateCommand toCommand(Long memberId, Long messageId) {
return new FundingMessageUpdateCommand(
memberId,
messageId,
message,
visible
visibility
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ public record FundingParticipateRequest(
@NotBlank String message,

@Schema(example = "메시지 공개 여부")
@NotNull MessageVisibility visible
@NotNull MessageVisibility visibility
) {
public FundingParticipateCommand toCommand(Long fundingId, Long memberId) {
return new FundingParticipateCommand(
fundingId,
memberId,
paymentOrderId,
message,
visible
visibility
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected ResponseEntity<Object> handleExceptionInternal(
log.error("예외가 발생했습니다. uri: {} {}, ", request.getMethod(), request.getRequestURI(), ex);
requestLogging(request);
return ResponseEntity.status(statusCode)
.body(new ExceptionResponse("DEFAULT", body.toString()));
.body(new ExceptionResponse("DEFAULT", ex.getMessage()));
}

private void requestLogging(HttpServletRequest request) {
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/moa/funding/domain/Funding.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class Funding extends RootEntity<Long> {

@Enumerated(STRING)
@Column(nullable = false)
private FundingVisibility visible;
private FundingVisibility visibility;

@Enumerated(STRING)
@Column(nullable = false)
Expand Down Expand Up @@ -120,7 +120,7 @@ public Funding(
String title,
String description,
LocalDate endDate,
FundingVisibility visible,
FundingVisibility visibility,
Price maximumAmount,
Member member,
Product product,
Expand All @@ -131,7 +131,7 @@ public Funding(
this.title = title;
this.description = description;
this.endDate = endDate;
this.visible = visible;
this.visibility = visibility;
this.status = PROCESSING;
this.maximumAmount = maximumAmount;
this.minimumAmount = MINIMUM_AMOUNT;
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/moa/funding/domain/FundingMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public class FundingMessage extends RootEntity<Long> {

@Enumerated(STRING)
@Column(nullable = false)
private MessageVisibility visible;
private MessageVisibility visibility;

public FundingMessage(Member sender, Member receiver, String content, MessageVisibility visible) {
public FundingMessage(Member sender, Member receiver, String content, MessageVisibility visibility) {
this.sender = sender;
this.receiver = receiver;
this.content = content;
this.visible = visible;
this.visibility = visibility;
}

public void validateSender(Member member) {
Expand All @@ -58,6 +58,6 @@ public void validateSender(Member member) {

public void update(String content, MessageVisibility visible) {
this.content = content;
this.visible = visible;
this.visibility = visible;
}
}
4 changes: 2 additions & 2 deletions core/src/main/resources/db/migration/dev/V1__init_domain.sql
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ create table product_option
create table funding
(
id bigint auto_increment primary key,
visible varchar(255) not null,
visibility varchar(255) not null,
title varchar(25) not null,
description text not null,
end_date date not null,
Expand Down Expand Up @@ -170,7 +170,7 @@ create table funding_message
member_from_id bigint not null,
member_to_id bigint not null,
content varchar(255) not null,
visible varchar(255) not null,
visibility varchar(255) not null,
created_date datetime(6) not null,
updated_date datetime(6),
constraint FK_funding_message_from_member
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ create table if not exists product_option
create table if not exists funding
(
id bigint auto_increment primary key,
visible varchar(255) not null,
visibility varchar(255) not null,
title varchar(25) not null,
description text,
end_date date not null,
Expand Down Expand Up @@ -170,7 +170,7 @@ create table if not exists funding_message
member_from_id bigint not null,
member_to_id bigint not null,
content varchar(255) not null,
visible varchar(255) not null,
visibility varchar(255) not null,
created_date datetime(6) not null,
updated_date datetime(6),
constraint FK_funding_message_from_member
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/db/migration/prod/V1__init_domain.sql
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ create table product_option
create table funding
(
id bigint auto_increment primary key,
visible varchar(255) not null,
visibility varchar(255) not null,
title varchar(25) not null,
description text not null,
end_date date not null,
Expand Down Expand Up @@ -170,7 +170,7 @@ create table funding_message
member_from_id bigint not null,
member_to_id bigint not null,
content varchar(255) not null,
visible varchar(255) not null,
visibility varchar(255) not null,
created_date datetime(6) not null,
updated_date datetime(6),
constraint FK_funding_message_from_member
Expand Down

0 comments on commit 6d470ec

Please sign in to comment.