wip: implement ws base

This commit is contained in:
2025-11-20 23:39:02 +01:00
parent 22fa896ee0
commit a83088387b
17 changed files with 657 additions and 9 deletions

View File

@@ -0,0 +1,29 @@
package fr.titionfire.ffsaf.ws.recv;
import fr.titionfire.ffsaf.data.repository.MatchRepository;
import io.quarkus.hibernate.reactive.panache.common.WithSession;
import io.quarkus.runtime.annotations.RegisterForReflection;
import io.quarkus.websockets.next.WebSocketConnection;
import io.smallrye.mutiny.Uni;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.jboss.logging.Logger;
@WithSession
@ApplicationScoped
@RegisterForReflection
public class RMatch {
private static final Logger LOGGER = Logger.getLogger(RMatch.class);
@Inject
MatchRepository matchRepository;
@WSReceiver(code = "getAllMatch")
public Uni<?> getAllMatch(WebSocketConnection connection, Long l) {
LOGGER.info("getAllMatch " + l);
return Uni.createFrom().item(l);
//return matchRepository.count();
}
}

View File

@@ -0,0 +1,14 @@
package fr.titionfire.ffsaf.ws.recv;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@RegisterForReflection
@Retention(RetentionPolicy.RUNTIME)
public @interface WSReceiver {
String code();
}