import { http } from '../http'

const userApi = {
  // 个人信息调整-根据标识查询用户解锁和正在使用的头像、头像框、昵称框
  getUnlockInfoByRemark: (remark: number) =>
    http.request({
      url: '/personal/getUnlockInfoByRemark/' + remark,
    }),

  // 个人信息调整-修改个性化配置
  updatePersonalConfig: (data: anyObj) =>
    http.request({
      url: '/personal/updatePersonalConfig',
      method: 'POST',
      data,
    }),

  // 个人信息调整-修改个性化配置
  updateUserSex: (data: anyObj) =>
    http.request({
      url: '/personal/updateUserSex',
      method: 'POST',
      data,
    }),

  // 昵称校验检查
  nickNameCheck: (data: anyObj) =>
    http.request({
      url: '/userProperty/nickNameCheck',
      method: 'POST',
      data,
    }),

  // 使用昵称修改卡道具
  useNickNameCard: (data: anyObj) =>
    http.request({
      url: '/userProperty/useNickNameCard',
      method: 'POST',
      data,
    }),

  // 砖石修改昵称
  useDiamondChangeNickName: (data: anyObj) =>
    http.request({
      url: '/personal/useNickNameDiamond',
      method: 'POST',
      data,
    }),

  // 兑换虚拟物品
  exchangeVirtualItem: (params: anyObj) =>
    http.request({
      url: '/personal/updateUnlockInfoById',
      method: 'POST',
      params,
    }),

  // 获取成就勋章
  getPersonalMedalV2Api: () =>
    http.request({
      url: '/personal/getPersonalMedalV2',
    }),

  // 更新学习情况
  updateUserLearn: (data: anyObj) =>
    http.request({
      url: '/personal/updateUserLearn',
      method: 'POST',
      data,
    }),

  // 切换账号
  switchUser: (data: anyObj) =>
    http.request({
      url: '/personal/changeLoginAcc',
      method: 'POST',
      data,
    }),
}

export default userApi
