Merge branch 'favouriteMessage' into 'main'

Created a message for favourite Recipe

Closes #23

See merge request cse1105/2025-2026/teams/csep-team-76!30
This commit is contained in:
Aysegul Aydinlik 2025-12-19 18:30:35 +01:00
commit c07bae8d74
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,28 @@
package commons.ws.messages;
/**
* Message sent when a recipe becomes a favourite.
* @see commons.ws.messages.Message.Type#RECIPE_FAVOURITE
*/
public class FavouriteRecipeMessage implements Message{
private Long recipeId;
public FavouriteRecipeMessage(Long recipeId) {
this.recipeId = recipeId;
}
@Override
public Type getType() {
return Type.RECIPE_FAVOURITE;
}
/**
* gets the ID of the recipe that got favourite.
* @return
*/
public Long getRecipeId() {
return recipeId;
}
}

View file

@ -39,6 +39,15 @@ public interface Message {
*/ */
RECIPE_DELETE, RECIPE_DELETE,
/**
* Message sent when a recipe became a favourite.
*
* @see commons.ws.messages.FavouriteRecipeMessage
*/
RECIPE_FAVOURITE,
/** /**
* Message sent when a new ingredient is created. * Message sent when a new ingredient is created.
* *