Added actionfoto message
This commit is contained in:
parent
1ff00557bb
commit
4b28838194
2 changed files with 33 additions and 1 deletions
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
package tech.sbdevelopment.themeparkaudio.socket.messages;
|
package tech.sbdevelopment.themeparkaudio.socket.messages;
|
||||||
|
|
||||||
public enum MessageTask {
|
public enum MessageTask {
|
||||||
AUTHENTICATION, LOGOUT, LIGHT, MUSIC, SFX, RADIO, PING, STOP
|
AUTHENTICATION, LOGOUT, LIGHT, MUSIC, SFX, RADIO, PING, STOP, ACTIONFOTO
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue