Added actionfoto message

This commit is contained in:
Stijn Bannink 2025-05-25 23:03:22 +02:00
parent 1ff00557bb
commit 4b28838194
Signed by: SBDeveloper
GPG key ID: B730712F2C3A9D7A
2 changed files with 33 additions and 1 deletions

View file

@ -0,0 +1,32 @@
package tech.sbdevelopment.themeparkaudio.socket.messages;
import lombok.Getter;
import org.json.simple.JSONObject;
import java.time.ZonedDateTime;
@Getter
public class ActionFotoMessage extends AbstractMessage {
private final String attractionId;
private final String image;
private final ZonedDateTime timestamp = ZonedDateTime.now();
protected ActionFotoMessage(String attractionId, String image) {
super(MessageTask.ACTIONFOTO);
this.attractionId = attractionId;
this.image = image;
}
public static ActionFotoMessage of(String attractionId, String image) {
return new ActionFotoMessage(attractionId, image);
}
@Override
protected JSONObject extendJson() {
JSONObject data = new JSONObject();
data.put("attractionId", attractionId);
data.put("image", image);
data.put("timestamp", timestamp.toString());
return data;
}
}

View file

@ -1,5 +1,5 @@
package tech.sbdevelopment.themeparkaudio.socket.messages;
public enum MessageTask {
AUTHENTICATION, LOGOUT, LIGHT, MUSIC, SFX, RADIO, PING, STOP
AUTHENTICATION, LOGOUT, LIGHT, MUSIC, SFX, RADIO, PING, STOP, ACTIONFOTO
}