2025-06-30 19:40:25 +08:00
|
|
|
import request from '@/utils/request';
|
|
|
|
|
|
|
|
// 通知中心列表请求参数类型
|
|
|
|
export type NoticeListParams = {
|
|
|
|
pageNo: string;
|
|
|
|
pageSize: string;
|
2025-08-06 16:53:49 +08:00
|
|
|
columnType: string | undefined; // 可选参数,默认为 undefined
|
2025-06-30 19:40:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
// 通知中心记录类型
|
|
|
|
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',
|
|
|
|
});
|
|
|
|
}
|