Files
fe_portal_frontend/src/servers/api/notice.ts

77 lines
1.6 KiB
TypeScript
Raw Normal View History

import request from '@/utils/request';
// 通知中心列表请求参数类型
export type NoticeListParams = {
pageNo: string;
pageSize: string;
columnType: string | undefined; // 可选参数,默认为 undefined
};
// 通知中心记录类型
export type NoticeRecord = {
pageNo: null;
pageSize: null;
createBy: string;
createTime: string;
updateBy: string;
updateTime: string;
remark: null;
lastUpdateTime: string;
id: string;
title: string;
titleEn: string;
content: string;
contentEn: string;
settingEn: string;
columnType: string;
publishBy: string;
publishTime: string;
isTop: string;
status: string;
delFlag: string;
statusText: string;
};
// 通知中心列表响应类型
export type NoticeListResponse = {
records: NoticeRecord[];
total: number;
size: number;
current: number;
orders: string[];
optimizeCountSql: boolean;
hitCount: boolean;
countId: null;
maxLimit: null;
searchCount: boolean;
pages: number;
};
// 通知中心详情请求参数类型
export type NoticeDetailParams = {
id: string;
};
/**
*
* @param params
* @returns
*/
export async function getNoticeList(params: NoticeListParams) {
return request<API.APIResponse<NoticeListResponse>>('/homePage/getNoticePage', {
method: 'POST',
data: params,
});
}
/**
*
* @param id ID
* @returns
*/
export async function getNoticeDetail(id: string) {
return request<API.APIResponse<NoticeRecord>>(`/homePage/getNoticeInfo/${id}`, {
method: 'GET',
});
}