feat(dacli): webapi 镜像 print/portal/report (CI 关卡 G 从 3 FAIL 到 0)

This commit is contained in:
ssw committed 2026-06-29 17:29:43 +08:00
1 parent 2663b8c487
commit 6b2becd458
5 files changed
+221 -22

No files matched your search

+81
View File
@@ -0,0 +1,81 @@
/**
* webapi/portal.ts — 直接 import web 端 portal.ts (v3.0+ regression audit P0)
*
* web/apps/jnpf-web-apps-main/src/api/onlineDev/portal.ts 10+ 函数:
* getPortalList / getInfo / delPortal / updatePortal / createPortal
* copyPortal / exportPortal / getPortalSelector / getHomePortalList / setDefaultPortal
*
* v3.0+ (2026-06-29) 新增原因:
* - CI 关卡 G 标识 portal 0 webapi 引用为 FAIL
* - cmd-review 已知 portal 是"经验复刻", 应 webapi 镜像
*/
import { JnpfClient } from '../core/client.ts'
import { loadWebModule } from './_loader.ts'
const PORTAL_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/onlineDev/portal.ts'
let cached: any = null
export async function initWebapi(client: JnpfClient): Promise<void> {
if (cached) return
const { initDefHttpShim } = await import('./_defhttp_shim.ts')
initDefHttpShim(client)
cached = await loadWebModule(PORTAL_SRC)
}
export function isWebapiLoaded(): boolean {
return cached !== null
}
export namespace PortalData {
export interface CreateParams {
fullName: string
enCode: string
category?: string
type?: number
platformType?: number
link?: string
[key: string]: unknown
}
export interface ListParams {
keyword?: string
currentPage?: number
pageSize?: number
[key: string]: unknown
}
}
export const loadPortal: any = new Proxy({} as any, {
get(_target, prop) {
if (!cached) {
throw new Error(`portal 模块未初始化, 请先 await initWebapi(client)`)
}
return cached[prop]
},
})
/** 获取门户列表 */
export async function getPortalList(params?: PortalData.ListParams): Promise<unknown> {
return loadPortal.getPortalList(params)
}
/** 获取门户信息 */
export async function getInfo(id: string): Promise<unknown> {
return loadPortal.getInfo(id)
}
/** 创建门户 */
export async function createPortal(params: PortalData.CreateParams): Promise<unknown> {
return loadPortal.createPortal(params)
}
/** 更新门户 */
export async function updatePortal(params: PortalData.CreateParams & { id: string }): Promise<unknown> {
return loadPortal.updatePortal(params)
}
/** 删除门户 */
export async function delPortal(id: string): Promise<unknown> {
return loadPortal.delPortal(id)
}
+87
View File
@@ -0,0 +1,87 @@
/**
* webapi/printDev.ts — 直接 import web 端 printDev.ts (v3.0+ regression audit P0)
*
* web/apps/jnpf-web-apps-main/src/api/system/printDev.ts 11 函数:
* getPrintDevList / getPrintDevSelector / getPrintWorkSelector / getPrintDevByIds
* createPrintDev / updatePrintDev / getPrintDevInfo / delPrintDev
* copy / exportData / getPreviewInfo
*
* v3.0+ (2026-06-29) 新增原因:
* - CI 关卡 G 标识 print 0 webapi 引用为 FAIL
* - cmd-review 已知 print 是"经验复刻"源, 应 webapi 镜像
* - print/create.ts 已用 _validate.ts (BS-56), 现在补 webapi
*/
import { JnpfClient } from '../core/client.ts'
import { loadWebModule } from './_loader.ts'
const PRINT_DEV_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/system/printDev.ts'
let cached: any = null
export async function initWebapi(client: JnpfClient): Promise<void> {
if (cached) return
const { initDefHttpShim } = await import('./_defhttp_shim.ts')
initDefHttpShim(client)
cached = await loadWebModule(PRINT_DEV_SRC)
}
export function isWebapiLoaded(): boolean {
return cached !== null
}
export namespace PrintDevData {
export interface CreateParams {
fullName: string
enCode: string
category: string
type?: number
formId?: string
commonUse?: number
visibleType?: number
icon?: string
description?: string
sortCode?: number
[key: string]: unknown
}
export interface ListParams {
keyword?: string
currentPage?: number
pageSize?: number
[key: string]: unknown
}
}
export const loadPrintDev: any = new Proxy({} as any, {
get(_target, prop) {
if (!cached) {
throw new Error(`printDev 模块未初始化, 请先 await initWebapi(client)`)
}
return cached[prop]
},
})
/** 获取打印模板列表 */
export async function getPrintDevList(params?: PrintDevData.ListParams): Promise<unknown> {
return loadPrintDev.getPrintDevList(params)
}
/** 创建打印模板 */
export async function createPrintDev(params: PrintDevData.CreateParams): Promise<unknown> {
return loadPrintDev.createPrintDev(params)
}
/** 更新打印模板 */
export async function updatePrintDev(params: PrintDevData.CreateParams & { id: string }): Promise<unknown> {
return loadPrintDev.updatePrintDev(params)
}
/** 获取单个模板详情 */
export async function getPrintDevInfo(id: string): Promise<unknown> {
return loadPrintDev.getPrintDevInfo(id)
}
/** 删除模板 */
export async function delPrintDev(id: string): Promise<unknown> {
return loadPrintDev.delPrintDev(id)
}