diff --git a/alova.config.ts b/alova.config.ts index 6c1420a..126d87c 100644 --- a/alova.config.ts +++ b/alova.config.ts @@ -27,7 +27,10 @@ export default { if (apiDescriptor.deprecated) { return undefined; } - const newOpId = apiDescriptor.summary?.trim() || apiDescriptor.operationId; + // 优先使用后端显式声明的 operationId(稳定、可读、无重名后缀), + // 仅在 operationId 缺失时回退到 summary。切勿用 summary 覆盖 operationId, + // 否则中文/长文本 summary 会变成方法名导致运行时查不到。 + const newOpId = apiDescriptor.operationId ?? apiDescriptor.summary?.trim(); const url = apiDescriptor.url.replace(/^\/{platform}\//, "/api/"); // springdoc 默认把 Controller 类名转为 kebab tag(如 base-controller), // 而业务代码统一用 Pascal 无 Controller 的命名空间(如 Base)调用。 diff --git a/src/api/apiDefinitions.ts b/src/api/apiDefinitions.ts index cdc8803..59daf86 100644 --- a/src/api/apiDefinitions.ts +++ b/src/api/apiDefinitions.ts @@ -79,8 +79,8 @@ export default { 'SysGroup.getSchoolTree': ['GET', '/api/sysgroup/GetSchoolTree'], 'PushSubscription.recordList': ['GET', '/api/push/RecordList'], 'PushSubscription.download': ['GET', '/api/push/Download/{id}'], - 'SysOperationLog.list_2': ['GET', '/api/oplog/List'], - 'SysOperationLog.download_1': ['GET', '/api/oplog/Download/{id}'], + 'SysOperationLog.operationLogList': ['GET', '/api/oplog/List'], + 'SysOperationLog.operationLogDownload': ['GET', '/api/oplog/Download/{id}'], 'Identity.current': ['GET', '/api/identity/current'], 'Identity.available': ['GET', '/api/identity/available'], 'GroupAuthz.userRoles': ['GET', '/api/groupauthz/UserRoles'], @@ -112,6 +112,6 @@ export default { 'User.byId': ['GET', '/oapi/user/byId'], 'SignKeyInternal.signKey': ['GET', '/oapi/internal/sign-key/{appId}'], 'Group.tree': ['GET', '/oapi/group/tree'], - 'Group.list_3': ['GET', '/oapi/group/list'], + 'Group.list_2': ['GET', '/oapi/group/list'], 'Group.byId_1': ['GET', '/oapi/group/byId'] }; diff --git a/src/api/globals.d.ts b/src/api/globals.d.ts index 26d3341..293d8dc 100644 --- a/src/api/globals.d.ts +++ b/src/api/globals.d.ts @@ -455,12 +455,12 @@ export interface ApplicationContext { parent?: ApplicationContext; id?: string; displayName?: string; - autowireCapableBeanFactory?: AutowireCapableBeanFactory; applicationName?: string; + autowireCapableBeanFactory?: AutowireCapableBeanFactory; startupDate?: number; environment?: Environment; - beanDefinitionNames?: string[]; beanDefinitionCount?: number; + beanDefinitionNames?: string[]; parentBeanFactory?: BeanFactory; classLoader?: { parent?: { @@ -481,22 +481,33 @@ export interface RedirectView { attributeNames?: object; majorVersion?: number; contextPath?: string; - minorVersion?: number; - initParameterNames?: object; /** * @deprecated */ servletNames?: object; + minorVersion?: number; + initParameterNames?: object; sessionTimeout?: number; + serverInfo?: string; /** * @deprecated */ servlets?: object; - responseCharacterEncoding?: string; - defaultSessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[]; - virtualServerName?: string; - servletContextName?: string; requestCharacterEncoding?: string; + filterRegistrations?: Record< + string, + { + urlPatternMappings?: string[]; + servletNameMappings?: string[]; + name?: string; + className?: string; + initParameters?: Record; + } + >; + servletContextName?: string; + sessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[]; + effectiveMinorVersion?: number; + defaultSessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[]; servletRegistrations?: Record< string, { @@ -508,39 +519,7 @@ export interface RedirectView { } >; effectiveMajorVersion?: number; - sessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[]; - effectiveMinorVersion?: number; - effectiveSessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[]; - jspConfigDescriptor?: { - taglibs?: Array<{ - taglibURI?: string; - taglibLocation?: string; - }>; - jspPropertyGroups?: Array<{ - buffer?: string; - defaultContentType?: string; - urlPatterns?: string[]; - deferredSyntaxAllowedAsLiteral?: string; - pageEncoding?: string; - includeCodas?: string[]; - isXml?: string; - elIgnored?: string; - scriptingInvalid?: string; - includePreludes?: string[]; - trimDirectiveWhitespaces?: string; - errorOnUndeclaredNamespace?: string; - }>; - }; - filterRegistrations?: Record< - string, - { - servletNameMappings?: string[]; - urlPatternMappings?: string[]; - name?: string; - className?: string; - initParameters?: Record; - } - >; + virtualServerName?: string; sessionCookieConfig?: { name?: string; path?: string; @@ -550,7 +529,28 @@ export interface RedirectView { maxAge?: number; httpOnly?: boolean; }; - serverInfo?: string; + jspConfigDescriptor?: { + taglibs?: Array<{ + taglibURI?: string; + taglibLocation?: string; + }>; + jspPropertyGroups?: Array<{ + buffer?: string; + urlPatterns?: string[]; + defaultContentType?: string; + elIgnored?: string; + pageEncoding?: string; + isXml?: string; + includeCodas?: string[]; + trimDirectiveWhitespaces?: string; + includePreludes?: string[]; + scriptingInvalid?: string; + errorOnUndeclaredNamespace?: string; + deferredSyntaxAllowedAsLiteral?: string; + }>; + }; + responseCharacterEncoding?: string; + effectiveSessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[]; }; contentType?: string; requestContextAttribute?: string; @@ -2517,8 +2517,8 @@ declare global { * parent?: ApplicationContext * id?: string * displayName?: string - * autowireCapableBeanFactory?: object * applicationName?: string + * autowireCapableBeanFactory?: object * startupDate?: number * environment?: { * // [items] start @@ -2528,10 +2528,10 @@ declare global { * // [items] end * defaultProfiles?: string[] * } + * beanDefinitionCount?: number * // [items] start * // [items] end * beanDefinitionNames?: string[] - * beanDefinitionCount?: number * parentBeanFactory?: object * classLoader?: { * parent?: { @@ -2550,20 +2550,37 @@ declare global { * attributeNames?: object * majorVersion?: number * contextPath?: string - * minorVersion?: number - * initParameterNames?: object * // [deprecated] * servletNames?: object + * minorVersion?: number + * initParameterNames?: object * sessionTimeout?: number + * serverInfo?: string * // [deprecated] * servlets?: object - * responseCharacterEncoding?: string + * requestCharacterEncoding?: string + * filterRegistrations?: Record< + * string, + * { + * // [items] start + * // [items] end + * urlPatternMappings?: string[] + * // [items] start + * // [items] end + * servletNameMappings?: string[] + * name?: string + * className?: string + * initParameters?: Record + * } + * > + * servletContextName?: string + * // [items] start + * // [items] end + * sessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[] + * effectiveMinorVersion?: number * // [items] start * // [items] end * defaultSessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[] - * virtualServerName?: string - * servletContextName?: string - * requestCharacterEncoding?: string * servletRegistrations?: Record< * string, * { @@ -2577,13 +2594,16 @@ declare global { * } * > * effectiveMajorVersion?: number - * // [items] start - * // [items] end - * sessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[] - * effectiveMinorVersion?: number - * // [items] start - * // [items] end - * effectiveSessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[] + * virtualServerName?: string + * sessionCookieConfig?: { + * name?: string + * path?: string + * comment?: string + * domain?: string + * secure?: boolean + * maxAge?: number + * httpOnly?: boolean + * } * jspConfigDescriptor?: { * // [items] start * // [items] end @@ -2595,49 +2615,29 @@ declare global { * // [items] end * jspPropertyGroups?: Array<{ * buffer?: string - * defaultContentType?: string * // [items] start * // [items] end * urlPatterns?: string[] - * deferredSyntaxAllowedAsLiteral?: string + * defaultContentType?: string + * elIgnored?: string * pageEncoding?: string + * isXml?: string * // [items] start * // [items] end * includeCodas?: string[] - * isXml?: string - * elIgnored?: string - * scriptingInvalid?: string + * trimDirectiveWhitespaces?: string * // [items] start * // [items] end * includePreludes?: string[] - * trimDirectiveWhitespaces?: string + * scriptingInvalid?: string * errorOnUndeclaredNamespace?: string + * deferredSyntaxAllowedAsLiteral?: string * }> * } - * filterRegistrations?: Record< - * string, - * { - * // [items] start - * // [items] end - * servletNameMappings?: string[] - * // [items] start - * // [items] end - * urlPatternMappings?: string[] - * name?: string - * className?: string - * initParameters?: Record - * } - * > - * sessionCookieConfig?: { - * name?: string - * path?: string - * comment?: string - * domain?: string - * secure?: boolean - * maxAge?: number - * httpOnly?: boolean - * } - * serverInfo?: string + * responseCharacterEncoding?: string + * // [items] start + * // [items] end + * effectiveSessionTrackingModes?: ('COOKIE' | 'URL' | 'SSL')[] * } * contentType?: string * requestContextAttribute?: string @@ -5080,7 +5080,7 @@ declare global { * }> * ``` */ - list_3< + list_2< Config extends Alova2MethodConfig & { params: { ids: string; @@ -5089,7 +5089,7 @@ declare global { } >( config: Config - ): Alova2Method; + ): Alova2Method; /** * --- * @@ -5139,7 +5139,7 @@ declare global { /** * --- * - * [GET] + * [GET] 操作日志分页查询 * * **path:** /api/oplog/List * @@ -5201,7 +5201,7 @@ declare global { * } * ``` */ - list_2< + operationLogList< Config extends Alova2MethodConfig & { params: { query: SysOperationLogQuery; @@ -5210,11 +5210,11 @@ declare global { } >( config: Config - ): Alova2Method; + ): Alova2Method; /** * --- * - * [GET] + * [GET] 下载日志响应原文 * * **path:** /api/oplog/Download/{id} * @@ -5234,7 +5234,7 @@ declare global { * type Response = Blob * ``` */ - download_1< + operationLogDownload< Config extends Alova2MethodConfig & { pathParams: { id: number; @@ -5242,7 +5242,7 @@ declare global { } >( config: Config - ): Alova2Method; + ): Alova2Method; }; SignKeyInternal: { /** diff --git a/src/views/app/PushSettingModal.vue b/src/views/app/PushSettingModal.vue index bf1febb..09138ec 100644 --- a/src/views/app/PushSettingModal.vue +++ b/src/views/app/PushSettingModal.vue @@ -217,7 +217,7 @@ function doSync(interfacePath: string, loadingRef: Ref, name: string): } loadingRef.value = true; return (Apis as any) - .Push.test({ + .PushSubscription.test({ data: { appId: props.appId, interfacePath, targetIds: null }, cacheFor: null, }) diff --git a/src/views/oplog/OperationLogList.vue b/src/views/oplog/OperationLogList.vue index 6531a4b..f249afb 100644 --- a/src/views/oplog/OperationLogList.vue +++ b/src/views/oplog/OperationLogList.vue @@ -85,7 +85,7 @@ function clean(obj: Record) { } const tableApi = (params: { pageIndex: number; pageSize: number }) => { - return (Apis as any).OperationLog.list({ + return (Apis as any).SysOperationLog.operationLogList({ params: clean({ keyword: dataParams.value.keyword?.trim() || undefined, success: dataParams.value.success, diff --git a/src/views/push/PushLog.vue b/src/views/push/PushLog.vue index 1a57765..6f88ae1 100644 --- a/src/views/push/PushLog.vue +++ b/src/views/push/PushLog.vue @@ -99,7 +99,7 @@ function clean(obj: Record) { } const tableApi = (params: { pageIndex: number; pageSize: number }) => { - return (Apis as any).Push.recordList({ + return (Apis as any).PushSubscription.recordList({ params: clean({ appKey: dataParams.value.appKey, interfacePath: dataParams.value.interfacePath, @@ -185,7 +185,7 @@ function openDetail(row: any) { async function handleRetry(row: any) { try { - await (Apis as any).Push.retry({ pathParams: { id: row.id }, cacheFor: null }); + await (Apis as any).PushSubscription.retry({ pathParams: { id: row.id }, cacheFor: null }); Message.success('已重新投递,稍后在列表中查看结果'); tableRef.value?.refreshData(); } catch (e: any) { diff --git a/src/views/push/PushTest.vue b/src/views/push/PushTest.vue index ea83e0c..8bc0c67 100644 --- a/src/views/push/PushTest.vue +++ b/src/views/push/PushTest.vue @@ -143,7 +143,7 @@ function handleSend() { preview.value = null; sendMessage.value = ''; (Apis as any) - .Push.test({ + .PushSubscription.test({ data: { appId: form.value.appId, interfacePath: form.value.interfacePath,