import { api } from '@/services/api';

export type Gender = 'male' | 'female';

export type UpdateUserDto = {
  userId: string;
  name?: string;
  avatar?: string; // base64 字符串
  gender?: Gender;
  birthDate?: number; // 时间戳（秒）
  dailyStepsGoal?: number;
  dailyCaloriesGoal?: number;
  pilatesPurposes?: string[];
  weight?: number;
  height?: number;
};

export async function updateUser(dto: UpdateUserDto): Promise<Record<string, any>> {
  // 固定使用后端文档接口：PUT /api/users/update
  return await api.put('/api/users/update', dto);
}


