This commit is contained in:
gg12 darfren 2024-04-22 17:35:18 +04:00
parent 15c53ef456
commit f4f8b32fc7
5 changed files with 5 additions and 4 deletions

Binary file not shown.

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;