Skip to content

Commit 6c7c4c7

Browse files
committed
feat: 사용자의 성공한 도전 기록 조회 API 및 관련 모델 추가
* getAttempts 함수를 추가하여 사용자가 성공한 모든 도전 기록을 최신순으로 조회할 수 있도록 구현 * ApiResultPageAttemptResponse, GetAttemptsParams, AttemptResponse, PageAttemptResponse 모델 추가 * 기존의 getMySuccessfulAttempts 함수 제거
1 parent 66d594e commit 6c7c4c7

File tree

7 files changed

+128
-19
lines changed

7 files changed

+128
-19
lines changed

src/generated/attempts/attempts.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,34 @@ import type {
1414
ApiResultCreateAttemptResponse,
1515
ApiResultListRouteMissionRecommendationResponse,
1616
ApiResultListUserMissionAttemptResponse,
17+
ApiResultPageAttemptResponse,
1718
ApiResultRouteMissionUploadChunkResponse,
1819
ApiResultRouteMissionUploadSessionFinalizeResponse,
1920
ApiResultRouteMissionUploadSessionInitializeResponse,
2021
ApiResultRouteMissionUploadStatusResponse,
2122
ApiResultSessionAttemptResponse,
2223
CreateAttemptRequest,
2324
FinalizeRouteMissionUploadSessionBody,
25+
GetAttemptsParams,
2426
RouteMissionUploadChunkRequest,
2527
RouteMissionUploadSessionInitializeRequest,
2628
} from ".././model";
2729

2830
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
2931

32+
/**
33+
* 사용자가 성공한 모든 도전 기록들을 최신순으로 조회합니다.
34+
* @summary 성공한 도전 기록 조회
35+
*/
36+
export const getAttempts = (
37+
params?: GetAttemptsParams,
38+
options?: SecondParameter<typeof http>
39+
) => {
40+
return http<ApiResultPageAttemptResponse>(
41+
{ url: `/api/attempts`, method: "GET", params },
42+
options
43+
);
44+
};
3045
/**
3146
* 루트미션에 대한 도전기록을 등록합니다. 성공 시 SR이 증가합니다.
3247
* @summary 루트미션 도전기록 등록
@@ -176,6 +191,9 @@ export const getIncompleteAttempts = (
176191
options
177192
);
178193
};
194+
export type GetAttemptsResult = NonNullable<
195+
Awaited<ReturnType<typeof getAttempts>>
196+
>;
179197
export type CreateAttemptResult = NonNullable<
180198
Awaited<ReturnType<typeof createAttempt>>
181199
>;

src/generated/climbing-gym/climbing-gym.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import { http } from "../../utils/http";
1010
import type {
1111
ApiResultGymResponse,
1212
ApiResultListGymResponse,
13-
ApiResultPageGymAttemptResponse,
14-
GetMySuccessfulAttemptsParams,
1513
} from ".././model";
1614

1715
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
@@ -39,20 +37,6 @@ export const getGymById = (
3937
options
4038
);
4139
};
42-
/**
43-
* 사용자가 특정 암장에서 성공한 도전 기록들을 최신순으로 조회합니다.
44-
* @summary 내 암장별 성공한 도전 기록 조회
45-
*/
46-
export const getMySuccessfulAttempts = (
47-
gymId: number,
48-
params?: GetMySuccessfulAttemptsParams,
49-
options?: SecondParameter<typeof http>
50-
) => {
51-
return http<ApiResultPageGymAttemptResponse>(
52-
{ url: `/api/gyms/${gymId}/attempts/my-success`, method: "GET", params },
53-
options
54-
);
55-
};
5640
/**
5741
* 특정 브랜드의 모든 지점을 조회합니다
5842
* @summary 브랜드별 암장 리스트 조회
@@ -72,9 +56,6 @@ export type GetAllGymsResult = NonNullable<
7256
export type GetGymByIdResult = NonNullable<
7357
Awaited<ReturnType<typeof getGymById>>
7458
>;
75-
export type GetMySuccessfulAttemptsResult = NonNullable<
76-
Awaited<ReturnType<typeof getMySuccessfulAttempts>>
77-
>;
7859
export type GetGymsByBrandResult = NonNullable<
7960
Awaited<ReturnType<typeof getGymsByBrand>>
8061
>;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Generated by orval v7.10.0 🍺
3+
* Do not edit manually.
4+
* Holdy API
5+
* Holdy API
6+
* OpenAPI spec version: v1.0
7+
*/
8+
import type { PageAttemptResponse } from "./pageAttemptResponse";
9+
10+
/**
11+
* Api 응답 정보
12+
*/
13+
export interface ApiResultPageAttemptResponse {
14+
/** 응답 메시지 */
15+
message?: string;
16+
/** 응답 데이터 */
17+
data?: PageAttemptResponse;
18+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Generated by orval v7.10.0 🍺
3+
* Do not edit manually.
4+
* Holdy API
5+
* Holdy API
6+
* OpenAPI spec version: v1.0
7+
*/
8+
9+
/**
10+
* 암장 도전 기록 응답
11+
*/
12+
export interface AttemptResponse {
13+
/** 도전 기록 ID */
14+
attemptId?: number;
15+
/** 암장 ID */
16+
gymId?: number;
17+
/** 브랜드명 */
18+
brandName?: string;
19+
/** 지점명 */
20+
branchName?: string;
21+
/** 암장별 레벨명 */
22+
gymLevelName?: string;
23+
/** 암장별 레벨 이미지 URL 목록 */
24+
gymLevelImageUrls?: string[];
25+
/** 도전 일자 */
26+
attemptedAt?: string;
27+
/** 성공 여부 */
28+
success?: boolean;
29+
/** 썸네일 URL */
30+
thumbnailUrl?: string;
31+
/** 비디오 URL */
32+
videoUrl?: string;
33+
/** 섹터명 */
34+
sectorName?: string;
35+
/** 루트 점수 */
36+
routeScore?: number;
37+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Generated by orval v7.10.0 🍺
3+
* Do not edit manually.
4+
* Holdy API
5+
* Holdy API
6+
* OpenAPI spec version: v1.0
7+
*/
8+
9+
export type GetAttemptsParams = {
10+
/**
11+
* 페이지 번호 (0부터 시작)
12+
*/
13+
page?: number;
14+
/**
15+
* 페이지 크기
16+
*/
17+
size?: number;
18+
/**
19+
* 암장 ID (선택사항 - 입력 시 해당 암장만 필터링)
20+
*/
21+
gymId?: number;
22+
/**
23+
* 성공 여부 (기본값: true)
24+
*/
25+
success?: boolean;
26+
};

src/generated/model/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export * from "./apiResultMapStringObject";
2424
export * from "./apiResultMapStringObjectData";
2525
export * from "./apiResultMapStringString";
2626
export * from "./apiResultMapStringStringData";
27+
export * from "./apiResultPageAttemptResponse";
2728
export * from "./apiResultPageGymAttemptResponse";
2829
export * from "./apiResultRouteMissionResponse";
2930
export * from "./apiResultRouteMissionUploadChunkResponse";
@@ -37,6 +38,7 @@ export * from "./apiResultUserActiveSession";
3738
export * from "./apiResultUserSessionState";
3839
export * from "./apiResultUserStatusResponse";
3940
export * from "./apiResultVoid";
41+
export * from "./attemptResponse";
4042
export * from "./attemptStatusResponse";
4143
export * from "./attemptStatusResponseStatus";
4244
export * from "./brandResponse";
@@ -49,6 +51,7 @@ export * from "./createRouteMissionRequest";
4951
export * from "./createUserSession";
5052
export * from "./finalizeRouteMissionUploadSessionBody";
5153
export * from "./finishUserSession";
54+
export * from "./getAttemptsParams";
5255
export * from "./getMySuccessfulAttemptsParams";
5356
export * from "./getRouteMissionsParams";
5457
export * from "./gymAttemptResponse";
@@ -61,6 +64,7 @@ export * from "./handleOAuth2Redirect200";
6164
export * from "./handleOAuth2RedirectParams";
6265
export * from "./levelRequest";
6366
export * from "./levelResponse";
67+
export * from "./pageAttemptResponse";
6468
export * from "./pageableObject";
6569
export * from "./pageGymAttemptResponse";
6670
export * from "./refreshTokenBody";
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Generated by orval v7.10.0 🍺
3+
* Do not edit manually.
4+
* Holdy API
5+
* Holdy API
6+
* OpenAPI spec version: v1.0
7+
*/
8+
9+
import type { AttemptResponse } from "./attemptResponse";
10+
import type { PageableObject } from "./pageableObject";
11+
import type { SortObject } from "./sortObject";
12+
13+
export interface PageAttemptResponse {
14+
totalElements?: number;
15+
totalPages?: number;
16+
pageable?: PageableObject;
17+
first?: boolean;
18+
size?: number;
19+
content?: AttemptResponse[];
20+
number?: number;
21+
sort?: SortObject;
22+
numberOfElements?: number;
23+
last?: boolean;
24+
empty?: boolean;
25+
}

0 commit comments

Comments
 (0)