think/packages/domains/src/api/message.ts

40 lines
709 B
TypeScript
Raw Normal View History

2022-05-23 05:05:59 +00:00
import { IMessage } from '../models';
export const MessageApiDefinition = {
/**
*
*/
getUnread: {
method: 'Get' as const,
server: 'unread' as const,
client: () => '/message/unread',
},
/**
*
*/
getRead: {
method: 'Get' as const,
server: 'read' as const,
client: () => '/message/read',
},
/**
*
*/
getAll: {
method: 'Get' as const,
server: 'all' as const,
client: () => '/message/all',
},
/**
*
*/
readMessage: {
method: 'Post' as const,
server: 'read/:id' as const,
client: (id: IMessage['id']) => `/message/read/${id}`,
},
};