Files
orion-visor/orion-visor-ui/src/api/asset/path-bookmark.ts

71 lines
1.5 KiB
TypeScript
Raw Normal View History

2024-04-24 13:39:21 +08:00
import { PathBookmarkGroupQueryResponse } from '@/api/asset/path-bookmark-group';
import axios from 'axios';
/**
*
*/
export interface PathBookmarkCreateRequest {
groupId?: number;
name?: string;
2024-04-24 16:43:59 +08:00
type?: string;
2024-04-24 13:39:21 +08:00
path?: string;
}
/**
*
*/
export interface PathBookmarkUpdateRequest extends PathBookmarkCreateRequest {
id?: number;
}
/**
*
*/
export interface PathBookmarkQueryResponse extends PathBookmarkQueryResponseExtra {
id: number;
groupId: number;
name: string;
2024-04-24 16:43:59 +08:00
type: string;
2024-04-24 13:39:21 +08:00
path: string;
}
export interface PathBookmarkQueryResponseExtra {
visible: boolean;
}
/**
*
*/
export interface PathBookmarkWrapperResponse {
groups: Array<PathBookmarkGroupQueryResponse>;
ungroupedItems: Array<PathBookmarkQueryResponse>;
}
/**
*
*/
export function createPathBookmark(request: PathBookmarkCreateRequest) {
return axios.post('/asset/path-bookmark/create', request);
}
/**
*
*/
export function updatePathBookmark(request: PathBookmarkUpdateRequest) {
return axios.put('/asset/path-bookmark/update', request);
}
/**
*
*/
export function getPathBookmarkList() {
return axios.get<PathBookmarkWrapperResponse>('/asset/path-bookmark/list');
}
/**
*
*/
export function deletePathBookmark(id: number) {
return axios.delete('/asset/path-bookmark/delete', { params: { id } });
}