Переглянути джерело

chore(api): 添加站内通知相关接口

wangshun 2 тижнів тому
батько
коміт
3a6e069eb3
2 змінених файлів з 33 додано та 0 видалено
  1. 17 0
      src/api/index.ts
  2. 16 0
      src/types/index.ts

+ 17 - 0
src/api/index.ts

@@ -76,6 +76,7 @@ import type {
   MonitoringForm,
   MonitorPointInfo,
   MonitorPointItem,
+  NoticePageItemData,
   Organization,
   OrganizationItem,
   OutdooForm,
@@ -1032,6 +1033,22 @@ export const groupList = async (listInfo: ListInfo) => {
   return data;
 };
 
+// 站内通知
+export const getUnreadNotifications = async () => {
+  const data = await request<number>(apiBiz('/stationNotify/leftSize'), {
+    method: 'POST',
+  });
+  return data;
+};
+
+export const getNoticePageList = async (params: PageParams) => {
+  const data = await request<NoticePageItemData>(apiBiz('/stationNotify/getPageList'), {
+    method: 'POST',
+    body: JSON.stringify(params),
+  });
+  return data;
+};
+
 // 组态
 
 export const getGroupModuleInfo = async (params: GroupModuleQuery) => {

+ 16 - 0
src/types/index.ts

@@ -2316,3 +2316,19 @@ export interface CharacterPageItem {
   defaultRole: string;
   remark: string;
 }
+
+export type NoticePageItemData = PageData<NoticePageItem>;
+export interface NoticePageItem {
+  id: number;
+  createTime: string;
+  updateTime: string;
+  createUserId: number;
+  updateUserId: number;
+  orgId: number;
+  userId: number;
+  type: number;
+  targetId: number;
+  devGroupId: number;
+  content: string;
+  readStatus: boolean;
+}