收藏主机.

This commit is contained in:
lijiahang
2023-09-14 16:18:41 +08:00
parent 08f9b9410b
commit f8b694c16a
13 changed files with 386 additions and 74 deletions

View 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);
}

View 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 } });
}