import {get, post} from '../http'
import {uploadImage, uploadImageOld} from './upload'
import setting from "../../settings.js"

const provider = {
  addServiceProvider: (params) => {
    return post('serviceProvider/addServiceProvider', params)
  },
  getServiceProviderPages: (params) => {
    return post('serviceProvider/getServiceProviderPages', params)
  },
  updateServiceProvider: (params) => {
    return post('serviceProvider/updateServiceProvider', params)
  },
  getServiceProviderInfo: (params) => {
    return get('serviceProvider/getServiceProviderInfo', params)
  },
  deleteProviderInfo: (params) => {
    return get('serviceProvider/delServiceProviderInfo', params)
  },
  getAllServiceProvider: (params) => {
    if (setting.projectName == "LUMI") {
      return get('dawn/api/v1/service-provider-select', params)
    } else {
      return get('serviceProvider/getAllServiceProviderList', params)
    }
  },
  uploadLogo: (data) => {
    return uploadImageOld(data, "SERVICE_LOGO")
  }
}

export default provider;