// 英文研报
import http from "@/api/http.js"

/**
 * 报告列表
 * @returns 
 * PageSize:
  CurrentIndex:1
  StartDate:
  EndDate:
  Frequency:
  ClassifyNameFirst:
  ClassifyNameSecond:
  State:
  KeyWord:
  CompanyType:
 */
export const reportList = params => {
  return http.get('/english_report/list',params)
}

/**
 * 新增研报
 * @returns 
 * "AddType": 1,
	"ClassifyIdFirst": 1,
	"ClassifyNameFirst": "一级分类名称",
	"ClassifyIdSecond": 2,
	"ClassifyNameSecond": "二级分类名称",
	"Title": "标题标题",
	"Abstract": "摘要摘要",
	"Author": "作者",
	"Frequency": "频度",
	"State": 1,
	"Content": "内容",
	"CreateTime": "2022-09-27 13:54:44"
 */
export const reportAdd = params => {
  return http.post('/english_report/add',params)
}

/**
 * 编辑研报
 * @returns 
 * "AddType": 1,
	"ClassifyIdFirst": 1,
	"ClassifyNameFirst": "一级分类名称",
	"ClassifyIdSecond": 2,
	"ClassifyNameSecond": "二级分类名称",
	"Title": "标题标题",
	"Abstract": "摘要摘要",
	"Author": "作者",
	"Frequency": "频度",
	"State": 1,
	"Content": "内容",
	"CreateTime": "2022-09-27 13:54:44"
 */
export const reportEdit = params => {
  return http.post('/english_report/edit',params)
}

/**
 * 报告详情
 * @returns ReportId
 */
export const reportDetail = params => {
  return http.get('/english_report/detail',params)
}

/**
 * 发布报告
 * @returns ReportIds
 */
export const reportPublish = params => {
  return http.post('/english_report/publish',params)
}

/**
 * 取消发布
 * @returns ReportIds
 */
export const reportCancelPublish = params => {
  return http.post('/english_report/publish/cancel',params)
}

/**
 * 删除报告
 * @returns ReportIds
 */
export const reportDel = params => {
  return http.post('/english_report/delete',params)
}

/**
 * 自动保存
 * @param {*} params 
 * "ReportId": 2783, 
  "Content": "231" 
 * @returns 
 */
export const reportAutoSave = params => {
  return http.post('/english_report/saveReportContent',params)
}

/**
 * 分类列表	
 * @param {*} params PageSize CurrentIndex
 * @returns 
 */
export const classifyList = params => {
	return http.get('/english_report/classify/list',params)
}

/**
 * 根据分类id获取报告
 * @param {*} params ClassifyIdFirst ClassifyIdSecond
 * @returns 
 */
export const reportDetailByclassify = params => {
	return http.get('/english_report/classifyIdDetail',params)
}

/**
 * 客户邮箱列表
 */
export const customEmailList=params=>{
	return http.get('/english_report/email/list',params)
}

/**
 * 删除客户邮箱
 */
export const delCustomEmail=params=>{
	return http.post('/english_report/email/del',params)
}

/**
 * 保存客户邮箱
 */
export const saveCustomEamil=params=>{
	return http.post('/english_report/email/save',params)
}

/**
 * 点击量
 */
export const PVDetailList=params=>{
	return http.get('/english_report/email/pv_list',params)
}

/**
 * 批量发送邮件
 */
export const sendCustomEmail=params=>{
	return http.post('/english_report/email/send',params)
}
/**
 * 研报标记状态
 * @param {*} params Status ReportId
 */
export const markReport=params => {
  return http.post('/english_report/mark',params)
}

/* 发送日志 */
export const logInterface = {
	/**
	 * 日志列表
	 * @param {*} params PageSize CurrentIndex ReportId
	 * SendStatus -1-已发送；0-发送失败；1-发送成功
	 * @returns 
	 */
	logList: params => {
		return http.get('/english_report/email/log_list',params)
	},

	/**
	 * 重新推送
	 * @param {*} params ReportId  SendId
	 * @returns 
	 */
	resend: params => {
		return http.post('/english_report/email/resend',params)
	}
}

/* 线上路演 */
export const videoENInterface={
	/**
	 * 视频列表
	 * CurrentIndex=1&PageSize=10&KeyWord=线上
	 * @returns 
	 */
	roadVideoList:params=>{
		return http.get('/english_report/video/list',params)
	},
	//保存视频
	roadVideoSave:params=>{
		return http.post('/english_report/video/save',params)
	},
	//发布视频
	roadVideoPublished:params=>{
		return http.post('/english_report/video/publish',params)
	},
	//取消发布视频
	roadVideoPublishedCancel:params=>{
		return http.post('/english_report/video/publish/cancel',params)
	},
	//删除视频
	roadDelVideo:params=>{
		return http.post('/english_report/video/delete',params)
	},
	/**
	 * 路演视频封面库
	 */
	videoCoverImgList:params=>{
		return http.get('/english_report/video/cover/list',params)
	},
	/**
	 * 新增/编辑视频封面
	 */
	videoCoverImgSave:params=>{
		return http.post('/english_report/video/cover/save',params)
	},
	//删除封面
	videoCoverImgDel:params=>{
		return http.post('/english_report/video/cover/delete',params)
	},

	//邮件群发
	videoEmailSend:params=>{
		return http.post('/english_report/email/video/send',params)
	}
}