Skip to content

Commit afa5fcf

Browse files
committed
modify: bigint PK를 string으로 받도록 타입 수정
1 parent f8627cb commit afa5fcf

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/repositories/__test__/leaderboard.repo.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('LeaderboardRepository', () => {
3232
it('사용자 통계 배열로 이루어진 리더보드를 반환해야 한다', async () => {
3333
const mockResult = [
3434
{
35-
id: 1,
35+
id: '1',
3636
3737
total_views: 100,
3838
total_likes: 50,
@@ -42,7 +42,7 @@ describe('LeaderboardRepository', () => {
4242
post_diff: 1,
4343
},
4444
{
45-
id: 2,
45+
id: '2',
4646
4747
total_views: 200,
4848
total_likes: 100,
@@ -119,7 +119,7 @@ describe('LeaderboardRepository', () => {
119119
it('게시물 통계 배열로 이루어진 리더보드를 반환해야 한다', async () => {
120120
const mockResult = [
121121
{
122-
id: 2,
122+
id: '2',
123123
title: 'test2',
124124
slug: 'test2',
125125
total_views: 200,
@@ -129,7 +129,7 @@ describe('LeaderboardRepository', () => {
129129
released_at: '2025-01-02',
130130
},
131131
{
132-
id: 1,
132+
id: '1',
133133
title: 'test',
134134
slug: 'test',
135135
total_views: 100,

src/services/__test__/leaderboard.service.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('LeaderboardService', () => {
2828
it('응답 형식에 맞게 변환된 사용자 리더보드 데이터를 반환해야 한다', async () => {
2929
const mockRawResult = [
3030
{
31-
id: 1,
31+
id: '1',
3232
3333
total_views: 100,
3434
total_likes: 50,
@@ -38,7 +38,7 @@ describe('LeaderboardService', () => {
3838
post_diff: 1,
3939
},
4040
{
41-
id: 2,
41+
id: '2',
4242
4343
total_views: 200,
4444
total_likes: 100,
@@ -52,7 +52,7 @@ describe('LeaderboardService', () => {
5252
const mockResult = {
5353
users: [
5454
{
55-
id: 1,
55+
id: '1',
5656
5757
totalViews: 100,
5858
totalLikes: 50,
@@ -62,7 +62,7 @@ describe('LeaderboardService', () => {
6262
postDiff: 1,
6363
},
6464
{
65-
id: 2,
65+
id: '2',
6666
6767
totalViews: 200,
6868
totalLikes: 100,
@@ -118,7 +118,7 @@ describe('LeaderboardService', () => {
118118
it('응답 형식에 맞게 변환된 게시물 리더보드 데이터를 반환해야 한다', async () => {
119119
const mockRawResult = [
120120
{
121-
id: 1,
121+
id: '1',
122122
title: 'test',
123123
slug: 'test-slug',
124124
total_views: 100,
@@ -128,7 +128,7 @@ describe('LeaderboardService', () => {
128128
released_at: '2025-01-01',
129129
},
130130
{
131-
id: 2,
131+
id: '2',
132132
title: 'test2',
133133
slug: 'test2-slug',
134134
total_views: 200,
@@ -142,7 +142,7 @@ describe('LeaderboardService', () => {
142142
const mockResult = {
143143
posts: [
144144
{
145-
id: 1,
145+
id: '1',
146146
title: 'test',
147147
slug: 'test-slug',
148148
totalViews: 100,
@@ -152,7 +152,7 @@ describe('LeaderboardService', () => {
152152
releasedAt: '2025-01-01',
153153
},
154154
{
155-
id: 2,
155+
id: '2',
156156
title: 'test2',
157157
slug: 'test2-slug',
158158
totalViews: 200,

src/services/leaderboard.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class LeaderboardService {
7070
}
7171

7272
interface RawPostResult {
73-
id: number;
73+
id: string;
7474
title: string;
7575
slug: string;
7676
total_views: number;
@@ -81,7 +81,7 @@ interface RawPostResult {
8181
}
8282

8383
interface RawUserResult {
84-
id: number;
84+
id: string;
8585
email: string;
8686
total_views: number;
8787
total_likes: number;

src/types/dto/responses/leaderboardResponse.type.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { BaseResponseDto } from '@/types/dto/responses/baseResponse.type';
88
* type: object
99
* properties:
1010
* id:
11-
* type: integer
12-
* description: 사용자 ID
11+
* type: string
12+
* description: 사용자 PK
1313
* email:
1414
* type: string
1515
* description: 사용자 이메일
@@ -33,7 +33,7 @@ import { BaseResponseDto } from '@/types/dto/responses/baseResponse.type';
3333
* description: 구간 게시물 수 상승값
3434
*/
3535
interface LeaderboardUser {
36-
id: number;
36+
id: string;
3737
email: string;
3838
totalViews: number;
3939
totalLikes: number;
@@ -81,8 +81,8 @@ export class UserLeaderboardResponseDto extends BaseResponseDto<UserLeaderboardD
8181
* type: object
8282
* properties:
8383
* id:
84-
* type: integer
85-
* description: 게시물 ID
84+
* type: string
85+
* description: 게시물 PK
8686
* title:
8787
* type: string
8888
* description: 게시물 제목
@@ -107,7 +107,7 @@ export class UserLeaderboardResponseDto extends BaseResponseDto<UserLeaderboardD
107107
* description: 게시물 업로드 일시
108108
*/
109109
interface LeaderboardPost {
110-
id: number;
110+
id: string;
111111
title: string;
112112
slug: string;
113113
totalViews: number;

0 commit comments

Comments
 (0)