Skip to content

Commit

Permalink
[fix] 내 채소의 veggieInfoId String으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
MinchoGreenT committed May 26, 2024
1 parent 6cd696c commit 078e6d0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public class MyVeggieGardenController {
@PostMapping(value = "")
public BaseResponseDto<Void> settingMyVeggie(
@AuthenticationPrincipal CustomUser user,
@Validated @RequestBody SettingMyVeggieRequest settingMyVeggi
@Validated @RequestBody SettingMyVeggieRequest settingMyVeggie
){
return myVeggieGardenService.settingMyVeggie(
user.getUserId(),
settingMyVeggi
settingMyVeggie
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public class SettingMyVeggieRequest {
private String nickname;

@NotNull(message = "null 값을 가지면 안됩니다.")
private Date birh;
private Date birth;

@NotNull(message = "null 값을 가지면 안됩니다.")
private Long veggiInfoId;
private String veggieInfoId;

@NotNull(message = "null 값을 가지면 안됩니다.")
private String veggieName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class SelectMyVeggieListDto {

public static List<SelectMyVeggieListResponse> processData(List<MyVeggie> myVeggieList){
return myVeggieList.stream()
.map(myVeggie -> SelectMyVeggieListResponse.of(myVeggie.getVeggieInfoId(),myVeggie.getNickname()))
.map(myVeggie -> SelectMyVeggieListResponse.of(myVeggie.getId(),myVeggie.getNickname()))
.toList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class MyVeggie extends BaseEntity {
private Date birth;

@Column(name = "veggie_info_id")
private Long veggieInfoId;
private String veggieInfoId;

@Column(name = "veggie_name")
private String veggieName;
Expand All @@ -58,7 +58,7 @@ public class MyVeggie extends BaseEntity {
@JoinColumn(name = "user_farm_club_id")
private UserFarmClub userFarmClub;

public static MyVeggie createMyVegetable(String nickname, Date birth, Long veggieInfoId,
public static MyVeggie createMyVegetable(String nickname, Date birth, String veggieInfoId,
String veggieName,
String veggieImage,
User user){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ public MyVeggie getMyVeggie(Long userId){
.orElseThrow(() -> new IllegalArgumentException("채소가 존재하지 않습니다."));
}

private void addMyyVeggie(Long userId, SettingMyVeggieRequest settingMyVeggiRequest){
private void addMyyVeggie(Long userId, SettingMyVeggieRequest settingMyVeggieRequest){

MyVeggie newMyVeggie = MyVeggie.createMyVegetable(
settingMyVeggiRequest.getNickname(),
settingMyVeggiRequest.getBirh(),
settingMyVeggiRequest.getVeggiInfoId(),
settingMyVeggiRequest.getVeggieName(),
settingMyVeggiRequest.getVeggieImage(),
settingMyVeggieRequest.getNickname(),
settingMyVeggieRequest.getBirth(),
settingMyVeggieRequest.getVeggieInfoId(),
settingMyVeggieRequest.getVeggieName(),
settingMyVeggieRequest.getVeggieImage(),
User.builder().id(userId).build()
);
myVeggieRepository.save(newMyVeggie);
Expand Down

0 comments on commit 078e6d0

Please sign in to comment.