diff --git a/data.mv.db b/data.mv.db index 5afe7b2..63eda8d 100644 Binary files a/data.mv.db and b/data.mv.db differ diff --git a/demo/src/main/java/com/example/demo/groups/api/GroupController.java b/demo/src/main/java/com/example/demo/groups/api/GroupController.java index 7954f51..643aa75 100644 --- a/demo/src/main/java/com/example/demo/groups/api/GroupController.java +++ b/demo/src/main/java/com/example/demo/groups/api/GroupController.java @@ -22,7 +22,7 @@ import com.example.demo.users.service.UserService; import jakarta.validation.Valid; @RestController -@RequestMapping(Constants.API_URL + "/group") +@RequestMapping(Constants.API_URL + "/user/{user}/group") public class GroupController { private final GroupService groupService; private final UserService userService; diff --git a/demo/src/main/java/com/example/demo/groups/model/GroupEntity.java b/demo/src/main/java/com/example/demo/groups/model/GroupEntity.java index e91d91c..5af7dea 100644 --- a/demo/src/main/java/com/example/demo/groups/model/GroupEntity.java +++ b/demo/src/main/java/com/example/demo/groups/model/GroupEntity.java @@ -19,9 +19,10 @@ import jakarta.persistence.Table; @Entity @Table(name = "groups") + public class GroupEntity extends BaseEntity { @ManyToOne - @JoinColumn(name = "typeId", nullable = false) + @JoinColumn(name = "userId", nullable = false) private UserEntity user; @Column(nullable = false, length = 30) private String name; diff --git a/demo/src/main/java/com/example/demo/members/api/MemberController.java b/demo/src/main/java/com/example/demo/members/api/MemberController.java index 73bf944..8e4067b 100644 --- a/demo/src/main/java/com/example/demo/members/api/MemberController.java +++ b/demo/src/main/java/com/example/demo/members/api/MemberController.java @@ -21,7 +21,7 @@ import com.example.demo.groups.service.GroupService; import jakarta.validation.Valid; @RestController -@RequestMapping(Constants.API_URL + "/member") +@RequestMapping(Constants.API_URL + "/user/{user}/group/{group}/member") public class MemberController { private final MemberService memberService; private final GroupService groupService; diff --git a/demo/src/main/java/com/example/demo/members/model/MemberEntity.java b/demo/src/main/java/com/example/demo/members/model/MemberEntity.java index 698cd39..5bec992 100644 --- a/demo/src/main/java/com/example/demo/members/model/MemberEntity.java +++ b/demo/src/main/java/com/example/demo/members/model/MemberEntity.java @@ -16,7 +16,7 @@ import jakarta.persistence.Table; @Table(name = "members") public class MemberEntity extends BaseEntity { @ManyToOne - @JoinColumn(name = "typeId", nullable = false) + @JoinColumn(name = "groupdId", nullable = false) private GroupEntity group; @Column(nullable = false, length = 50) private String name;