-
Notifications
You must be signed in to change notification settings - Fork 0
Feature(#173, #35, #22): 강의 정보 조회, 발표자가 강의 종료 시 참여코드 무효화, 강의코드 검증 #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature(#173, #35, #22): 강의 정보 조회, 발표자가 강의 종료 시 참여코드 무효화, 강의코드 검증 #171
Conversation
✅ Deploy Preview for boarlog ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다 !
async getLectureInfo(@Query('code') code: string, @Res() res: Response) { | ||
const enterCodeDocument = await this.lectureService.findLectureByCode(code); | ||
if (!enterCodeDocument) { | ||
throw new HttpException('해당 강의가 없습니다.', HttpStatus.NOT_FOUND); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기서 HttpException을 던지면 PR에 써주셨듯이 response body를 JSON 형태로 statuscode와 message를 내려주는 것 같네요 !
response body 뿐만 아니라 HTTP 상태 코드도 404로 내려주나요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
상태코드도 404로 내려옵니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 그렇군요 ! 좋네요
title: string; | ||
description: string; | ||
|
||
static of(code: any, lecture: Lecture): LectureInfoDto { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 정적 메서드보다는 constructor를 쓰고 있어서 이후에 이야기해보면 좋을 것 같습니다
|
||
async findLectureInfo(enterCode: EnterCode) { | ||
const result = await this.lectureModel.findById(enterCode.lecture_id).exec(); | ||
return LectureInfoDto.of(enterCode.code, result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이미 클라이언트는 해당 코드로 강의 정보 조회 요청을 해서 또 내려 줄 필요가 없다고 생각하는데 어떻게 생각하시나요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안그래도 이 부분 그래서 프론트 분들이랑 이야기 해봤는데요! 그 프론트에서 흐름이
- 강의 코드 조회
- 강의 코드가 유효하면 강의 정보(어떤 강의인지 제목+설명) 알려주고 강의 참여하기 버튼 생성
- 강의 참여하기 버튼 누르면 그때 강의 참여
이런 식으로 진행이 되어서 강의 정보 조회의 경우는 2번 단계에서 쓰이는거라 따로 만들어뒀습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmddus2 강의 코드 하나만 수정부탁드립니다 ! 제가 좀 늦게 봐드린 것 같아 죄송하네요 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@platinouss 아닙니다! 수정사항 있다면 언제든지 편하게 말씀해주세요~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이번 한 주도 고생 많으셨습니다 !
작업 개요
close #173
강의코드로 강의 정보를 조회한다.
close #35
발표자가 강의 종료 시 참여코드를 무효화한다.
close #22
사용자가 입력한 코드가 유효한 코드인지 확인한다.
작업 사항
강의 정보 조회 API를 구현했습니다.
HTTP method : GET
URL :
/lecture?code=260512
query parameter의 code 값은 강의 참여코드입니다.
Response Body :
강의코드에 대응하는 강의가 없을 때는 404 에러를 반환하도록 했습니다.
강의 종료 시에는 DB에서 해당 강의 참여코드를 삭제하도록 구현했습니다.