-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feature/backend/#23 fcm] fcm을 통한 알림 구현 및 알림데이터 구현
- Loading branch information
Showing
14 changed files
with
507 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { User } from '../../user/entities/user.entity'; | ||
import { StatusEnum } from '../../invite/entities/status.enum'; | ||
|
||
export class SearchResponseDto { | ||
@ApiProperty() | ||
users: SingleSearchUser[]; | ||
static of(users: User[], isFollowed: boolean[], isJoined: StatusEnum[]) { | ||
const res: SingleSearchUser[] = []; | ||
users.forEach((user, index) => { | ||
res.push({ | ||
id: user.id, | ||
nickname: user.nickname, | ||
profile: user.profile?.path ?? null, | ||
isFollowed: isFollowed[index] ?? null, | ||
isJoined: isJoined[index] ?? null, | ||
}); | ||
}); | ||
return { users: res }; | ||
} | ||
} | ||
|
||
class SingleSearchUser { | ||
@ApiProperty() | ||
id: number; | ||
|
||
@ApiProperty() | ||
nickname: string; | ||
|
||
@ApiProperty() | ||
profile: string | null; | ||
|
||
@ApiProperty() | ||
isFollowed: boolean; | ||
|
||
@ApiProperty() | ||
isJoined: StatusEnum; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.