Skip to content

Commit

Permalink
Merge pull request #196 from songbuild00/feature-be-#53#57
Browse files Browse the repository at this point in the history
[BE] feat#53#57 κ²Œμž„ μ‹œμž‘ 및 진행 κ΅¬ν˜„, κΈ°μ‘΄ κ΅¬ν˜„λ“€ 닀쀑 μ„œλ²„ κ³ λ €
  • Loading branch information
songbuild00 authored Nov 14, 2024
2 parents 62f9791 + 4162c2d commit 5ab1583
Show file tree
Hide file tree
Showing 17 changed files with 943 additions and 381 deletions.
2 changes: 1 addition & 1 deletion BE/.jest-test-results.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"numFailedTestSuites":0,"numFailedTests":0,"numPassedTestSuites":2,"numPassedTests":10,"numPendingTestSuites":0,"numPendingTests":0,"numRuntimeErrorTestSuites":0,"numTodoTests":0,"numTotalTestSuites":2,"numTotalTests":10,"openHandles":[],"snapshot":{"added":0,"didUpdate":false,"failure":false,"filesAdded":0,"filesRemoved":0,"filesRemovedList":[],"filesUnmatched":0,"filesUpdated":0,"matched":0,"total":0,"unchecked":0,"uncheckedKeysByFile":[],"unmatched":0,"updated":0},"startTime":1730881811395,"success":true,"testResults":[{"assertionResults":[{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":203,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ μœ νš¨ν•œ μ„€μ •μœΌλ‘œ κ²Œμž„λ°© 생성 성곡","invocations":1,"location":null,"numPassingAsserts":2,"retryReasons":[],"status":"passed","title":"μœ νš¨ν•œ μ„€μ •μœΌλ‘œ κ²Œμž„λ°© 생성 성곡"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":105,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ 빈 title","invocations":1,"location":null,"numPassingAsserts":3,"retryReasons":[],"status":"passed","title":"빈 title"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":68,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ 빈 gameMode","invocations":1,"location":null,"numPassingAsserts":3,"retryReasons":[],"status":"passed","title":"빈 gameMode"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":85,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ 잘λͺ»λœ gameMode","invocations":1,"location":null,"numPassingAsserts":3,"retryReasons":[],"status":"passed","title":"잘λͺ»λœ gameMode"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":83,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ μ΅œμ†Œ 인원 미달","invocations":1,"location":null,"numPassingAsserts":3,"retryReasons":[],"status":"passed","title":"μ΅œμ†Œ 인원 미달"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":79,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ μ΅œλŒ€ 인원 초과","invocations":1,"location":null,"numPassingAsserts":3,"retryReasons":[],"status":"passed","title":"μ΅œλŒ€ 인원 초과"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":91,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ 잘λͺ»λœ boolean νƒ€μž…","invocations":1,"location":null,"numPassingAsserts":3,"retryReasons":[],"status":"passed","title":"잘λͺ»λœ boolean νƒ€μž…"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":69,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ λ°©μƒμ„±μ‹œ μ„œλ²„λŠ” μ˜¬λ°”λ₯Έ 6자리 숫자(PIN)을 μ‘λ‹΅ν•΄μ•Όν•œλ‹€.","invocations":1,"location":null,"numPassingAsserts":4,"retryReasons":[],"status":"passed","title":"λ°©μƒμ„±μ‹œ μ„œλ²„λŠ” μ˜¬λ°”λ₯Έ 6자리 숫자(PIN)을 μ‘λ‹΅ν•΄μ•Όν•œλ‹€."},{"ancestorTitles":["GameGateway (e2e)","chatMessage 이벀트 ν…ŒμŠ€νŠΈ"],"duration":126,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) chatMessage 이벀트 ν…ŒμŠ€νŠΈ 같은 Room의 ν”Œλ ˆμ΄μ–΄λ“€μ—κ²Œ λΈŒλ‘œλ“œμΊμŠ€νŒ… 성곡","invocations":1,"location":null,"numPassingAsserts":1,"retryReasons":[],"status":"passed","title":"같은 Room의 ν”Œλ ˆμ΄μ–΄λ“€μ—κ²Œ λΈŒλ‘œλ“œμΊμŠ€νŒ… 성곡"}],"endTime":1730881821139,"message":"","name":"D:\\nest_project\\QuizGround\\web10-QuizGround\\BE\\test\\game.e2e-spec.ts","startTime":1730881811553,"status":"passed","summary":""},{"assertionResults":[{"ancestorTitles":["AppController (e2e)"],"duration":158,"failureDetails":[],"failureMessages":[],"fullName":"AppController (e2e) / (GET)","invocations":1,"location":null,"numPassingAsserts":0,"retryReasons":[],"status":"passed","title":"/ (GET)"}],"endTime":1730881821996,"message":"","name":"D:\\nest_project\\QuizGround\\web10-QuizGround\\BE\\test\\app.e2e-spec.ts","startTime":1730881821176,"status":"passed","summary":""}],"wasInterrupted":false}
{"numFailedTestSuites":1,"numFailedTests":0,"numPassedTestSuites":1,"numPassedTests":10,"numPendingTestSuites":0,"numPendingTests":0,"numRuntimeErrorTestSuites":1,"numTodoTests":0,"numTotalTestSuites":2,"numTotalTests":10,"openHandles":[{}],"snapshot":{"added":0,"didUpdate":false,"failure":false,"filesAdded":0,"filesRemoved":0,"filesRemovedList":[],"filesUnmatched":0,"filesUpdated":0,"matched":0,"total":0,"unchecked":0,"uncheckedKeysByFile":[],"unmatched":0,"updated":0},"startTime":1731590376451,"success":false,"testResults":[{"assertionResults":[{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":242,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ μœ νš¨ν•œ μ„€μ •μœΌλ‘œ κ²Œμž„λ°© 생성 성곡","invocations":1,"location":null,"numPassingAsserts":6,"retryReasons":[],"status":"passed","title":"μœ νš¨ν•œ μ„€μ •μœΌλ‘œ κ²Œμž„λ°© 생성 성곡"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":93,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ 빈 title인 경우 μ—λŸ¬ λ°œμƒ","invocations":1,"location":null,"numPassingAsserts":2,"retryReasons":[],"status":"passed","title":"빈 title인 경우 μ—λŸ¬ λ°œμƒ"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":80,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ 빈 gameMode인 경우 μ—λŸ¬ λ°œμƒ","invocations":1,"location":null,"numPassingAsserts":2,"retryReasons":[],"status":"passed","title":"빈 gameMode인 경우 μ—λŸ¬ λ°œμƒ"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":87,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ 잘λͺ»λœ gameMode인 경우 μ—λŸ¬ λ°œμƒ","invocations":1,"location":null,"numPassingAsserts":2,"retryReasons":[],"status":"passed","title":"잘λͺ»λœ gameMode인 경우 μ—λŸ¬ λ°œμƒ"},{"ancestorTitles":["GameGateway (e2e)","createRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":78,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) createRoom 이벀트 ν…ŒμŠ€νŠΈ μ΅œμ†Œ 인원 미달인 경우 μ—λŸ¬ λ°œμƒ","invocations":1,"location":null,"numPassingAsserts":2,"retryReasons":[],"status":"passed","title":"μ΅œμ†Œ 인원 미달인 경우 μ—λŸ¬ λ°œμƒ"},{"ancestorTitles":["GameGateway (e2e)","joinRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":87,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) joinRoom 이벀트 ν…ŒμŠ€νŠΈ μ‘΄μž¬ν•˜λŠ” λ°© μ°Έμ—¬ 성곡","invocations":1,"location":null,"numPassingAsserts":3,"retryReasons":[],"status":"passed","title":"μ‘΄μž¬ν•˜λŠ” λ°© μ°Έμ—¬ 성곡"},{"ancestorTitles":["GameGateway (e2e)","joinRoom 이벀트 ν…ŒμŠ€νŠΈ"],"duration":73,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) joinRoom 이벀트 ν…ŒμŠ€νŠΈ μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” λ°© μ°Έμ—¬ μ‹€νŒ¨","invocations":1,"location":null,"numPassingAsserts":2,"retryReasons":[],"status":"passed","title":"μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” λ°© μ°Έμ—¬ μ‹€νŒ¨"},{"ancestorTitles":["GameGateway (e2e)","chatMessage 이벀트 ν…ŒμŠ€νŠΈ"],"duration":182,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) chatMessage 이벀트 ν…ŒμŠ€νŠΈ 같은 방의 λͺ¨λ“  ν”Œλ ˆμ΄μ–΄μ—κ²Œ λ©”μ‹œμ§€ 전솑","invocations":1,"location":null,"numPassingAsserts":4,"retryReasons":[],"status":"passed","title":"같은 방의 λͺ¨λ“  ν”Œλ ˆμ΄μ–΄μ—κ²Œ λ©”μ‹œμ§€ 전솑"},{"ancestorTitles":["GameGateway (e2e)","updatePosition 이벀트 ν…ŒμŠ€νŠΈ"],"duration":133,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) updatePosition 이벀트 ν…ŒμŠ€νŠΈ μœ„μΉ˜ μ—…λ°μ΄νŠΈ 성곡","invocations":1,"location":null,"numPassingAsserts":3,"retryReasons":[],"status":"passed","title":"μœ„μΉ˜ μ—…λ°μ΄νŠΈ 성곡"},{"ancestorTitles":["GameGateway (e2e)","startGame 이벀트 ν…ŒμŠ€νŠΈ"],"duration":1613,"failureDetails":[],"failureMessages":[],"fullName":"GameGateway (e2e) startGame 이벀트 ν…ŒμŠ€νŠΈ κ²Œμž„ μ‹œμž‘ 성곡","invocations":1,"location":null,"numPassingAsserts":3,"retryReasons":[],"status":"passed","title":"κ²Œμž„ μ‹œμž‘ 성곡"}],"endTime":1731590391795,"message":"","name":"/Users/song-build/IdeaProjects/web10-QuizGround/BE/test/game.e2e-spec.ts","startTime":1731590376502,"status":"passed","summary":""},{"assertionResults":[],"coverage":{},"endTime":1731590392117,"message":" \u001b[1m● \u001b[22mTest suite failed to run\n\n Your test suite must contain at least one test.\n\n \u001b[2mat onResult (\u001b[22m../node_modules/@jest/core/build/TestScheduler.js\u001b[2m:133:18)\u001b[22m\n \u001b[2mat \u001b[22m../node_modules/@jest/core/build/TestScheduler.js\u001b[2m:254:19\u001b[22m\n \u001b[2mat \u001b[22m../node_modules/emittery/index.js\u001b[2m:363:13\u001b[22m\n at Array.map (<anonymous>)\n \u001b[2mat Emittery.emit (\u001b[22m../node_modules/emittery/index.js\u001b[2m:361:23)\u001b[22m\n","name":"/Users/song-build/IdeaProjects/web10-QuizGround/BE/test/app.e2e-spec.ts","startTime":1731590392117,"status":"failed","summary":""}],"wasInterrupted":false}
56 changes: 51 additions & 5 deletions BE/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions BE/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
},
"dependencies": {
"@nestjs-modules/ioredis": "^2.0.2",
"@nestjs/axios": "^3.1.2",
"@nestjs/common": "^10.4.7",
"@nestjs/config": "^3.3.0",
"@nestjs/core": "^10.4.7",
Expand All @@ -34,6 +35,7 @@
"@nestjs/swagger": "^8.0.5",
"@nestjs/typeorm": "^10.0.2",
"@nestjs/websockets": "^10.4.7",
"axios": "^1.7.7",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"dotenv": "^16.4.5",
Expand Down
102 changes: 51 additions & 51 deletions BE/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { GameModule } from './game/game.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { RedisModule } from '@nestjs-modules/ioredis';
import { ConfigModule } from '@nestjs/config';
import { QuizSetModel } from './quiz/entities/quiz-set.entity';
import { QuizModel } from './quiz/entities/quiz.entity';
import { QuizChoiceModel } from './quiz/entities/quiz-choice.entity';
import { UserModel } from './user/entities/user.entity';
import { UserQuizArchiveModel } from './user/entities/user-quiz-archive.entity';
import { InitDBModule } from './InitDB/InitDB.module';
import { UserModule } from './user/user.module';
import { QuizModule } from './quiz/quiz.module';

@Module({
imports: [
ConfigModule.forRoot({
envFilePath: '../.env',
isGlobal: true
}),
GameModule,
TypeOrmModule.forRoot({
type: 'mysql',
host: process.env.DB_HOST || 'localhost',
port: +process.env.DB_PORT || 3306,
username: process.env.DB_USER || 'root',
password: process.env.DB_PASSWD || 'test',
database: process.env.DB_NAME || 'test_db',
entities: [QuizSetModel, QuizModel, QuizChoiceModel, UserModel, UserQuizArchiveModel],
synchronize: process.env.DEV ? true : false, // 개발 λͺ¨λ“œμ—μ„œλ§Œ ν™œμ„±ν™”
logging: true, // λͺ¨λ“  쿼리 λ‘œκΉ…
logger: 'advanced-console'
// extra: {
// // κΈ€λ‘œλ²Œ batch size μ„€μ •
// maxBatchSize: 100
// }
}),
RedisModule.forRoot({
type: 'single',
url: process.env.REDIS_URL || 'redis://localhost:6379'
}),
QuizModule,
UserModule,
InitDBModule
],
controllers: [AppController],
providers: [AppService]
})
export class AppModule {}
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { GameModule } from './game/game.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { RedisModule } from '@nestjs-modules/ioredis';
import { ConfigModule } from '@nestjs/config';
import { QuizSetModel } from './quiz/entities/quiz-set.entity';
import { QuizModel } from './quiz/entities/quiz.entity';
import { QuizChoiceModel } from './quiz/entities/quiz-choice.entity';
import { UserModel } from './user/entities/user.entity';
import { UserQuizArchiveModel } from './user/entities/user-quiz-archive.entity';
import { InitDBModule } from './InitDB/InitDB.module';
import { UserModule } from './user/user.module';
import { QuizModule } from './quiz/quiz.module';

@Module({
imports: [
ConfigModule.forRoot({
envFilePath: '../.env',
isGlobal: true
}),
GameModule,
TypeOrmModule.forRoot({
type: 'mysql',
host: process.env.DB_HOST || 'localhost',
port: +process.env.DB_PORT || 3306,
username: process.env.DB_USER || 'root',
password: process.env.DB_PASSWD || 'test',
database: process.env.DB_NAME || 'test_db',
entities: [QuizSetModel, QuizModel, QuizChoiceModel, UserModel, UserQuizArchiveModel],
synchronize: process.env.DEV ? true : false, // 개발 λͺ¨λ“œμ—μ„œλ§Œ ν™œμ„±ν™”
logging: true, // λͺ¨λ“  쿼리 λ‘œκΉ…
logger: 'advanced-console'
// extra: {
// // κΈ€λ‘œλ²Œ batch size μ„€μ •
// maxBatchSize: 100
// }
}),
RedisModule.forRoot({
type: 'single',
url: process.env.REDIS_URL || 'redis://localhost:6379'
}),
QuizModule,
UserModule,
InitDBModule
],
controllers: [AppController],
providers: [AppService]
})
export class AppModule {}
5 changes: 3 additions & 2 deletions BE/src/common/constants/exception-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const ExceptionMessage = {
ROOM_NOT_FOUND: 'μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” κ²Œμž„ λ°©μž…λ‹ˆλ‹€.',
ROOM_FULL: 'κ²Œμž„ λ°© μ΅œλŒ€ 인원이 λͺ¨λ‘ μ°ΌμŠ΅λ‹ˆλ‹€.',
NOT_A_PLAYER: 'ν•΄λ‹Ή κ²Œμž„ 방의 ν”Œλ ˆμ΄μ–΄κ°€ μ•„λ‹™λ‹ˆλ‹€.',
ONLY_HOST_CAN_START: 'λ°©μž₯만 κ²Œμž„μ„ μ‹œμž‘ν•  수 μžˆμŠ΅λ‹ˆλ‹€.',
ONLY_HOST: 'λ°©μž₯이 μ•„λ‹™λ‹ˆλ‹€.',
GAME_NOT_STARTED: 'κ²Œμž„μ΄ μ‹œμž‘λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.',
};
EXCEEDS_QUIZ_SET_LIMIT: 'μ„ νƒλœ ν€΄μ¦ˆ μˆ˜κ°€ ν€΄μ¦ˆμ…‹μ— μžˆλŠ” ν€΄μ¦ˆ 수λ₯Ό μ΄ˆκ³Όν–ˆμŠ΅λ‹ˆλ‹€.'
};
Loading

0 comments on commit 5ab1583

Please sign in to comment.