export class ApiResponse<T = any> {
  code: number;
  data?: T;
  message?: string;
  timestamp: string;

  static success<T>(data: T, message?: string): ApiResponse<T> {
    return {
      code: 0,
      data,
      message,
      timestamp: new Date().toISOString(),
    };
  }

  static error(code: number, message: string): ApiResponse {
    return {
      code,
      message,
      timestamp: new Date().toISOString(),
    };
  }
}
