initial commit
This commit is contained in:
commit
fe8af0fedf
20 changed files with 953 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
|||
package me.imsonmia.epqapi.messaging;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import jakarta.websocket.EncodeException;
|
||||
import jakarta.websocket.Encoder;
|
||||
import jakarta.websocket.EndpointConfig;
|
||||
|
||||
public class MessageEncoder implements Encoder.Text<Message> {
|
||||
private static Gson gson = new Gson();
|
||||
@Override
|
||||
public String encode(Message message) throws EncodeException {
|
||||
return gson.toJson(message);
|
||||
}
|
||||
@Override
|
||||
public void destroy() {
|
||||
// TODO Auto-generated method stub
|
||||
Text.super.destroy();
|
||||
}
|
||||
@Override
|
||||
public void init(EndpointConfig endpointConfig) {
|
||||
// TODO Auto-generated method stub
|
||||
Text.super.init(endpointConfig);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue