Skip to content

Commit

Permalink
Feat: TotalPoint 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
koomin1227 committed Apr 19, 2024
1 parent e4fd0ad commit a3bad4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/stat/dto/stat-find.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ export class StatFindDto {

@ApiProperty()
grade: number;

@ApiProperty()
totalPoint: number;
}
5 changes: 4 additions & 1 deletion src/stat/service/total.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Grade } from '../../Entity/grade';
import { Algorithm } from '../../Entity/algorithm';
import { RankListDto, RankListOptionDto } from '../dto/rank-list-option.dto';
import { PointFindDto } from '../dto/rank-find.dto';
import { StatFindDto } from '../dto/stat-find.dto';

@Injectable()
export class TotalService {
Expand All @@ -19,15 +20,17 @@ export class TotalService {
private gradeService: GradeService,
) {}

async findStat(userId: string) {
async findStat(userId: string): Promise<StatFindDto> {
const github = await this.githubService.findGithub(userId);
const algorithm = await this.algorithmService.findAlgorithm(userId);
const grade = await this.gradeService.findGrade(userId);
const total = await this.totalRepository.findOneById(userId);

return {
githubPoint: github ? github.point : null,
algorithmPoint: algorithm ? algorithm.point : null,
grade: grade ? grade.grade : null,
totalPoint: grade ? total.point : null,
};
}

Expand Down

0 comments on commit a3bad4f

Please sign in to comment.