add notify user

This commit is contained in:
Timi
2026-08-21 01:39:43 +08:00
parent 68d9946b70
commit 175838f7c5
2 changed files with 13 additions and 0 deletions
+8
View File
@@ -29,6 +29,13 @@ async function markInternalRead(id: string): Promise<void> {
}); });
} }
/** 删除当前用户的一条站内通知。 */
async function deleteInternal(id: string): Promise<void> {
await axios.post(`${BASE_URI}/delete`, undefined, {
params: { id }
});
}
/** 标记当前用户全部站内通知已读。 */ /** 标记当前用户全部站内通知已读。 */
async function markAllInternalRead(): Promise<void> { async function markAllInternalRead(): Promise<void> {
await axios.post(`${BASE_URI}/read/all`); await axios.post(`${BASE_URI}/read/all`);
@@ -39,5 +46,6 @@ export default {
listInternal, listInternal,
countUnreadInternal, countUnreadInternal,
markInternalRead, markInternalRead,
deleteInternal,
markAllInternalRead markAllInternalRead
}; };
+5
View File
@@ -1,4 +1,5 @@
import type { Model } from "./Model"; import type { Model } from "./Model";
import type { User } from "./User";
/** 通知消息类型 */ /** 通知消息类型 */
export type NotifyMsgType = "INTERNAL" | "SMS" | "MAIL" | "HTTP" | "WECHAT"; export type NotifyMsgType = "INTERNAL" | "SMS" | "MAIL" | "HTTP" | "WECHAT";
@@ -54,4 +55,8 @@ export type NotifyDetail = {
readAt?: number; readAt?: number;
/** 所属通知 */ /** 所属通知 */
notify?: Notify; notify?: Notify;
/** 发送用户 */
fromUser?: User;
/** 接收用户 */
toUser?: User;
} & Model; } & Model;