import request from './request' import type { PageResult } from './types' /** 版本资源元数据 */ export interface VersionResource { id?: number processNo?: string title: string clcCode?: string keywords?: string summary?: string publishYear?: string processDate?: string contentForm?: string mediaType?: string format?: string pageCount?: string language?: string submitOrg?: string taskYear?: string sourceLibrary?: string sourceLibraryAddr?: string fulltextUrl?: string otherTitle?: string author?: string responsibility?: string publisher?: string publishPlace?: string publishDate?: string edition?: string isbn?: string governStatus?: string mergedToId?: number abnormalFlag?: number sensitiveFlag?: number /** 是否特藏版本:0否 1是 */ isSpecial?: number /** 附注 */ note?: string } export interface ResourceQuery { current?: number size?: number title?: string author?: string clcCode?: string mediaType?: string sourceLibrary?: string publishYear?: string governStatus?: string } /** 分页查询版本资源 */ export function pageResource(params: ResourceQuery) { return request.get>('/resource/page', { params }) } /** 查询单条 */ export function getResource(id: number) { return request.get(`/resource/${id}`) } /** 新增或更新 */ export function saveResource(data: VersionResource) { return request.post('/resource', data) } /** 删除 */ export function removeResource(id: number) { return request.delete(`/resource/${id}`) } /** 设置是否特藏版本(0否 1是) */ export function updateSpecialFlag(id: number, isSpecial: number) { return request.put(`/resource/${id}/special`, null, { params: { isSpecial } }) }