Files
front/src/api/message.ts

39 lines
735 B
TypeScript
Raw Normal View History

2026-03-05 23:45:39 +08:00
import axios from 'axios'
export interface MessageRecord {
id: number
type: string
title: string
subTitle: string
avatar?: string
content: string
time: string
status: 0 | 1
messageType?: number
}
export type MessageListType = MessageRecord[]
export function queryMessageList() {
return axios.post<MessageListType>('/api/message/list')
}
interface MessageStatus {
ids: number[]
}
export function setMessageStatus(data: MessageStatus) {
return axios.post<MessageListType>('/api/message/read', data)
}
export interface ChatRecord {
id: number
username: string
content: string
time: string
isCollect: boolean
}
export function queryChatList() {
return axios.post<ChatRecord[]>('/api/chat/list')
}