created FavouriteRecipeMessage class

This commit is contained in:
Mei Chang van der Werff 2025-12-18 03:25:12 +01:00
commit a5ec17e486
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

@ -23,6 +23,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.
* *