import request from '@/utils/httpRequest'

export default class PostService {
  list (params) {
    console.log(params)
    return request({
      url: '/sys/loginUserOnline/list',
      method: 'get',
      params: params
    })
  }
  queryById (id) {
    return request({
      url: '/sys/project/queryById',
      method: 'get',
      params: {id: id}
    })
  }
  save (inputForm) {
    return request({
      url: `/sys/project/save`,
      method: 'post',
      data: inputForm
    })
  }
  delete (tokenId, loginName) {
    return request({
      url: '/sys/loginUserOnline/delete',
      method: 'delete',
      params: {
        tokenId: tokenId,
        loginName: loginName
      }
    })
  }

  importExcel (data) {
    return request({
      url: '/sys/project/import',
      method: 'post',
      data: data
    })
  }
  exportTemplate () {
    return request({
      url: '/sys/project/import/template',
      method: 'get',
      responseType: 'blob'
    })
  }
  exportExcel (params) {
    return request({
      url: '/sys/project/export',
      method: 'get',
      params: params,
      responseType: 'blob'
    })
  }
  proportion (params) {
    return request({
      url: '/sys/project/proportion',
      method: 'get',
      params: params
    })
  }
  fileUploadList (params) {
    return request({
      url: '/sys/project/exportFileUploadList',
      method: 'get',
      params: params,
      responseType: 'blob'
    })
  }
}
