import request from '@/utils/request'
import qs from 'qs'

const GameApi = {
  getList: function getList(params) {
    return request({
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      url: '/game/log/list',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  del: function del(params) {
    return request({
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      url: '/game/log/delete',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  detail: function detail(params) {
    return request({
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      url: '/game/log/detail',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  playTimeDetail: function playTimeDetail(userId) {
    return request({
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      url: '/game/log/game_time/list',
      method: 'post',
      data: qs.stringify({ userId: userId })
    })
  },
  download: function download(params) {
    return request({
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      url: '/game/log/download',
      responseType: 'blob',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  deleteIds: function(params) {
    return request({
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      url: '/game/log/delete/ids',
      method: 'post',
      data: qs.stringify(params)
    })
  },
  gameConfig: function(params) {
    return request({
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      url: '/game/config/list/uid',
      method: 'post',
      data: qs.stringify(params)
    })
  }
}
export default GameApi

