Skip to content

Commit

Permalink
fix: SocialMediaUpdateCommand, SocialMediaCreateCommand 빌더 패턴 사용 (#938)…
Browse files Browse the repository at this point in the history
… (#939)

fix: SocialMediaUpdateCommand, SocialMediaCreateCommand 빌더 패턴 사용
  • Loading branch information
seokjin8678 authored May 6, 2024
1 parent 48ee1d7 commit ead933c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public record SocialMediaCreateV1Request(
) {

public SocialMediaCreateCommand toCommand() {
return new SocialMediaCreateCommand(
ownerId,
ownerType,
socialMediaType,
name,
logoUrl,
url
);
return SocialMediaCreateCommand.builder()
.ownerId(ownerId)
.ownerType(ownerType)
.socialMediaType(socialMediaType)
.name(name)
.logoUrl(logoUrl)
.url(url)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public record SocialMediaUpdateV1Request(
) {

public SocialMediaUpdateCommand toCommand() {
return new SocialMediaUpdateCommand(
name,
logoUrl,
url
);
return SocialMediaUpdateCommand.builder()
.name(name)
.logoUrl(logoUrl)
.url(url)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import com.festago.socialmedia.domain.OwnerType;
import com.festago.socialmedia.domain.SocialMedia;
import com.festago.socialmedia.domain.SocialMediaType;
import lombok.Builder;

@Builder
public record SocialMediaCreateCommand(
Long ownerId,
OwnerType ownerType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.festago.socialmedia.dto.command;

import lombok.Builder;

@Builder
public record SocialMediaUpdateCommand(
String name,
String url,
Expand Down

0 comments on commit ead933c

Please sign in to comment.