From 97c1f832dd42eb84af1f297fe57fab03a7b53f95 Mon Sep 17 00:00:00 2001 From: xingyuv Date: Mon, 20 Mar 2023 16:42:49 +0800 Subject: [PATCH] feat: notify --- src/api/system/notify/message/index.ts | 32 ++++++++++++++++++++++ src/api/system/notify/template/index.ts | 36 +++++++++++++++++++++++++ src/views/system/notify/my/index.vue | 3 +++ 3 files changed, 71 insertions(+) create mode 100644 src/api/system/notify/message/index.ts create mode 100644 src/api/system/notify/template/index.ts create mode 100644 src/views/system/notify/my/index.vue diff --git a/src/api/system/notify/message/index.ts b/src/api/system/notify/message/index.ts new file mode 100644 index 0000000..4d0a996 --- /dev/null +++ b/src/api/system/notify/message/index.ts @@ -0,0 +1,32 @@ +import { defHttp } from '@/utils/http/axios' +import qs from 'qs' + +// 获得站内信分页 +export const getPostPageApi = (params) => { + return defHttp.get({ url: '/system/notify-message/page', params }) +} + +// 获得我的站内信分页 +export const listSimplePostsApi = (params) => { + return defHttp.get({ url: '/system/notify-message/my-page', params }) +} + +// 批量标记已读 +export const updateNotifyMessageReadApi = (ids: number[]) => { + return defHttp.put({ url: '/system/notify-message/update-read?' + qs.stringify({ ids: ids }, { indices: false }) }) +} + +// 标记所有站内信为已读 +export const updateAllNotifyMessageReadApi = () => { + return defHttp.put({ url: '/system/notify-message/update-all-read' }) +} + +// 获取当前用户的最新站内信列表 +export const getUnreadNotifyMessageListApi = () => { + return defHttp.get({ url: '/system/notify-message/get-unread-list' }) +} + +// 获得当前用户的未读站内信数量 +export const getUnreadNotifyMessageCountApi = () => { + return defHttp.get({ url: '/system/notify-message/get-unread-count' }) +} diff --git a/src/api/system/notify/template/index.ts b/src/api/system/notify/template/index.ts new file mode 100644 index 0000000..7b62637 --- /dev/null +++ b/src/api/system/notify/template/index.ts @@ -0,0 +1,36 @@ +import { defHttp } from '@/utils/http/axios' + +// 创建站内信模板 +export const createNotifyTemplateApi = (data) => { + return defHttp.post({ url: '/system/notify-template/create', data }) +} + +// 更新站内信模板 +export const updateNotifyTemplateApi = (data) => { + return defHttp.put({ url: '/system/notify-template/update', data }) +} + +// 删除站内信模板 +export const deleteNotifyTemplateApi = (id: number) => { + return defHttp.delete({ url: '/system/notify-template/delete?id=' + id }) +} + +// 获得站内信模板 +export const getNotifyTemplateApi = (id: number) => { + return defHttp.get({ url: '/system/notify-template/get?id=' + id }) +} + +// 获得站内信模板分页 +export const getNotifyTemplatePageApi = (params) => { + return defHttp.get({ url: '/system/notify-template/page', params }) +} + +// 获取岗位精简信息列表 +export const listSimplePostsApi = () => { + return defHttp.get({ url: '/system/post/list-all-simple' }) +} + +// 导出站内信模板 Excel +export const exportNotifyTemplateExcelApi = (params) => { + return defHttp.download({ url: '/system/notify-template/export-excel', params }, '导出站内信模板.xls') +} diff --git a/src/views/system/notify/my/index.vue b/src/views/system/notify/my/index.vue new file mode 100644 index 0000000..83cefa1 --- /dev/null +++ b/src/views/system/notify/my/index.vue @@ -0,0 +1,3 @@ +