-
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.
[BE#505] 팔로우 조회 커서기반 pagination (#506)
* fix: is_blocked 추가 안되었음 * refactor: auth, user의 swagger 반영 * feat: 커서기반 페이지네이션 구현 - followers 쿼리에는 is_followed 추가 - /mates/followers?cursor=1 요청을 통해 페이지네이션 구현 - query를 string으로 받는데, 변환 과정을 dto에서 하고자 main.ts에 과련 설정 추가 * refactor: cursor이름 page로 변경 * fix: 친구관계가 아닐 때에도 반영 * fix: 친구관계가 아닐 때에 에러 * chore: follow api 관련 swagger 문서 변경
- Loading branch information
1 parent
6cb19bb
commit fea02e8
Showing
15 changed files
with
269 additions
and
35 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
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'; | ||
|
||
export class GetInfoDto { | ||
@ApiProperty({ | ||
type: 'string', | ||
example: '어린콩', | ||
description: '닉네임', | ||
}) | ||
nickname: string; | ||
|
||
@ApiProperty({ | ||
type: 'string', | ||
example: '[email protected]', | ||
description: '이메일', | ||
}) | ||
email: string; | ||
|
||
@ApiProperty({ | ||
type: 'string', | ||
example: 'https://imageurl.com', | ||
description: '이미지 경로', | ||
}) | ||
image_url: string; | ||
|
||
@ApiProperty({ | ||
type: 'number', | ||
example: 20, | ||
description: '팔로워 수', | ||
}) | ||
follower_count: number; | ||
|
||
@ApiProperty({ | ||
type: 'number', | ||
example: 10, | ||
description: '팔로잉 수', | ||
}) | ||
following_count: number; | ||
} |
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,24 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class UpdateInfoDto { | ||
@ApiProperty({ | ||
type: 'string', | ||
example: '어린콩', | ||
description: '닉네임', | ||
}) | ||
nickname: string; | ||
|
||
@ApiProperty({ | ||
type: 'string', | ||
example: '[email protected]', | ||
description: '이메일', | ||
}) | ||
email: string; | ||
|
||
@ApiProperty({ | ||
type: 'string', | ||
example: 'https://imageurl.com', | ||
description: '이미지 경로', | ||
}) | ||
image_url: string; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Type } from 'class-transformer'; | ||
import { IsNumber, Min } from 'class-validator'; | ||
|
||
export class PaginationQueryDto { | ||
@ApiProperty({ | ||
type: 'number', | ||
example: 1, | ||
description: '현재 page 위치 (default: 1)', | ||
}) | ||
@Type(() => Number) // Add this line | ||
@IsNumber() | ||
@Min(1) | ||
page: number = 1; | ||
} |
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,31 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class FollowerInfoDto { | ||
@ApiProperty({ | ||
type: 'number', | ||
example: 1, | ||
description: '친구 관계 id', | ||
}) | ||
id: number; | ||
|
||
@ApiProperty({ | ||
type: 'string', | ||
example: '어린콩', | ||
description: '친구 닉네임', | ||
}) | ||
nickname: string; | ||
|
||
@ApiProperty({ | ||
type: 'string', | ||
example: 'https://imageurl.com', | ||
description: '친구 이미지 경로', | ||
}) | ||
image_url: string; | ||
|
||
@ApiProperty({ | ||
type: 'boolean', | ||
example: false, | ||
description: '이미 친구관게인지', | ||
}) | ||
is_followed: boolean; | ||
} |
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,24 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class MatesInfoDto { | ||
@ApiProperty({ | ||
type: 'number', | ||
example: 1, | ||
description: '친구 관계 id', | ||
}) | ||
id: number; | ||
|
||
@ApiProperty({ | ||
type: 'string', | ||
example: '어린콩', | ||
description: '친구 닉네임', | ||
}) | ||
nickname: string; | ||
|
||
@ApiProperty({ | ||
type: 'string', | ||
example: 'https://imageurl.com', | ||
description: '친구 이미지 경로', | ||
}) | ||
image_url: string; | ||
} |
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.