Skip to content

Commit

Permalink
chore(be): rename functions
Browse files Browse the repository at this point in the history
- requestTest => submitTest
- updateTestResult => handleRunMessage
- 로 함수명 변경
  • Loading branch information
Jaehyeon1020 committed Sep 9, 2024
1 parent f1ca52e commit b751243
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class SubmissionSubscriptionService implements OnModuleInit {

if (raw.properties.type === RUN_MESSAGE_TYPE) {
const testRequestedUserId = res.submissionId // test용 submissionId == test를 요청한 userId
await this.updateTestResult(res, testRequestedUserId)
await this.handleRunMessage(res, testRequestedUserId)
return
}

Expand Down Expand Up @@ -75,7 +75,7 @@ export class SubmissionSubscriptionService implements OnModuleInit {
)
}

async updateTestResult(msg: JudgerResponse, userId: number): Promise<void> {
async handleRunMessage(msg: JudgerResponse, userId: number): Promise<void> {
const key = testKey(userId)
const status = Status(msg.resultCode)
const testcaseId = msg.judgeResult?.testcaseId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ export class SubmissionController {
* 채점 결과는 Cache에 저장됩니다.
*/
@Post('test')
async requestTest(
async submitTest(
@Req() req: AuthenticatedRequest,
@Query('problemId', new RequiredIntPipe('problemId')) problemId: number,
@Body() submissionDto: CreateSubmissionDto
) {
try {
return await this.submissionService.requestTest(
return await this.submissionService.submitTest(
req.user.id,
problemId,
submissionDto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export class SubmissionService {
.padStart(6, '0')
}

async requestTest(
async submitTest(
userId: number,
problemId: number,
submissionDto: CreateSubmissionDto
Expand Down

0 comments on commit b751243

Please sign in to comment.