
/**
 * Web唐明明
 * 匆匆数载恍如梦，岁月迢迢华发增。
 * 碌碌无为枉半生，一朝惊醒万事空。
 * moduleName: 转让市场
 */

import { request } from '../index'

// 转让市场
const markets = data => {
	return request({
		url: 'markets',
		data
	})
}

// 转让市场记录
const marketsLogs = data => {
	return request({
		url: 'markets/orders',
		data
	})
}

// 转让详情
const marketsInfo = id => {
	return request({
		url: 'markets/' + id
	})
}

// 提交支付订单
const marketsBuy = (id, data) => {
	return request({
		url: 'markets/' + id + '/create',
		method: 'POST',
		data
	})
}

// 转让市场支付
const marketsPay = (id, platform) => {
	return request({
		url: 'markets/pay/' + id + '/' + platform
	})
}

// 转让权证信息
const marketsCreateInfo = symbol => {
	return request({
		url: 'markets/user/markets/create',
		data: { symbol }
	})
}

// 提交权证转让
const marketsCreate = data => {
	return request({
		url: 'markets/user/markets/create',
		method: 'POST',
		data
	})
}

// 转让管理
const marketsMag = data => {
	return request({
		url: 'markets/user/markets',
		data
	})
}

// 取消转让
const marketsCancel = id => {
	return request({
		url: 'markets/' + id + '/cancel',
		method: 'POST'
	})
}

// 我的成交理事
const marketsOrdersLogs = (data, name) => {
	return request({
		url: 'markets/orders/' + name,
		data
	})
}

export {
	markets,
	marketsLogs,
	marketsInfo,
	marketsBuy,
	marketsPay,
	marketsCreateInfo,
	marketsCreate,
	marketsMag,
	marketsCancel,
	marketsOrdersLogs
}
