Skip to content
Snippets Groups Projects
Commit 85277179 authored by Birk Øvstetun Narvhus's avatar Birk Øvstetun Narvhus
Browse files

Merge branch 'main' into 'feature/205-can-delete-item-from-fridge'

# Conflicts:
#   src/main/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupController.java
#   src/main/java/ntnu/idatt2016/v233/SmartMat/service/group/GroupService.java
parents c7d2977f d9b482db
No related branches found
No related tags found
No related merge requests found
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
*/
......
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) {
}
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) {
}
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) {
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment