import request from '@/utils/request'

// 获取版本号信息
// #ifdef APP || H5
export function getAppBBH(data) {
	return request({
		url: '/api/version',
		method: 'get',
		data
	});
}
// #endif


// 消息通知
export function articleList(data, id) {
	return request({
		url: '/api/article/list/' + id,
		method: 'get',
		data
	});
}

// 文章详细
export function details(data, id) {
	return request({
		url: '/api/article/details/' + id,
		method: 'get',
		data
	});
}
// 是否已读
export function notify_read(data) {
	return request({
		url: '/api/car/notify_read',
		method: 'post',
		data
	});
}
// 获取首页引导图
export function guide_map(data) {
	return request({
		url: '/api/guide_map',
		method: 'get',
		data
	});
}
//获取从业人员列表
export function getWorkerList(data) {
	return request({
		url: '/api/pub/getWorkerList',
		method: 'post',
		data
	});
}
//获取精选名片
export function getGoodWorkerList(data) {
	return request({
		url: '/api/pub/getGoodWorkerList',
		method: 'post',
		data
	});
}
//获取最新名片
export function getNewWorkerList(data) {
	return request({
		url: '/api/pub/getNewWorkerList',
		method: 'post',
		data
	});
}
//https://api.myjie.cn/api/pub/
export function getCardLookCountRank(data) {
	return request({
		url: '/api/pub/getCardLookCountRank',
		method: 'post',
		data
	});
}

export function getArtDetail(data) {
	return request({
		url: '/api/pub/getArtDetail',
		method: 'post',
		data
	});
}

export function getKcList(data) {
	return request({
		url: '/api/education/index',
		method: 'post',
		data
	});
}

export function recommend(data) {
	return request({
		url: '/api/education/recommend',
		method: 'post',
		data
	});
}

export function getCourseList(data) {
	return request({
		url: '/api/education/getCourseList',
		method: 'post',
		data
	})
}

/*
 * 贴子列表
 * @param {object} data
 * @param {number} data.page - 页码
 * @param {number} data.pageSize - 每页数量
 */
export function getPostList(data) {
	return request({
		url: '/api/forum/postList',
		method: 'get',
		params: data
	})
}

/*
 * 贴子详情
 * @param {object} data
 * @param {number} data.id - 贴子id
 */
export function getPostDetail(data) {
	return request({
		url: '/api/forum/postDetail?id=' + data.id,
		method: 'get',
	})
}

/*
 * 发送评价
 * @param {object} data
 * @param {number} data.post_id - 贴子id
 * @param {string} data.content - 评价内容
 * 
 */
export function addComment(data) {
	return request({
		url: '/api/forum/addComment',
		method: 'post',
		data
	})
}

/*
 *发帖
 * @param {object} data
 * @param {string} data.title - 标题
 * @param {string} data.content - 内容
 * @param {string} data.images - 图片
 */
export function addPost(data) {
	return request({
		url: '/api/forum/createPost',
		method: 'post',
		data
	})
}

/**
 * 删除评论
 * @param {object} data
 * @param {number} data.id - 评论id
 * @param {number} data.uid - 用户id
 * 
 */
export function deleteComment(data) {
	return request({
		url: '/api/forum/deleteComment',
		method: 'get',
		data
	})
}