feat: add team card when comb is register
This commit is contained in:
@@ -97,9 +97,10 @@ public class RCard {
|
||||
|
||||
@WSReceiver(code = "sendCardRm", permission = PermLevel.ADMIN)
|
||||
public Uni<Void> sendCardRm(WebSocketConnection connection, SendCardAdd card) {
|
||||
return getById(card.matchId(), connection)
|
||||
.chain(matchModel -> cardRepository.find("match = ?1 AND comb = ?2 AND type = ?3",
|
||||
matchModel.getId(), card.combId(), card.type())
|
||||
return competitionRepository.find("uuid", connection.pathParam("uuid")).firstResult()
|
||||
.chain(competition -> cardRepository.find(
|
||||
"match IS NULL AND comb = ?1 AND type = ?2 AND competition = ?3 AND match " + (card.matchId() == null ? "IS NULL" : "= " + card.matchId()),
|
||||
card.combId(), card.type(), competition)
|
||||
.firstResult()
|
||||
.invoke(Unchecked.consumer(o -> {
|
||||
if (o == null)
|
||||
@@ -143,7 +144,7 @@ public class RCard {
|
||||
}
|
||||
|
||||
@RegisterForReflection
|
||||
public record SendCardAdd(long matchId, long combId, CardModel.CardType type, String reason) {
|
||||
public record SendCardAdd(Long matchId, long combId, CardModel.CardType type, String reason) {
|
||||
}
|
||||
|
||||
@RegisterForReflection
|
||||
|
||||
Reference in New Issue
Block a user