| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /**
- * Generated by orval v7.0.1 🍺
- * Do not edit manually.
- * Serve API
- * Serve应用接口文档
- * OpenAPI spec version: 0.0.1-SNAPSHOT
- */
- import type {
- ResponseListNotificationVo,
- ResponseUnreadCountVo,
- ResponseVoid,
- } from "./models";
- import { customAxiosInstance } from "../util/axios-instance";
- export const getNotificationController = () => {
- /**
- * @summary 标记已读
- */
- const markRead = (id: number) => {
- return customAxiosInstance<ResponseVoid>({
- url: `/notifications/${id}/read`,
- method: "PUT",
- });
- };
- /**
- * @summary 获取通知列表
- */
- const listNotifications = () => {
- return customAxiosInstance<ResponseListNotificationVo>({
- url: `/notifications`,
- method: "GET",
- });
- };
- /**
- * @summary 获取未读数
- */
- const getUnreadCount = () => {
- return customAxiosInstance<ResponseUnreadCountVo>({
- url: `/notifications/unread-count`,
- method: "GET",
- });
- };
- return { markRead, listNotifications, getUnreadCount };
- };
- export type MarkReadResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getNotificationController>["markRead"]>>
- >;
- export type ListNotificationsResult = NonNullable<
- Awaited<
- ReturnType<
- ReturnType<typeof getNotificationController>["listNotifications"]
- >
- >
- >;
- export type GetUnreadCountResult = NonNullable<
- Awaited<
- ReturnType<ReturnType<typeof getNotificationController>["getUnreadCount"]>
- >
- >;
|