- 新增 model_deploy 与 model_operations 双库查询,支持模型列表、模型详情、单月监控结果和运维工作台真实接口。 - 关闭运维模块生产 Mock 数据,补充缺表/空数据降级、工作台空状态和首条纵向链路测试。 - 按业务团队、模型团队、管理员权限矩阵接入菜单、页面、操作按钮和后端接口权限校验,支持 business_team 角色。 - 更新工作台布局、深色欢迎卡片、全宽页面适配、顶部回退,以及权限分组展示。 - 新增架构实现基线、周目标完成情况和角色权限矩阵初始化 SQL 文档。
70 lines
1.8 KiB
TypeScript
70 lines
1.8 KiB
TypeScript
import {
|
|
apiRequest,
|
|
apiRequestWithMeta,
|
|
buildCursorQuery,
|
|
parseCursorPageMeta,
|
|
type CursorListParams,
|
|
type CursorPage,
|
|
type Employee,
|
|
} from "./_shared";
|
|
|
|
// 系统管理级别接口 - 不区分 workspace
|
|
export async function listPlatformEmployees(
|
|
input: CursorListParams = {},
|
|
): Promise<CursorPage<Employee>> {
|
|
const query = buildCursorQuery(input);
|
|
const { data, meta } = await apiRequestWithMeta<Employee[]>(
|
|
`/api/v1/platform/employees?${query}`,
|
|
);
|
|
return { items: data, meta: parseCursorPageMeta(meta) };
|
|
}
|
|
|
|
export async function createPlatformEmployee(
|
|
input: {
|
|
username: string;
|
|
display_name: string;
|
|
email?: string | undefined;
|
|
password: string;
|
|
role_code?: string;
|
|
},
|
|
): Promise<Employee> {
|
|
return apiRequest<Employee>(
|
|
"/api/v1/platform/employees",
|
|
{ method: "POST", body: JSON.stringify({ ...input, role_code: input.role_code ?? "developer" }) },
|
|
);
|
|
}
|
|
|
|
export async function updatePlatformEmployee(
|
|
userId: string,
|
|
input: {
|
|
display_name?: string;
|
|
email?: string | null;
|
|
role_code?: string;
|
|
status?: "active" | "disabled" | "locked";
|
|
},
|
|
): Promise<Employee> {
|
|
return apiRequest<Employee>(
|
|
`/api/v1/platform/employees/${userId}`,
|
|
{ method: "PATCH", body: JSON.stringify(input) },
|
|
);
|
|
}
|
|
|
|
export async function deletePlatformEmployee(
|
|
userId: string,
|
|
): Promise<{ user_id: string; deleted: boolean }> {
|
|
return apiRequest(
|
|
`/api/v1/platform/employees/${userId}`,
|
|
{ method: "DELETE" },
|
|
);
|
|
}
|
|
|
|
export async function resetPlatformEmployeePassword(
|
|
userId: string,
|
|
newPassword: string,
|
|
): Promise<{ user_id: string; password_reset: boolean }> {
|
|
return apiRequest(
|
|
`/api/v1/platform/employees/${userId}/reset-password`,
|
|
{ method: "POST", body: JSON.stringify({ new_password: newPassword }) },
|
|
);
|
|
}
|