// Path: demo-site/src/main/java/app/web/ws/ChatMessage.java
// public class ChatMessage {
//     @Property(name = "text")
//     public String text;
// }


import app.web.ws.ChatMessage;
import core.framework.inject.Inject;
import core.framework.web.Request;
import core.framework.web.Response;
import core.framework.web.websocket.Channel;
import core.framework.web.websocket.WebSocketContext;
import java.util.List;
package app.web;



/**
 * @author neo
 */
public class ChatController {
    @Inject
    WebSocketContext context;
    @Inject
    LanguageManager languageManager;

    public Response chat(Request request) {
        return Response.html("/template/chat.html", new ChatPage(), languageManager.language());
    }

    public Response publish(Request request) {
// Path: demo-site/src/main/java/app/web/ws/ChatMessage.java
// public class ChatMessage {
//     @Property(name = "text")
//     public String text;
// }


// Path: demo-site/src/main/java/app/web/ChatController.java
import app.web.ws.ChatMessage;
import core.framework.inject.Inject;
import core.framework.web.Request;
import core.framework.web.Response;
import core.framework.web.websocket.Channel;
import core.framework.web.websocket.WebSocketContext;
import java.util.List;

package app.web;



/**
 * @author neo
 */
public class ChatController {
    @Inject
    WebSocketContext context;
    @Inject
    LanguageManager languageManager;

    public Response chat(Request request) {
        return Response.html("/template/chat.html", new ChatPage(), languageManager.language());
    }

    public Response publish(Request request) {
        final List<Channel<ChatMessage>> channels = context.all();