import Mock from 'mockjs'
import { login, logout, getUserInfo } from './login'
import { getTableData, getDragList, uploadImage } from './data'
import { getMessageInit, getContentByMsgId, hasRead, removeReaded, restoreTrash, messageCount } from './user'
import { GetAtomicCounter } from './atomicCounter'
import sourcePackage from './sourcePackage'
import session from './session'
import transmit from './transmit'
import unificationSend from './unificationSend'

// 配置Ajax请求延时，可用来测试网络延迟大时项目中一些效果
Mock.setup({
  timeout: 1000
})

// 登录相关和获取用户信息
Mock.mock(/\/login/, login)
Mock.mock(/\/get_info/, getUserInfo)
Mock.mock(/\/logout/, logout)
Mock.mock(/\/get_table_data/, getTableData)
Mock.mock(/\/get_drag_list/, getDragList)
Mock.mock(/\/save_error_logger/, 'success')
Mock.mock(/\/image\/upload/, uploadImage)
Mock.mock(/\/message\/init/, getMessageInit)
Mock.mock(/\/message\/content/, getContentByMsgId)
Mock.mock(/\/message\/has_read/, hasRead)
Mock.mock(/\/message\/remove_readed/, removeReaded)
Mock.mock(/\/message\/restore/, restoreTrash)
Mock.mock(/\/message\/count/, messageCount)

Mock.mock(/\/AtomicCounter\/GetAtomicCounter/, GetAtomicCounter)

Mock.mock(/\/SourcePackage\/Add/, sourcePackage.Add)
Mock.mock(/\/SourcePackage\/Remove/, sourcePackage.Remove)
Mock.mock(/\/SourcePackage\/GetAll/, sourcePackage.GetAll)

Mock.mock(/\/Session\/RemoveByTerminalPhoneNo/, session.RemoveByTerminalPhoneNo)
Mock.mock(/\/Session\/RemoveByChannelId/, session.RemoveByChannelId)
Mock.mock(/\/Session\/GetAll/, session.GetAll)

Mock.mock(/\/Transmit\/Add/, transmit.Add)
Mock.mock(/\/Transmit\/Remove/, transmit.Remove)
Mock.mock(/\/Transmit\/GetAll/, transmit.GetAll)

Mock.mock(/\/UnificationSend\/SendText/, unificationSend.SendText)

export default Mock
