/** * 档案知识中心 API —— 统一档案/企业知识库(分类归档 + 关键字检索)。 * Wraps /api/oa/archives. */ import { http } from './http' export interface Archive { id: number category: string title: string sourceType: string sourceId: number | null fileName: string fileType: string fileSize: number uploader: string archiveDate: string tags: string summary: string /** 访问权限:公开/内部/机密。 */ accessLevel?: string /** 预览地址(占位)。 */ fileUrl?: string /** 关联的真实文件 (StoredFile.id),有值时可在线真渲染预览。 */ storedFileId?: number | null createdAt: string } /** GET /archives[?category=&keyword=] */ export function listArchives(filter?: { category?: string; keyword?: string }): Promise { return http.get('/archives', filter) } /** GET /archives/{id} */ export function getArchive(id: number | string): Promise { return http.get(`/archives/${encodeURIComponent(String(id))}`) } /** POST /archives — 手动归档。 */ export function createArchive(input: Partial): Promise { return http.post('/archives', input) }