chore: initialize qiming workspace repository
This commit is contained in:
52
qiming-mobile/subpackages/servers/sandbox.uts
Normal file
52
qiming-mobile/subpackages/servers/sandbox.uts
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from "@/servers/useRequest";
|
||||
import { RequestResponse } from "@/types/interfaces/request";
|
||||
import { SandboxListResponse } from "@/types/interfaces/sandbox";
|
||||
|
||||
/**
|
||||
* 获取沙盒列表
|
||||
*/
|
||||
export const apiGetSandboxList = (): Promise<
|
||||
RequestResponse<SandboxListResponse>
|
||||
> => {
|
||||
return request<RequestResponse<SandboxListResponse>>({
|
||||
url: "/api/sandbox/config/select/list",
|
||||
method: "GET",
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 更新选中的沙盒
|
||||
*/
|
||||
export const apiUpdateSelectedSandbox = (
|
||||
agentId: string,
|
||||
sandboxId: string,
|
||||
): Promise<RequestResponse<null>> => {
|
||||
return request<RequestResponse<null>>({
|
||||
url: `/api/sandbox/config/selected/${agentId}/${sandboxId}`,
|
||||
method: "POST",
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 重启智能体
|
||||
*/
|
||||
export const apiRestartAgent = (
|
||||
conversationId: number,
|
||||
): Promise<RequestResponse<null>> => {
|
||||
return request<RequestResponse<null>>({
|
||||
url: `/api/computer/agent/stop/${conversationId}`,
|
||||
method: "POST",
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 重启容器
|
||||
*/
|
||||
export const apiRestartSandbox = (
|
||||
conversationId: number,
|
||||
): Promise<RequestResponse<null>> => {
|
||||
return request<RequestResponse<null>>({
|
||||
url: `/api/computer/pod/restart?cId=${conversationId}`,
|
||||
method: "POST",
|
||||
});
|
||||
};
|
||||
30
qiming-mobile/subpackages/servers/skill.uts
Normal file
30
qiming-mobile/subpackages/servers/skill.uts
Normal file
@@ -0,0 +1,30 @@
|
||||
import request from '@/servers/useRequest';
|
||||
import { RequestResponse, Page } from '@/types/interfaces/request';
|
||||
import { SkillListForAtParams, SkillInfoForAt } from '@/types/interfaces/skill';
|
||||
|
||||
// 全部技能列表
|
||||
export function apiSkillListForAt(data: SkillListForAtParams) {
|
||||
return request<RequestResponse<Page<SkillInfoForAt>>>({
|
||||
url: '/api/published/skill/list-for-at',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 最近使用的技能列表
|
||||
export function apiSkillRecentlyUsedList(data: any) {
|
||||
return request<RequestResponse<SkillInfoForAt[]>>({
|
||||
url: '/api/published/skill/recentlyUsed/list',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 已收藏的技能列表
|
||||
export function apiSkillCollectList(data: any) {
|
||||
return request<RequestResponse<SkillInfoForAt[]>>({
|
||||
url: '/api/published/skill/collect/list',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
92
qiming-mobile/subpackages/servers/subscription.uts
Normal file
92
qiming-mobile/subpackages/servers/subscription.uts
Normal file
@@ -0,0 +1,92 @@
|
||||
import { RequestResponse } from "@/types/interfaces/request";
|
||||
import {
|
||||
MySubscriptionData,
|
||||
CreditSummaryInfo,
|
||||
CreditPackageInfo,
|
||||
CreditBatchItem,
|
||||
SystemSubscriptionPlan,
|
||||
CashierInfo,
|
||||
CreditRecordInfo,
|
||||
} from "@/subpackages/types/interfaces/subscription";
|
||||
import request from "@/servers/useRequest";
|
||||
|
||||
export async function apiGetMySubscription(params: Record<string, string>) {
|
||||
return request<RequestResponse<MySubscriptionData>>({
|
||||
url: "/api/subscription/my",
|
||||
method: "GET",
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiGetCreditSummary() {
|
||||
return request<RequestResponse<CreditSummaryInfo>>({
|
||||
url: "/api/credit/summary",
|
||||
method: "GET",
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiListSystemSubscriptionPlans() {
|
||||
return request<RequestResponse<SystemSubscriptionPlan[]>>({
|
||||
url: "/api/subscription/system/plans",
|
||||
method: "GET",
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiListCreditPackages() {
|
||||
return request<RequestResponse<CreditPackageInfo[]>>({
|
||||
url: "/api/credit/package/list",
|
||||
method: "GET",
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiCreateCreditOrder(packageId: number) {
|
||||
return request<RequestResponse<any>>({
|
||||
url: `/api/credit/order/create?packageId=${packageId}`,
|
||||
method: "POST",
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiGetCreditBatches(params: Record<string, string>) {
|
||||
return request<RequestResponse<CreditBatchItem[]>>({
|
||||
url: "/api/credit/batches",
|
||||
method: "GET",
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiCreateSubscriptionOrder(planId: number) {
|
||||
return request<RequestResponse<any>>({
|
||||
url: `/api/subscription/order/create?planId=${planId}`,
|
||||
method: "POST",
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiGetOrderCashier(orderId: number, returnUrl?: string) {
|
||||
const data: Record<string, any> = { orderId };
|
||||
if (returnUrl != null) {
|
||||
data["returnUrl"] = returnUrl;
|
||||
}
|
||||
return request<RequestResponse<CashierInfo>>({
|
||||
url: "/api/bill/order/pay/cashier",
|
||||
method: "GET",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiGetCreditFlows(params: Record<string, any>) {
|
||||
return request<RequestResponse<CreditRecordInfo[]>>({
|
||||
url: "/api/credit/flows",
|
||||
method: "GET",
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiGetAgentSubscriptionPlanList(
|
||||
params: Record<string, any>,
|
||||
) {
|
||||
return request<RequestResponse<SystemSubscriptionPlan[]>>({
|
||||
url: "/api/agent/plan/list",
|
||||
method: "GET",
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user