Skip to content

Commit

Permalink
[ST-641] Feat/signup user profile img (#74)
Browse files Browse the repository at this point in the history
* πŸ”¨ λ°±μ—”λ“œ FCM λ©”μ‹œμ§€ 포맷 반영

* send Both user μˆ˜μ •

* signup dto λ³€κ²½
곡톡 -> profile img μΆ”κ°€
μ„ μƒλ‹˜ -> ν•™λ…„, λ‹¨κ³ΌλŒ€ μ‚­μ œ

* user schema λ³€κ²½
user.school.grade->optional

* problem-image λ©”μ‹œμ§€ 포맷 λ³€κ²½

* User μ—”ν‹°ν‹° 내렀쀄 λ•Œ followersCnt λ‚΄λ € μ£ΌλŠ” κ±Έ
followers(student id list)둜 λ°”κΎΈκΈ°

---------

Co-authored-by: w8385 <w8385@naver.com>
  • Loading branch information
seongyunlee and w8385 authored Oct 4, 2023
1 parent 2697243 commit 5995b8f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/offer/offer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class OfferService {
image: messageImage,
description: questionInfo.problem.description,
questionId: questionId,
subTitle: `${questionInfo.problem.schoolLevel} ${questionInfo.problem.schoolSubject}`,
};
const requestMessage = {
text: 'μ•ˆλ…•ν•˜μ„Έμš” μ„ μƒλ‹˜! μ–Έμ œ μˆ˜μ—… κ°€λŠ₯ν•˜μ‹ κ°€μš”?',
Expand Down
1 change: 1 addition & 0 deletions src/question/question.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class QuestionService {
image: messageImage,
description: createQuestionDto.description,
questionId: questionId,
subTitle: `${createQuestionDto.schoolLevel} ${createQuestionDto.schoolSubject}`,
};
console.log(createQuestionDto.requestTutoringStartTime);
const requestMessage = {
Expand Down
21 changes: 14 additions & 7 deletions src/user/dto/create-user.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ export class CreateUserDto {
})
bio: string;

@ApiProperty({
description: 'μ‚¬μš©μž ν”„λ‘œν•„ 이미지',
enum: ['dog', 'duck', 'fox', 'lion', 'penguin', 'polar_bear', 'tiger'],
})
profileImg: string;

// @ApiProperty({
// description: 'The review list of the user.',
// default: ['review1', 'review2'],
Expand Down Expand Up @@ -67,21 +73,22 @@ export class CreateTeacherDto extends CreateUserDto {
})
schoolName: string;

@ApiProperty({
description: 'μ„ μƒλ‹˜μ˜ μ†Œμ† λ‹¨κ³ΌλŒ€',
example: 'μ‚¬λ²”λŒ€ν•™',
})
schoolDivision: string;

@ApiProperty({
description: 'μ„ μƒλ‹˜μ˜ ν•™κ³Ό',
example: 'μˆ˜ν•™κ΅μœ‘κ³Ό',
})
schoolDepartment: string;

/* @ApiProperty({
description: 'μ„ μƒλ‹˜μ˜ μ†Œμ† λ‹¨κ³ΌλŒ€',
example: 'μ‚¬λ²”λŒ€ν•™',
})
schoolDivision: string;
@ApiProperty({
description: 'μ„ μƒλ‹˜μ˜ ν•™λ…„',
example: 3,
})
schoolGrade: number;
schoolGrade: number;*/
}
2 changes: 1 addition & 1 deletion src/user/entities/user.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export interface User extends UserKey {
name?: string;
division?: string;
department?: string;
grade: number;
grade?: number;
};
}
9 changes: 3 additions & 6 deletions src/user/user.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ export class UserRepository {
following: [],
id: userId,
name: createUserDto.name,
profileImage:
'https://short-tutoring.s3.ap-northeast-2.amazonaws.com/default/profile.png',
role,
profileImage: `https://short-tutoring.s3.ap-northeast-2.amazonaws.com/default/profile-img/ic_profile_${createUserDto.profileImg}.png`,
role: role,
participatingChattingRooms: [],
};

Expand All @@ -40,9 +39,7 @@ export class UserRepository {
const createTeacherDto = createUserDto as CreateTeacherDto;
user.school = {
name: createTeacherDto.schoolName,
division: createTeacherDto.schoolDivision,
department: createTeacherDto.schoolDepartment,
grade: createTeacherDto.schoolGrade,
};
}

Expand Down Expand Up @@ -246,7 +243,7 @@ export class UserRepository {
profileImage: user.profileImage,
role: user.role,
school: user.school,
followersCount: user.followers.length,
followers: user.followers,
followingCount: user.following.length,
};
}
Expand Down
3 changes: 3 additions & 0 deletions src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ export class UserService {
}
}

/**
* λ‚΄κ°€ νŒ”λ‘œμš°ν•œ μ„ μƒλ‹˜λ“€μ„ κ°€μ Έμ˜΅λ‹ˆλ‹€.
*/
async following(studentId: string) {
try {
return new Success(
Expand Down

0 comments on commit 5995b8f

Please sign in to comment.