feat:【system】通知管理的开发:50% 初始化

This commit is contained in:
YunaiV
2025-12-20 21:07:28 +08:00
parent bf0bea0e8e
commit 257dbbea67
14 changed files with 1430 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
import type { PageParam, PageResult } from '@/http/types'
import { http } from '@/http/http'
/** 站内信消息 */
/** 站内信消息信息 */
export interface NotifyMessage {
id: number
userId: number
@@ -17,11 +17,26 @@ export interface NotifyMessage {
createTime?: Date
}
/** 查询站内信消息列表 */
export function getNotifyMessagePage(params: PageParam) {
return http.get<PageResult<NotifyMessage>>('/system/notify-message/page', params)
}
/** 查询站内信消息详情 */
export function getNotifyMessage(id: number) {
return http.get<NotifyMessage>(`/system/notify-message/get`, { id })
}
/** 获取我的站内信分页 */
export function getMyNotifyMessagePage(params: PageParam) {
return http.get<PageResult<NotifyMessage>>('/system/notify-message/my-page', params)
}
/** 获取我的站内信详情 */
export function getMyNotifyMessage(id: number) {
return http.get<NotifyMessage>(`/system/notify-message/get`, { id })
}
/** 批量标记站内信已读 */
export function updateNotifyMessageRead(ids: number | number[]) {
const idsArray = Array.isArray(ids) ? ids : [ids]

View File

@@ -0,0 +1,54 @@
import type { PageParam, PageResult } from '@/http/types'
import { http } from '@/http/http'
/** 站内信模板信息 */
export interface NotifyTemplate {
id?: number
name: string
nickname: string
code: string
content: string
type?: number
params?: string[]
status: number
remark?: string
createTime?: Date
}
/** 发送站内信请求 */
export interface NotifySendReqVO {
userId: number
userType: number
templateCode: string
templateParams: Record<string, any>
}
/** 查询站内信模板列表 */
export function getNotifyTemplatePage(params: PageParam) {
return http.get<PageResult<NotifyTemplate>>('/system/notify-template/page', params)
}
/** 查询站内信模板详情 */
export function getNotifyTemplate(id: number) {
return http.get<NotifyTemplate>(`/system/notify-template/get`, { id })
}
/** 新增站内信模板 */
export function createNotifyTemplate(data: NotifyTemplate) {
return http.post<number>('/system/notify-template/create', data)
}
/** 修改站内信模板 */
export function updateNotifyTemplate(data: NotifyTemplate) {
return http.put<boolean>('/system/notify-template/update', data)
}
/** 删除站内信模板 */
export function deleteNotifyTemplate(id: number) {
return http.delete<boolean>(`/system/notify-template/delete`, { id })
}
/** 发送站内信 */
export function sendNotify(data: NotifySendReqVO) {
return http.post<number>('/system/notify-template/send-notify', data)
}