diff --git a/src/main/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupController.java b/src/main/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupController.java index 6b428b67307cbff9bd65222481cfb615b77dfdbe..90e7b988dba61214b5413a4efdfd1b319a88ea36 100644 --- a/src/main/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupController.java +++ b/src/main/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupController.java @@ -1,6 +1,9 @@ package ntnu.idatt2016.v233.SmartMat.controller.group; import lombok.AllArgsConstructor; +import ntnu.idatt2016.v233.SmartMat.dto.request.group.GroupConnectionRequest; +import ntnu.idatt2016.v233.SmartMat.dto.request.group.GroupRequest; +import ntnu.idatt2016.v233.SmartMat.dto.response.group.GroupResponse; import ntnu.idatt2016.v233.SmartMat.entity.group.Group; import ntnu.idatt2016.v233.SmartMat.entity.group.UserGroupAsso; import ntnu.idatt2016.v233.SmartMat.service.group.GroupService; @@ -53,7 +56,7 @@ public class GroupController { /** * Creates a new group * - * @param group the group to create + * @param groupRequest the group to create * @return a ResponseEntity containing the created group if it was created successfully, or a 400 if it wasn't */ @PostMapping("/{username}") @@ -177,8 +180,7 @@ public class GroupController { /** * Handles the HTTP POST request to add a new connection between a user and a group. * - * @param username the username of the user to add to the group - * @param linkCode the code of the group to which the user is to be added + * @param groupConnectionRequest the request object containing the username and link code of the user and group to be connected * @return a ResponseEntity object containing an HTTP status code and the newly created UserGroupAsso object, * or a ResponseEntity object with an HTTP status code indicating that the request was not successful */ diff --git a/src/main/java/ntnu/idatt2016/v233/SmartMat/dto/request/group/GroupConnectionRequest.java b/src/main/java/ntnu/idatt2016/v233/SmartMat/dto/request/group/GroupConnectionRequest.java new file mode 100644 index 0000000000000000000000000000000000000000..90b8f27af3e83f851333e87e556fc073054d6ccf --- /dev/null +++ b/src/main/java/ntnu/idatt2016/v233/SmartMat/dto/request/group/GroupConnectionRequest.java @@ -0,0 +1,9 @@ +package ntnu.idatt2016.v233.SmartMat.dto.request.group; + +/** + * GroupConnectionRequest is a record class representing a request to connect to a group. + * @param username the username of the user connecting to the group + * @param linkCode the link code of the group + */ +public record GroupConnectionRequest(String username, String linkCode) { +} diff --git a/src/main/java/ntnu/idatt2016/v233/SmartMat/dto/request/group/GroupRequest.java b/src/main/java/ntnu/idatt2016/v233/SmartMat/dto/request/group/GroupRequest.java new file mode 100644 index 0000000000000000000000000000000000000000..4078bab3eab8af22269719c9529be17a48973906 --- /dev/null +++ b/src/main/java/ntnu/idatt2016/v233/SmartMat/dto/request/group/GroupRequest.java @@ -0,0 +1,9 @@ +package ntnu.idatt2016.v233.SmartMat.dto.request.group; + +/** + * GroupRequest is a record class representing a request to create a group. + * @param groupName the name of the group + * @param username the username of the user creating the group + */ +public record GroupRequest(String groupName, String username) { +} diff --git a/src/main/java/ntnu/idatt2016/v233/SmartMat/dto/response/group/GroupResponse.java b/src/main/java/ntnu/idatt2016/v233/SmartMat/dto/response/group/GroupResponse.java new file mode 100644 index 0000000000000000000000000000000000000000..411cdaa28be9283f4b1932e7876ecc77ecd00bb4 --- /dev/null +++ b/src/main/java/ntnu/idatt2016/v233/SmartMat/dto/response/group/GroupResponse.java @@ -0,0 +1,9 @@ +package ntnu.idatt2016.v233.SmartMat.dto.response.group; + +/** + * GroupResponse is a record class representing a response to a group request. + * @param groupId the id of the group + * @param linkCode the link code of the group + */ +public record GroupResponse(long groupId, String linkCode) { +}