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

//  const userLogin = params => { return http.post('/login',params); };  //系统用户登录
 const userLogin = params => { return http.post('/sysuser/login',params); };  //系统用户登录
//  const modifyPwd = params => { return http.post('/modifyPwd',params); };  //修改密码
 const modifyPwd = params => { return http.post('/sysuser/modify/pwd',params); };  //修改密码
 const checkPwd = params => { return http.get('/sysuser/check_pwd'); };  //判断是否为初始密码

 const reportlist = params => { return http.get('/report/list',params); };  //获取报告列表
 const reportpublish = params => { return http.post('/report/publish',params); };  //批量发布报告
 const reportpublishcancle = params => { return http.post('/report/publish/cancle',params); };  //取消发布报告
 const voiceupload = params => { return http.post('/voice/upload',params); };  //上传音频
 const resourceVoiceupload = params => { return http.post('/resource/voice/upload',params); };  //上传音频
 const reportadd = params => { return http.post('/report/add',params); };  //新增报告
 const reportedit = params => { return http.post('/report/edit',params); };  //编辑报告
 const reportdelete = params => { return http.post('/report/delete',params); };  //删除报告
 const reportdetail = params => { return http.get('/report/detail',params); };  //获取报告详情
 const classifyIdDetail = params => { return http.get('/report/classifyIdDetail',params); };  //通过二级分类id获取报告详情
 const sendTemplateMsg = params => { return http.post('/report/sendTemplateMsg',params); };  //推送消息
 const reportauthor = params => { return http.get('/report/author',params); };  //获取作者
 const getDraft = params => { return http.get('/report/getDraft',params); };  //获取草稿
 const autosave = params => { return http.post('/report/saveReportContent',params); };  //保存

 const classifylist = params => { return http.get('/classify/list',params); };  //获取分类列表
 const classifyparent = params => { return http.get('/classify/parent',params); };  //获取父级分类
 const classifyadd = params => { return http.post('/classify/add',params); };  //新增分类
 const classifydelete = params => { return http.post('/classify/delete',params); };  //删除分类
 const classifyedit = params => { return http.post('/classify/edit',params); };  //编辑分类
 const checkDeleteClassify = params => { return http.get('/classify/checkDeleteClassify',params); };  //检测分类
 const classifyTelList = params=>{return http.get('/classify/tel_list',params)};//电话会分类

 const bannerlist = params => { return http.get('/banner/list',params); };  //获取banner列表
 const bannerupload = params => { return http.post('/banner/upload',params); };  //上传banner图
 const banneradd = params => { return http.post('/banner/add',params); };  //新增banner
 const banneredit = params => { return http.post('/banner/edit',params); };  //编辑banner
 const bannerdelete = params => { return http.post('/banner/delete',params); };  //删除banner
 const getUserUuid=()=>{return http.get('/sysuser/uuid',{})}//获取用户uuid

/* ppt */
const pptlist = params => { 
	return http.get('/ppt/list',params); 
};  //获取ppt列表
const pptadd = params => { 
	return http.post('/ppt/add',params); 
};  //新增ppt
const pptdetail = params => { 
	return http.get('/ppt/detail',params); 
};  //获取ppt详情
const pptedit = params => { 
	return http.post('/ppt/edit',params); 
};  //编辑ppt
const pptdelete = params => { 
	return http.post('/ppt/delete',params); 
};  //删除ppt
const base64Upload = params => { 
	return http.post('/ppt/base64Upload',params); 
};  //上传base64图片 img	是	string	图片base64字符串
/* ppt上传 */
const pptUpload = params => { 
	return http.post('/ppt/base64Upload/batch',params);
}

/* resource_id	是	int	策略组提供的资源id
ppt_id */
/* 获取首页背景 */
const firstBg = params => {
	return http.get('/ppt/getImages',params)
}
/* 发布 ppt_id	是	int */
const pptPublish = params => {
	return http.post('/ppt/publish',params)
}

/* 客群消息推送接口 */
const messagePushPost= params => {
	return http.post('/report/ths/sendTemplateMsg',params)
}

// 晨周报章节类型列表
const dayWeekReportChapterList=params=>{
	return http.get('/report/getDayWeekReportChapterTypeList',params)
}

//新增晨周报
const addDayWeekReport=params=>{
	return http.post('/report/addDayWeekReport',params)
}

//编辑晨周报
const editDayWeekReport=params=>{
	return http.post('/report/editDayWeekReport',params)
}

// 晨周报章节列表
const dayWeekChapterList=params=>{
	return http.get('/report/getReportChapterList',params)
}

//章节标签列表
const chapterTrendTagList=()=>{
	return http.get('/report/getChapterTrendTag',{})
}

//编辑章节标签
const editChapterTrendTag=params=>{
	return http.post('/report/editChapterTrendTag',params)
}

//晨报周报章节详情
const chapterDetail=params=>{
	return http.get('/report/getDayWeekChapter',params)
}

//晨报数据指标列表
const dayTicketList=params=>{
	return http.get('/report/getDayReportTickerList',params)
}

//保存晨报周报章节报告
const saveChapterReport=params=>{
	return http.post('/report/editDayWeekChapter',params)
}

//获取晨报/周报上一篇内容
const getChapterReportBefore=params=>{
	return http.get('/report/getLastDayWeekReportChapter',params)
}

//判断晨报周报当前章节是否为最后一篇发布的
const getChapterReportIsLast=params=>{
	return http.get('/report/isLastDayWeekReportChapter',params)
}

//发布晨报周报章节
const publishChapterReport=params=>{
	return http.post('/report/publishDayWeekReportChapter',params)
}

//发布晨报周报
const publishDayOrWeekReport=params=>{
	return http.post('/report/publishDayWeekReport',params)
}

//晨报周报更新暂停的时间
const dayWeekPauseTime=params=>{
	return http.get('/report/getDayWeekReportPauseTime',{})
}

//晨报周报设置更新规则
const dayWeekUpdateRule=params=>{
	return http.post('/report/setDayWeekReportUpdateRule',params)
}

// 周报校验音频
const weekReportValidAudio=params=>{
	return http.get('/report/CheckDayWeekReportChapterVideo',params)
}


const chapterQRCodeImg=params=>{
	return http.post('/report/getSunCode',params)
}
//上传阿里云 oss获取临时票据
const getOSSSign=()=>{
	return http.get('/resource/oss/get_sts_token',{})
}

/* 推送客户群设置 */
// 获取待推送报告类型
/**
 * @returns 
 * List - 报告类型列表
 * 
 */
const getBeingPushedReportType=()=>{
	return http.get('/yb/ths_send/report_type',{})
}
// 获取待推送列表
/**
 * 
 * @param {
 * Title 推送标题
 * ReportType 内容类型
 * CreateTimeStart 创建开始日期
 * CreateTimeEnd 创建结束日期
 * PushTimeStart 推送开始日期
 * PushTimeEnd 推送结束日期
 * PageSize 每页条数
 * CurrentIndex 当前页数
 * } params 
 * @returns 
 */
const getBeingPushedReportList=params=>{
	return http.get('/yb/ths_send/list',params)
}
// 设置推送时间
/** 
 * @param {
 * SendId 序号
 * PushTime 新的推送时间
 * } params 
 * @returns 
 */
const setPushingTime=params=>{
	return http.post('/yb/ths_send/modify_push_time',params)
}

//研报标记状态
/**
 * 
 * @param {
 * Status 编辑状态
 * ReportId 报告ID
 * } params
 * @returns 
 */
const markReport = params =>{
  return http.post('/report/mark',params)
}

// 获取章节类型列表
/**
 * @param params.ReportType Enum-报告类型：day-晨报；week-周报
 * @param params.PageSize Integer-每页条数
 * @param params.CurrentIndex Integer-当前页数
 * @returns 章节类型列表
 */
const getchapterTypeList=params=>{
 return http.get('/report/chapter_type/list',params)
}

// 新增章节类型
/**
 * @param params.ReportChapterTypeName String-章节名称
 * @param params.Sort Integer-排序
 * @param params.ReportType Enum-报告类型：day-晨报；week-周报
 * @param params.SelectedImage String-选中的icon
 * @param params.UnselectedImage String-未选中的icon
 * @param params.WordsImage String-带字的icon
 * @param params.EditImgUrl String-后台-章节列表封面图
 * @param params.IsShow Enum-小程序端是否展示：0-隐藏；1-显示
 */
const addChapterType=params=>{
	return http.post('/report/chapter_type/add',params)
 }

 // 编辑章节类型
/**
 * @param params.ReportChapterTypeId Integer-章节ID
 * @param params.ReportChapterTypeName String-章节名称
 * @param params.Sort Integer-排序
 * @param params.ReportType Enum-报告类型：day-晨报；week-周报
 * @param params.SelectedImage String-选中的icon
 * @param params.UnselectedImage String-未选中的icon
 * @param params.WordsImage String-带字的icon
 * @param params.EditImgUrl String-后台-章节列表封面图
 * @param params.IsShow Enum-小程序端是否展示：0-隐藏；1-显示
 */
const editChapterType=params=>{
	return http.post('/report/chapter_type/edit',params)
 }
 
// 删除章节
/**
 * @param params.ReportChapterTypeId Integer-章节ID
 */
const deleteChapterType=params=>{
	return http.post('/report/chapter_type/del',params)
}

// 获取章节类型的权限列表
/**
 * @param params.ReportChapterTypeId Integer-章节ID
 * @returns 权限列表
 */
const getchapterTPermissionList=params=>{
	return http.get('/report/chapter_type/permission_list',params)
 }

// 设置章节类型的权限
/**
 * @param params.ReportChapterTypeId Integer-章节ID
 * @param params.ChartPermissionIdList Array<Integer>-权限IDs
 */
const setchapterTPermission=params=>{
	return http.post('/report/chapter_type/auth_setting',params)
}

// 同时推送客群和模板消息
const reportMessageSend=params=>{
	return http.post('/report/sendMsg',params)
}

export {
	userLogin,
	modifyPwd,
	checkPwd,
	reportlist,
	reportpublish,
	reportpublishcancle,
	voiceupload,
	resourceVoiceupload,
	reportadd,
	reportedit,
	reportdelete,
	reportdetail,
	classifyIdDetail,
	sendTemplateMsg,
	reportauthor,
	getDraft,
	autosave,
	classifylist,
	classifyparent,
	classifyadd,
	classifydelete,
	classifyedit,
	checkDeleteClassify,
	bannerlist,
	bannerupload,
	banneradd,
	banneredit,
	bannerdelete,
	pptlist,
	pptadd,
	pptdetail,
	pptedit,
	pptdelete,
	base64Upload,
	pptUpload,
	firstBg,
	pptPublish,
	messagePushPost,
	dayWeekReportChapterList,
	addDayWeekReport,
	dayWeekChapterList,
	chapterTrendTagList,
	editChapterTrendTag,
	editDayWeekReport,
	chapterDetail,
	dayTicketList,
	saveChapterReport,
	getChapterReportBefore,
	getChapterReportIsLast,
	publishChapterReport,
	publishDayOrWeekReport,
	dayWeekPauseTime,
	dayWeekUpdateRule,
	chapterQRCodeImg,
	getOSSSign,
  classifyTelList,
	getBeingPushedReportType,
	getBeingPushedReportList,
	setPushingTime,
  markReport,
	getchapterTypeList,
	addChapterType,
	editChapterType,
	deleteChapterType,
	getchapterTPermissionList,
	setchapterTPermission,
	reportMessageSend,
	weekReportValidAudio,
	getUserUuid
}