* 新增自适应数值与窗口分析工具,提升交互体验 * 优化回收站模块逻辑,增加展示与选择功能 * 引入 Macaron 主题配置文件并更新 Tailwind 配置 * 精简基础组件代码,移除冗余样式与设置项 * 完善测试用例,覆盖 UI 系统与回收站工作流 * 更新多语言配置,支持功能变更后的文案需求
24 lines
901 B
TypeScript
24 lines
901 B
TypeScript
import api from './client'
|
|
import type { ApiResponse, TrashListParams, TrashListResponse, TrashRetentionRequest, TrashBatchRequest, TrashBatchResult } from '@/types'
|
|
|
|
export class TrashService {
|
|
static async list(params: TrashListParams): Promise<ApiResponse<TrashListResponse>> {
|
|
return api.get('/admin/trash/list', { params })
|
|
}
|
|
|
|
static async restore(id: number): Promise<ApiResponse> {
|
|
return api.post('/admin/trash/restore', { id })
|
|
}
|
|
|
|
static async purge(id: number): Promise<ApiResponse> {
|
|
return api.delete('/admin/trash/purge', { data: { id } })
|
|
}
|
|
|
|
static async updateRetention(id: number, retention: TrashRetentionRequest): Promise<ApiResponse> {
|
|
return api.post('/admin/trash/retention', { id, ...retention })
|
|
}
|
|
static async batch(request: TrashBatchRequest): Promise<ApiResponse<TrashBatchResult>> {
|
|
return api.post('/admin/trash/batch', request)
|
|
}
|
|
}
|