/**
 * API接口类型定义
 */

// 通用响应类型
export interface ApiResponse<T = any> {
  code: number;
  message: string;
  result: T;
  success: boolean;
  timestamp: number;
}

// 分页参数类型
export interface PageParams {
  pageNo?: number;
  pageSize?: number;
}

// 分页响应类型
export interface PageResult<T> {
  records: T[];
  total: number;
  size: number;
  current: number;
  pages: number;
}

// 登录相关类型
export interface LoginParams {
  code?: string;
  phone?: string;
  encryptedData?: string;
  headimgurl?: string;
  id?: string;
  iv?: string;
  nickName?: string;
  openid?: string;
  session_key?: string;
  shareId?: string;
  state?: string;
  vid?: string;
}

export interface UserInfo {
  id: string;
  nickName: string;
  phone?: string;
  avatarUrl?: string;
  details?: string;
  name?: string;
  isAuthor: boolean;
  createTime?: string;
  updateTime?: string;
}

export interface LoginResult {
  token: string;
  userInfo: UserInfo;
}

// 书籍相关类型
export interface BookInfo {
  id: string;
  name: string;
  author: string;
  image: string;
  details: string;
  shopClass: string;
  shopCion: string;
  status: number;
  bookStatus: number;
  createTime: string;
  updateTime: string;
}

export interface NovelChapter {
  id: string;
  title: string;
  details: string;
  num: number;
  sort: number;
  status: number;
  isPay: string;
  bookId: string;
  createTime: string;
  updateTime: string;
}

// 评论相关类型
export interface CommentInfo {
  id: string;
  content: string;
  bookId: string;
  userId: string;
  createTime: string;
  userName?: string;
  userAvatar?: string;
  replyList?: CommentInfo[];
}

// 任务相关类型
export interface TaskInfo {
  id: string;
  title: string;
  description: string;
  reward: number;
  status: number;
  type: string;
  createTime: string;
}

// 礼物相关类型
export interface GiftInfo {
  id: string;
  name: string;
  price: number;
  image: string;
  description: string;
  type: string;
}

// 订单相关类型
export interface OrderInfo {
  id: string;
  userId: string;
  giftId: string;
  num: number;
  totalPrice: number;
  status: number;
  createTime: string;
}

// 成就相关类型
export interface AchievementInfo {
  id: string;
  bookId: string;
  userId: string;
  oneName: string;
  twoName: string;
  threeName: string;
  oneNum: number;
  twoNum: number;
  threeNum: number;
  status: string;
}

// 作家相关类型
export interface WriterInfo {
  id: string;
  userId: string;
  penName: string;
  details: string;
  status: string;
  createTime: string;
}

// 充值套餐类型
export interface PayPackage {
  id: string;
  name: string;
  price: number;
  coins: number;
  description: string;
  isRecommend: boolean;
}

// 流水记录类型
export interface MoneyLog {
  id: string;
  userId: string;
  type: number;
  amount: number;
  balance: number;
  description: string;
  createTime: string;
}

// 短信验证码相关类型
export interface SmsCodeParams {
  phone: string;
  code?: string;
}

export interface VerifySmsCodeParams {
  phone: string;
  code: string;
} 