Files
Situation-Awareness-Platfor…/src/api/jyh/index.ts

159 lines
2.9 KiB
TypeScript
Raw Normal View History

2025-03-18 17:13:54 +08:00
import { reqCatchV2, type catchRt } from '@/utils/catch';
import request from '@/utils/request';
// 详情-获取版本信息
2025-03-19 10:08:49 +08:00
export function releaseInfo(params: { softwareId: string }): Promise<any> {
const { softwareId } = params;
return request({
url: `/api/v1/repo/release/info?softwareId=${softwareId}`,
method: 'get'
});
}
2025-03-18 20:20:37 +08:00
// 详情-搜索结果列表
export function releasePage(data): Promise<any> {
return request({
url: `/api/v1/repo/release/page`,
method: 'post',
data
});
}
2025-03-18 19:51:01 +08:00
// 获取邀请列表
2025-03-18 17:13:54 +08:00
export function getInviteListData(): catchRt<any> {
2025-03-19 10:08:49 +08:00
return reqCatchV2(() =>
request(
{
url: '/api/v1/group/member/invite/list',
method: 'get'
},
{
customError: true
}
)
);
2025-03-18 17:13:54 +08:00
}
2025-03-18 19:51:01 +08:00
// 处理邀请
2025-03-18 17:13:54 +08:00
export function acceptInvite(params): catchRt<any> {
2025-03-19 10:08:49 +08:00
return reqCatchV2(() =>
request(
{
url: '/api/v1/group/member/invite/accept',
method: 'post',
data: params
},
{
customError: true
}
)
);
2025-03-18 17:13:54 +08:00
}
2025-03-18 19:51:01 +08:00
// 发送订阅
export function subscribeSoftware(params): catchRt<any> {
2025-03-19 10:08:49 +08:00
return reqCatchV2(() =>
request(
{
url: '/api/v1/alert/subscribe',
method: 'post',
data: params
},
{
customError: true
}
)
);
2025-03-18 19:51:01 +08:00
}
2025-03-18 20:20:37 +08:00
// 获取高级筛选语言列表
export function searchLanguageList() {
return request({
url: `/api/v1/repo/lan/list`,
method: 'get'
});
}
// 获取首页公告列表
export function getHomeNoticeList() {
return request({
url: '/api/v1/home/notice/list',
method: 'get',
params: {}
});
}
// 获取依赖关系列表
export function getDepencyList(softwareId: string) {
return request({
2025-03-18 22:01:02 +08:00
url: '/api/v1/repo/dependency/info',
method: 'POST',
2025-03-19 10:08:49 +08:00
data: {
2025-03-18 22:01:02 +08:00
softwareId: 47,
current: 1,
size: 20
}
2025-03-18 20:20:37 +08:00
});
}
// 获取AI修复建议
export function getRepairInfo() {
return request({
url: '/api/v1/repo/repair/info',
2025-03-18 22:01:02 +08:00
method: 'POST',
data: {
2025-03-19 10:08:49 +08:00
current: 1,
size: 10,
softwareId: 47
2025-03-18 22:01:02 +08:00
}
});
}
// 获取许可证列表
export function getLicenseList() {
return request({
url: '/api/v1/repo/license/list',
method: 'GET',
params: {
2025-03-19 10:08:49 +08:00
current: 1,
size: 10,
softwareId: 47
}
});
}
// 获取详情漏洞列表
export function getVulnerabilityList() {
return request({
url: '/api/v1/repo/vulnerability/page',
method: 'GET',
params: {
current: 1,
size: 10,
softwareId: 47
2025-03-18 22:01:02 +08:00
}
2025-03-18 20:20:37 +08:00
});
}
2025-03-19 10:34:17 +08:00
// 获取漏洞数据
export const getVulnList = (data): Promise<any> => {
return reqCatchV2(() =>
request({
url: `/api/v1/repo/vulnerability/page`,
method: 'post',
data,
})
);
}
// 获取漏洞数据
export const getVulnDetail = (data): Promise<any> => {
return reqCatchV2(() =>
request({
url: `/api/v1/repo/vulnerability/info`,
method: 'POST',
data,
})
);
}