/*
 * @Author: zc
 * @description 辅助功能-通知公告
 */
import request from '@/utils/request';
/**
 * @description 获取小红点计数
 * @param {object} params
 * @return {*}
 */
export const megcount = (params?: object) => {
	return request({
		url: '/api/v1/Article/megcount',
		method: 'get',
		params,
	});
};
/**
 * @description 获取我的通知列表
 * @param {object} params
 * @return {*}
 */
export const muquery = (params?: object) => {
	return request({
		url: '/api/v1/Article/circular/muquery',
		method: 'get',
		params,
	});
};
/**
 * @description 获取所有用户列表
 * @param {object} params
 * @return {*}
 */
export const getAllUsers = (params?: object) => {
	return request({
		url: '/api/v1/Article/alluser',
		method: 'get',
		params,
	});
};
/* ------------公告------ */
/**
 * @description 公告列表页基础信息
 * @param {object} params
 * @return {*}
 */
export const bulletinBaseData = (params?: object) => {
	return request({
		url: '/api/v1/Article/bulletin/listbasedata',
		method: 'get',
		params,
	});
};
/**
 * @description 查询公告列表
 * @param {object} params
 * @return {*}
 */
export const bulletinList = (params?: object) => {
	return request({
		url: '/api/v1/Article/bulletin/query',
		method: 'get',
		params,
	});
};
/**
 * @description 公告新增页基础信息
 * @param {object} params
 * @return {*}
 */
export const bulletinAddBaseData = (params?: object) => {
	return request({
		url: '/api/v1/Article/bulletin/addbasedata',
		method: 'get',
		params,
	});
};
/**
 * @description 新增公告
 * @param {object} data
 * @return {*}
 */
export const bulletinAdd = (data?: object) => {
	return request({
		url: '/api/v1/Article/bulletin/add',
		method: 'post',
		data,
	});
};
/**
 * @description 公告修改
 * @param {object} data
 * @return {*}
 */
export const bulletinUpdate = (data?: object) => {
	return request({
		url: '/api/v1/Article/bulletin/update',
		method: 'post',
		data,
	});
};
/**
 * @description 公告删除
 * @param {string} id
 * @return {*}
 */
export const bulletinDelete = (id: string) => {
	return request({
		url: `/api/v1/Article/bulletin/del/${id}`,
		method: 'get',
	});
}
/**
 * @description 公告上下架
 * @param {object} data
 */
export const bulletinPutAway = (data: object) => {
	return request({
		url: `/api/v1/Article/bulletin-arrive`,
		method: 'post',
		data,
	});
}
/**
 * @description 公告提交
 * @param {string} id
 * @return {*}
 */
export const bulletinCommit = (id: string) => {
	return request({
		url: `/api/v1/Article/bulletin/commit?id=${id}`,
		method: 'get',
	});
}
/**
 * @description 公告审核
 * @param {object} data
 * @return {*}
 */
export const bulletinAudit = (data: object) => {
	return request({
		url: `/api/v1/Article/bulletin/examine`,
		method: 'post',
		data,
	});
}
/**
 * @description 公告详情
 * @param {string} id
 * @return {*}
 */
export const bulletinDetail = (id: string | string[]) => {
	return request({
		url: `/api/v1/Article/bulletin/entity/${id}`,
		method: 'get',
	});
};

/*——————————通知——————————*/
/**
 * @description 通知列表页基础信息
 * @return {*}
 */
export const circularBaseData = () => {
	return request({
		url: '/api/v1/Article/circular/listbasedata',
		method: 'get',
	});
};
/**
 * @description 查询通知列表
 * @param {object} params
 * @return {*}
 */
export const circularList = (params?: object) => {
	return request({
		url: '/api/v1/Article/circular/query',
		method: 'get',
		params,
	});
};
/**
 * @description 通知新增基础数据
 * @param {object} params
 * @return {*}
 */
export const circularAddBaseData = (params?: object) => {
	return request({
		url: '/api/v1/Article/circular/addbasedata',
		method: 'get',
		params,
	});
};
/**
 * @description 通知详情
 * @param {string} id
 * @return {*}
 */
export const circularDetail = (id: string | string[]) => {
	return request({
		url: `/api/v1/Article/circular/entity/${id}`,
		method: 'get',
	});
};
/**
 * @description 通知阅读
 * @param {string} id
 * @return {*}
 */
export const circularRead = (id: string | string[]) => {
	return request({
		url: `/api/v1/Article/circular/read/${id}`,
		method: 'get',
	});
};
/**
 * @description 通知新增
 * @param {object} data
 * @return {*}
 */
export const circularAdd = (data: object) => {
	return request({
		url: '/api/v1/Article/circular/add',
		method: 'post',
		data,
	});
};
/**
 * @description 通知修改
 * @param {object} data
 * @return {*}
 */
export const circularUpdate = (data: object) => {
	return request({
		url: '/api/v1/Article/circular/update',
		method: 'post',
		data,
	});
};
/**
 * @description 通知删除
 * @param {string} id
 * @return {*}
 */
export const circularDelete = (id: string) => {
	return request({
		url: `/api/v1/Article/circular/del/${id}`,
		method: 'get'
	});
};

/**
 * @description 通知提交
 * @param {string} id
 * @return {*}
 */
export const circularCommit = (id: string) => {
	return request({
		url: `/api/v1/Article/circular/commit/${id}`,
		method: 'get',
	});
};
/**
 * @description 通知审核
 * @param {string} data
 * @return {*}
 */
export const circularAudit = (data: object) => {
	return request({
		url: `/api/v1/Article/circular/examine`,
		method: 'post',
		data
	});
}
