收藏主机.
This commit is contained in:
25
orion-ops-ui/src/api/meta/favorite.ts
Normal file
25
orion-ops-ui/src/api/meta/favorite.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export type FavoriteType = 'HOST'
|
||||
|
||||
/**
|
||||
* 收藏操作对象
|
||||
*/
|
||||
export interface FavoriteOperatorRequest {
|
||||
relId: number;
|
||||
type: FavoriteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加收藏
|
||||
*/
|
||||
export function addFavorite(request: FavoriteOperatorRequest) {
|
||||
return axios.put('/infra/favorite/add', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消收藏
|
||||
*/
|
||||
export function cancelFavorite(request: FavoriteOperatorRequest) {
|
||||
return axios.put('/infra/favorite/cancel', request);
|
||||
}
|
||||
33
orion-ops-ui/src/api/meta/tag.ts
Normal file
33
orion-ops-ui/src/api/meta/tag.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export type TagType = 'HOST'
|
||||
|
||||
/**
|
||||
* tag 创建对象
|
||||
*/
|
||||
export interface TagCreateRequest {
|
||||
name: number;
|
||||
type: TagType;
|
||||
}
|
||||
|
||||
/**
|
||||
* tag 响应对象
|
||||
*/
|
||||
export interface TagResponse {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建标签
|
||||
*/
|
||||
export function createTag(request: TagCreateRequest) {
|
||||
return axios.post('/infra/tag/create', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标签
|
||||
*/
|
||||
export function getTagList(type: TagType) {
|
||||
return axios.get<TagResponse>('/infra/tag/list', { params: { type } });
|
||||
}
|
||||
Reference in New Issue
Block a user