Skip to content

Commit

Permalink
Revert "[Fix] 생성친구 request DTO 수정, 기념일 필드 생성 #36"
Browse files Browse the repository at this point in the history
This reverts commit 34f65c1.
  • Loading branch information
eunki96 committed Jun 7, 2023
1 parent 34f65c1 commit 7f7f0ac
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
8 changes: 0 additions & 8 deletions favor/src/main/java/com/favor/favor/friend/Friend.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.favor.favor.friend;


import com.favor.favor.common.enums.Favor;
import lombok.*;

import com.favor.favor.common.TimeStamped;
Expand Down Expand Up @@ -49,13 +48,6 @@ public void setFriendMemo(String friendMemo) {
@Builder.Default
@ElementCollection
private List<Integer> favorList = new ArrayList<>();
public void setFavorList(List<Favor> favorList){
ArrayList<Integer> favorTypeList = new ArrayList<>();
for(Favor favor : favorList){
favorTypeList.add(favor.getType());
}
this.favorList = favorTypeList;
}
private Boolean isUser;

private Long friendUserNo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public void updateFriend(Friend friend, FriendUpdateRequestDto friendUpdateReque

friend.setFriendName(friendUpdateRequestDto.getFriendName());
friend.setFriendMemo(friendUpdateRequestDto.getFriendMemo());
friend.setFavorList(friendUpdateRequestDto.getFavorList());
save(friend);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
public class FriendRequestDto {
@ApiModelProperty(position = 1, required = true, value = "친구이름", example = "이름")
private String friendName;

@ApiModelProperty(position = 2, required = false, value = "친구메모", example = "메모")
private String friendMemo;

@Transactional
public Friend toEntity(User user){
return Friend.builder()
.isUser(false)
.friendName(friendName)
.friendMemo("")
.friendMemo(friendMemo)
.user(user)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.favor.favor.friend.noAccount;

import com.favor.favor.common.enums.Favor;
import com.favor.favor.friend.Friend;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;
import javax.transaction.Transactional;

@Getter
@NoArgsConstructor
Expand All @@ -18,6 +18,11 @@ public class FriendUpdateRequestDto {
@ApiModelProperty(position = 2, required = false, dataType = "String", value = "친구메모", example = "메모")
private String friendMemo;

@ApiModelProperty(position = 3, required = false, dataType = "", value = "취향목록", example = "[\n\"심플한\",\n\"귀여운\"\n]")
private List<Favor> favorList;
@Transactional
public Friend toEntity(){
return Friend.builder()
.friendName(friendName)
.friendMemo(friendMemo)
.build();
}
}
1 change: 1 addition & 0 deletions favor/src/main/java/com/favor/favor/user/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import static com.favor.favor.exception.ExceptionCode.*;

Expand Down

0 comments on commit 7f7f0ac

Please sign in to comment.