TGD-52 Fix #6

Merged
webster merged 2 commits from bugfix/TGD-52 into 2024edition 2024-11-27 13:37:51 +04:00
2 changed files with 12 additions and 0 deletions
Showing only changes of commit a8a3c6d48a - Show all commits

View file

@ -45,4 +45,10 @@ export class GameController {
this.logger.warn(`[clearQueue] enter`); this.logger.warn(`[clearQueue] enter`);
await this.gameService.clearGameQueue(); await this.gameService.clearGameQueue();
} }
@Post('simulate-valid-answer')
async simulateValidAnswer() {
this.logger.verbose(`[simulateValidAnswer] enter`);
return await this.gameService.simulateValidAnswer();
}
} }

View file

@ -10,6 +10,8 @@ import {ConfigService} from "@nestjs/config";
import {gameCards} from "./entities/cards.entities"; import {gameCards} from "./entities/cards.entities";
import {IEmptyNotification} from "../Consts/types"; import {IEmptyNotification} from "../Consts/types";
import {ClientNotificationType} from "../socket/socket.gateway"; import {ClientNotificationType} from "../socket/socket.gateway";
import {GetGuestQuery} from "../guests/queries/getguest.query";
import {ValidAnswerReceivedEvent} from "./events/valid-answer.recieved";
@Injectable() @Injectable()
export class GameService implements OnApplicationBootstrap{ export class GameService implements OnApplicationBootstrap{
@ -110,4 +112,8 @@ export class GameService implements OnApplicationBootstrap{
await this.gameQueueModel.deleteMany({}).exec(); await this.gameQueueModel.deleteMany({}).exec();
return { result: true }; return { result: true };
} }
async simulateValidAnswer() {
this.eventBus.publish(new ValidAnswerReceivedEvent(11178819, 'test', ''));
}
} }