objectmapper patch

This commit is contained in:
Michael Wain 2024-07-08 22:34:20 +03:00
parent b448a5df2f
commit ae2e298df4
3 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,8 @@
package com.alterdekim.game.component.game;
public interface ActionDialogBody {
import com.fasterxml.jackson.annotation.JsonProperty;
public abstract class ActionDialogBody {
@JsonProperty("value")
public abstract Object getVal();
}

View File

@ -1,5 +1,6 @@
package com.alterdekim.game.component.game;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@ -8,6 +9,12 @@ import java.util.List;
@Getter
@RequiredArgsConstructor
public class DialogButtonsList implements ActionDialogBody {
public class DialogButtonsList extends ActionDialogBody {
@JsonIgnore
private final List<DialogButton> buttons;
@Override
public Object getVal() {
return this.buttons;
}
}

View File

@ -125,7 +125,6 @@ public class GameRoom {
buttons.add(new DialogButton("Button1", DialogButtonColor.GREEN, Collections.singletonList(WebSocketMessageType.HideDialog)));
DialogButtonsList b = new DialogButtonsList(buttons);
sendMessage(message.getUid(), WebSocketMessageType.ShowDialog, new ActionDialog("Title!", "Description!", ActionDialogType.Buttons, b));
log.info("FUUUUUUUUUUUUUUUUUUCK");
}
private void sendMessage(Long userId, WebSocketMessageType type, Object o) {