import apiUrl from './api.js'
import request from '@/utils/chenzhenRequest.js'
const login = (param)=>{ 
	return request({
	    url: apiUrl.chenzhen.login,
	    method: 'post',
	    data: param
	})
}
const getCustomerInfo = (param)=>{ 
	return request({
	    url: apiUrl.chenzhen.getCustomerInfo,
	    method: 'get',
	    params: param
	})
}
const getPersonStatistics = (param)=>{ 
	return request({
	    url: apiUrl.chenzhen.getPersonStatistics,
	    method: 'get',
	    params: param
	})
}
const personTodo = (param)=>{ 
	return request({
	    url: apiUrl.chenzhen.personTodo,
	    method: 'get',
	    params: param
	})
}
const speechSort = (param)=>{ 
	return request({
	    url: apiUrl.chenzhen.speechSort,
	    method: 'get',
	    params: param
	})
}
const searchBiaoqingbao = (param)=>{
	return request({
		url:apiUrl.chenzhen.searchBiaoqingbao,
		method:'get',
		params:param
	})
}
const getScriptTags = (param)=>{
	return request({
		url:apiUrl.chenzhen.getScriptTags,
		method:'get',
		params:param
	})
}
const getScriptCatgary = (param)=>{
	return request({
		url:apiUrl.chenzhen.getScriptCatgary,
		method:'get',
		params:param
	})
}
const apis = [
	[apiUrl.chenzhen.speechSort],
	[apiUrl.chenzhen.getPersonStatistics],
	[apiUrl.chenzhen.personTodo],
	[apiUrl.chenzhen.findByMobile,'post']
]
const reMap = new Map()
const baseService = (()=>{
	for(let ap of apis){
		let temp = (param)=>{
			return request({
			    url: ap[0],
			    method: ap[1]||'get',
			    params: param
			})
		}
		reMap.set(ap[0],temp)
	}
	return reMap
})()
export  default {
	login,
	personTodo,
	baseService,
	getCustomerInfo,
	getPersonStatistics
}