feat: 完善训练
This commit is contained in:
@@ -107,6 +107,12 @@ export interface UpdateWorkoutExerciseDto {
|
||||
itemType?: 'exercise' | 'rest' | 'note';
|
||||
}
|
||||
|
||||
export interface CreateWorkoutSessionDto {
|
||||
name: string;
|
||||
trainingPlanId?: string;
|
||||
scheduledDate?: string;
|
||||
}
|
||||
|
||||
export interface WorkoutSessionListResponse {
|
||||
sessions: WorkoutSession[];
|
||||
pagination: {
|
||||
@@ -142,6 +148,10 @@ class WorkoutsApi {
|
||||
return api.get<WorkoutSessionListResponse>(`/workouts/sessions?page=${page}&limit=${limit}`);
|
||||
}
|
||||
|
||||
async createSession(dto: CreateWorkoutSessionDto): Promise<WorkoutSession> {
|
||||
return api.post<WorkoutSession>('/workouts/sessions', dto);
|
||||
}
|
||||
|
||||
async getSessionDetail(sessionId: string): Promise<WorkoutSession> {
|
||||
return api.get<WorkoutSession>(`/workouts/sessions/${sessionId}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user