-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from BokDoong/member_feature
이미지 수정 및 삭제 API 설계
- Loading branch information
Showing
32 changed files
with
274 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...irytale/tale/domain/ImageFileUtility.java → ...irytale/common/util/ImageFileUtility.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/hanium/englishfairytale/member/application/MemberQueryService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...on/dto/response/CreateMemberResponse.java → ...application/dto/CreateMemberResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tion/dto/request/MemberCreateCommand.java → .../application/dto/MemberCreateCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/hanium/englishfairytale/member/domain/Image.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package hanium.englishfairytale.member.domain; | ||
|
||
import lombok.Getter; | ||
|
||
import javax.persistence.*; | ||
|
||
@Embeddable | ||
@Getter | ||
public class Image { | ||
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) | ||
@JoinColumn(name="memberImage_id") | ||
private MemberImage memberImage; | ||
|
||
void putMemberImage(MemberImage newMemberImage) { | ||
memberImage = newMemberImage; | ||
} | ||
public String getUrl() { | ||
return memberImage.getImageUrl(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/hanium/englishfairytale/member/domain/MemberImage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package hanium.englishfairytale.member.domain; | ||
|
||
import lombok.*; | ||
|
||
import javax.persistence.*; | ||
import javax.validation.constraints.NotNull; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Entity | ||
public class MemberImage { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
private long id; | ||
@NotNull | ||
@Column(name = "original_name") | ||
private String originalName; | ||
@NotNull | ||
@Column(name = "stored_name") | ||
private String storedName; | ||
@NotNull | ||
@Column(name = "image_url") | ||
private String imageUrl; | ||
|
||
public static MemberImage createMemberImage(Member member, String originalName, String storedName, String imageUrl) { | ||
MemberImage memberImage = setMemberImage(originalName, storedName, imageUrl); | ||
member.putImage(memberImage); | ||
return memberImage; | ||
} | ||
|
||
private static MemberImage setMemberImage(String originalName, String storedName, String imageUrl) { | ||
return MemberImage.builder() | ||
.originalName(originalName) | ||
.storedName(storedName) | ||
.imageUrl(imageUrl) | ||
.build(); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
src/main/java/hanium/englishfairytale/member/infra/http/MemberController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/hanium/englishfairytale/member/infra/http/MemberDtoConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...cation/dto/request/TaleCreateCommand.java → ...le/application/dto/TaleCreateCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.