-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/badge 기능 구현 #56 #58
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
base: develop
Are you sure you want to change the base?
The head ref may contain hidden characters: "Feature/Badge_\uAE30\uB2A5_\uAD6C\uD604_#56"
Conversation
- auth에 필요없는 import 제거
- 뱃지 등록 - 뱃지 조회(전체, 유저) - 뱃지 부여 기능 - 뱃지 박탈 기능 - #56
hdh4952
left a comment
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.
👍
jasper200207
left a comment
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.
뱃지 부여 및 삭제 통합하도록 코멘트 확인해주세요
src/controllers/badge.controller.ts
Outdated
| async getBadges(): Promise<Badge[]> { | ||
| return this.badgeService.getBadges(); | ||
| } |
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.
이건 어드민 권한으로 해야할 듯 합니다
| export class GrantRequestBadgeDto { | ||
| userId: string; | ||
| badgeId: string; | ||
| } |
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.
이거 형식을
export class GrantRequestBadgeDto {
userId:string;
grantedBadges:string[];
deprivedBadges:string[];
}| @Get('/:userId') | ||
| @ApiOperation({ | ||
| summary: 'Get Badges By UserId', | ||
| description: 'Get Badges By UserId', | ||
| }) | ||
| @ApiCreatedResponse({ | ||
| description: 'Badges', | ||
| }) | ||
| async getBadgesByUserId(userId: string): Promise<Badge[]> { | ||
| return this.badgeService.getBadgesByUserId(userId); | ||
| } |
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.
이 부분은 유저 프로필 조호와 합칩시다
src/services/badge/badge.service.ts
Outdated
| const badgeLog = new BadgeLog(); | ||
| badgeLog.badge = badge; | ||
| badgeLog.user = user; | ||
| badgeLog.isGiven = true; | ||
| return await this.badgeLogRepository.save(badgeLog); |
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.
이건 없어도 됩니다. 디비에서 남길거에요
| @InjectRepository(BadgeLog) | ||
| private readonly badgeLogRepository: Repository<BadgeLog>, |
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.
뱃지 로그 관련은 다 빼도 됩니다
src/services/badge/badge.service.ts
Outdated
| const badgeLog = new BadgeLog(); | ||
| badgeLog.badge = badge; | ||
| badgeLog.user = user; | ||
| badgeLog.isGiven = false; | ||
| await this.badgeLogRepository.save(badgeLog); |
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.
위와 같습니다
| await this.userRepository | ||
| .createQueryBuilder() | ||
| .relation(User, 'badges') | ||
| .of(user) | ||
| .remove(badge); |
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.
부여 안된 뱃지만 삭제하는걸로 합시다
src/services/badge/badge.service.ts
Outdated
| // await this.badgeRepository.delete({ id: badgeId }); | ||
| // } | ||
|
|
||
| async depriveBadgeFromUser(badgeId: string, userId: string): Promise<void> { |
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.
초기 생성 뱃지는 삭제안되도록 해주세요
basic 컬럼 추가해서 확인하면 될듯 합니다
…Back into Feature/Badge_기능_구현_#56
- key가 nullable이 불가능하게 설정
- badge 매개변수를 badgeId[]로 받게함 - 리스트를 받아서 한번에 저장, 박탈 - 리스트로 dto도 변환
관련이슈
요약
뱃지 관련 기능 생성
상세
리뷰안내