import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 用户人设管理信息 */
export interface UserCharacter {
          id: number; // 主键 Id
          characterId: number; // 键盘人设 id
          createdAt: string | Dayjs; // 创建时间
          updatedAt: string | Dayjs; // 更新时间
          userId: number; // 用户 Id
          emoji: string; // emoji 标签
  }

// 用户人设管理 API
export const UserCharacterApi = {
  // 查询用户人设管理分页
  getUserCharacterPage: async (params: any) => {
    return await request.get({ url: `/keyboard/user-character/page`, params })
  },

  // 查询用户人设管理详情
  getUserCharacter: async (id: number) => {
    return await request.get({ url: `/keyboard/user-character/get?id=` + id })
  },

  // 新增用户人设管理
  createUserCharacter: async (data: UserCharacter) => {
    return await request.post({ url: `/keyboard/user-character/create`, data })
  },

  // 修改用户人设管理
  updateUserCharacter: async (data: UserCharacter) => {
    return await request.put({ url: `/keyboard/user-character/update`, data })
  },

  // 删除用户人设管理
  deleteUserCharacter: async (id: number) => {
    return await request.delete({ url: `/keyboard/user-character/delete?id=` + id })
  },

  /** 批量删除用户人设管理 */
  deleteUserCharacterList: async (ids: number[]) => {
    return await request.delete({ url: `/keyboard/user-character/delete-list?ids=${ids.join(',')}` })
  },

  // 导出用户人设管理 Excel
  exportUserCharacter: async (params) => {
    return await request.download({ url: `/keyboard/user-character/export-excel`, params })
  }
}