Skip to content

Commit

Permalink
Revert "Revert "#28 [update]""
Browse files Browse the repository at this point in the history
This reverts commit 8a05930.
  • Loading branch information
kokoa322 committed Jul 13, 2022
1 parent 8a05930 commit ff0b570
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public void folderUpdate (@PathVariable int folderId, @RequestParam String newFo
}

/** 폴더 리스트 */
@PutMapping("/folderList/{userId}")
public List<FolderResponseDto> folderList (@PathVariable int userId){
@PostMapping("/folderList")
public List<FolderResponseDto> folderList (int userId){

return folderService.folderList(userId);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mpnp.baechelin.bookmark.domain;

import com.mpnp.baechelin.store.domain.Store;
import com.mpnp.baechelin.user.domain.User;
import com.mpnp.baechelin.util.TimeStamped;
import lombok.*;

Expand All @@ -26,4 +27,8 @@ public class Bookmark extends TimeStamped {
@JoinColumn(name="STORE_ID", nullable = false)
private Store storeId;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name="USER_ID", nullable = false)
private User userId;

}
1 change: 0 additions & 1 deletion src/main/java/com/mpnp/baechelin/store/domain/Store.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public class Store {
@OneToMany(mappedBy = "store", cascade = CascadeType.ALL, orphanRemoval = true)
private List<StoreImage> storeImageList = new ArrayList<>();


@OneToMany(mappedBy = "storeId", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Review> reviewList = new ArrayList<>();

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/mpnp/baechelin/tag/domain/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public class Tag extends TimeStamped {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
int id;
private int id;

@Column
String tag;
private String tag;
//jpa를 리스트/JSON 집어넣는 방법?

@ManyToOne(fetch = FetchType.LAZY)
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/mpnp/baechelin/user/domain/User.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mpnp.baechelin.user.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mpnp.baechelin.bookmark.domain.Bookmark;
import com.mpnp.baechelin.bookmark.domain.Folder;
import com.mpnp.baechelin.oauth.entity.ProviderType;
import com.mpnp.baechelin.oauth.entity.RoleType;
Expand Down Expand Up @@ -55,6 +56,9 @@ public class User extends TimeStamped {
@OneToMany(mappedBy = "userId", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Folder> folderList;

@OneToMany(mappedBy = "userId", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Bookmark> bookmarkList;

@OneToMany(mappedBy = "userId", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Review> reviewList;

Expand Down

0 comments on commit ff0b570

Please sign in to comment.