import { http } from './http'
import { only_last_id } from './only-last'
import { get } from './request'

const rankingApi = {
  /**
   * 获取排行榜情况
   */
  getRankList: async (params: anyObj) => {
    return await get('/intrudeLevel/rankList', params, {
      [only_last_id]: 'ranking_getRankList',
    })
  },

  /**
   * 查看个人信息
   */
  queryTargetUserIdInfo: async (id: any): Promise<any> => {
    return await get(`/personal/queryTargetUserIdInfo/${id}`)
  },

  /**
   * 操作点赞或取消点赞
   */
  operateLikeOrUnLike: (data: anyObj) => {
    return http.request({
      url: `/userLikeInfo/operateLikeOrUnLike`,
      data,
      method: 'POST',
    })
  },
}

export default rankingApi
