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: {
2022-05-23 08:20:56 +00:00
method: 'get' as const,
2022-05-23 05:05:59 +00:00
server: 'unread' as const,
client: () => '/message/unread',
},
/**
*
*/
getRead: {
2022-05-23 08:20:56 +00:00
method: 'get' as const,
2022-05-23 05:05:59 +00:00
server: 'read' as const,
client: () => '/message/read',
},
/**
*
*/
getAll: {
2022-05-23 08:20:56 +00:00
method: 'get' as const,
2022-05-23 05:05:59 +00:00
server: 'all' as const,
client: () => '/message/all',
},
/**
*
*/
readMessage: {
2022-05-23 08:20:56 +00:00
method: 'post' as const,
2022-05-23 05:05:59 +00:00
server: 'read/:id' as const,
client: (id: IMessage['id']) => `/message/read/${id}`,
},
};