import http from "@/api/http.js"

export default {
	/**
	 * 保存沙盘 新增or编辑
	 * @param {*} params 
	 * @param {SandboxId} params 
	 * @param {Name} params 
	 * @param {ChartPermissionId} params 
	 * @param {Content} params 
	 * @param {PicUrl} params 
	 * @returns 
	 */
	sandSave: params => {
		return http.post('/sandbox/save',params)
	},

	/**
	 * 保存草稿
	 * @param {*} params 
	 * @param {SandboxId} params 
	 * @param {Name} params 
	 * @param {ChartPermissionId} params 
	 * @param {Content} params 
	 * @returns 
	 */
	draftSave: params => {
		return http.post('/sandbox/draft/add',params)
	},
	/**
	 * 沙盘列表
	 * @param {PageSize} params 
	 * @param {CurrentIndex} params
	 * @param {Keyword} params 
	 * @param {ChartPermissionId} params 
	 * @returns 
	 */
	sandlist: params => {
		return http.get('/sandbox/list',params)
	},

	/**
	 * 沙盘列表 添加、编辑 研报（周报晨报）、PPT 用到，可以根据品种名称搜索
	 * @param {PageSize} params 
	 * @param {CurrentIndex} params
	 * @param {Keyword} params  支持沙盘图名称和品种名称搜索
	 * @returns 
	 */
	 sandlistByQuote: params => {
		return http.get('/sandbox/list_by_quote',params)
	},
	/**
	 * 标记编辑状态
	 * @param {SandboxId} params 
	 * @param {Status} params 
	 * @returns 
	 */
	mark: params => {
		return http.post('/sandbox/mark',params)
	},
	
	/**
	 * 获取最新沙盘对应数据
	 * @param {SandboxId} params 
	 * @returns 
	 */
	sandData: params => {
		return http.get('/sandbox/last_info',params)
	},

	/**
	 * 获取版本对应数据
	 * @param {SandboxVersionCode} params 
	 * @returns 
	 */
	versionData: params => {
		return http.get('/sandbox/version/detail',params)
	},

	/**
	 * 历史版本列表
	 * @param {PageSize} params 
	 * @param {CurrentIndex} params 
	 * @param {SandboxId} params 
	 */
	verisonlist: params => {
		return http.get('/sandbox/version/list',params)
	},

	/**
	 * 前3个历史版本
	 * @param {SandboxId} params
	 * @returns 
	 */
	childList: params => {
		return http.get('/sandbox/version/first_list',params)
	},

	/**
	 * 删除沙盘
	 * @param {SandboxId} params 
	 * @returns 
	 */
	sanDelete: params => {
		return http.post('/sandbox/delete',params)
	},

	/**
	 * 取消保存草稿
	 * @param {SandboxId} params 
	 */
	cancelSave: params => {
		return http.post('/sandbox/draft/reset',params)
	},

	/**
	 * 删除版本 SandboxVersionCode
	 * @param {*} params 
	 * @returns 
	 */
	sandDelVersion: params => {
		return http.post('/sandbox/version/delete',params)
	}

}