From 066333c2671bfcb26c50fc355c511907c67b5fdf Mon Sep 17 00:00:00 2001 From: hejl Date: Mon, 8 Sep 2025 19:20:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E9=97=B4=E4=BF=AE=E6=94=B9=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gofaster/app/plugins/modules/api-collector.js | 34 +++- .../app/plugins/modules/call-chain-tracer.js | 83 ++------ .../app/plugins/modules/file-generator.js | 57 +++--- .../modules/trigger-analyzer-simple.js | 26 +-- .../modules/route-sync/RouteCollector.js | 7 +- .../modules/route-sync/RouteSyncManager.js | 35 ++-- .../modules/route-sync/RouteSyncService.js | 147 +++++++++++++- .../route-sync/direct-route-mappings.js | 186 +----------------- 8 files changed, 243 insertions(+), 332 deletions(-) diff --git a/gofaster/app/plugins/modules/api-collector.js b/gofaster/app/plugins/modules/api-collector.js index 29b29df..8089edc 100644 --- a/gofaster/app/plugins/modules/api-collector.js +++ b/gofaster/app/plugins/modules/api-collector.js @@ -53,17 +53,26 @@ class ApiCollector { collectApiMappings(moduleDirs) { this.apiMappings = [] + console.log('🔍 开始收集API映射,模块列表:', moduleDirs) + moduleDirs.forEach(moduleName => { + console.log(`🔍 处理模块: ${moduleName}`) const moduleApiMappings = this.collectModuleApiMappings(moduleName) + console.log(`🔍 模块 ${moduleName} 收集到 ${moduleApiMappings.length} 个API映射`) + if (moduleApiMappings.length > 0) { - this.apiMappings.push({ - module: moduleName, - serviceName: moduleApiMappings.serviceName, - apiMappings: moduleApiMappings + // 将 serviceName 和 module 下沉到每个 API 映射中 + moduleApiMappings.forEach(apiMapping => { + this.apiMappings.push({ + ...apiMapping, + serviceName: moduleApiMappings.serviceName, + module: moduleName + }) }) } }) + console.log(`🔍 总共收集到 ${this.apiMappings.length} 个API映射`) return this.apiMappings } @@ -75,11 +84,16 @@ class ApiCollector { collectModuleApiMappings(moduleName) { const servicesPath = resolve(__dirname, '../../src/renderer/modules', moduleName, 'services') + console.log(`🔍 检查服务路径: ${servicesPath}`) + if (!existsSync(servicesPath)) { + console.log(`🔍 服务路径不存在: ${servicesPath}`) return [] } const serviceFiles = readdirSync(servicesPath).filter(file => file.endsWith('.js')) + console.log(`🔍 找到服务文件:`, serviceFiles) + const moduleApiMappings = [] let firstServiceName = null @@ -88,6 +102,8 @@ class ApiCollector { const servicePath = resolve(servicesPath, serviceFile) const serviceName = serviceFile.replace('.js', '') + console.log(`🔍 分析服务文件: ${serviceFile}`) + // 记录第一个服务名称(第一层需要) if (!firstServiceName) { firstServiceName = serviceName @@ -95,18 +111,16 @@ class ApiCollector { try { const serviceApiMappings = this.analyzeServiceFile(servicePath, serviceName, moduleName) + console.log(`🔍 服务 ${serviceName} 收集到 ${serviceApiMappings.length} 个API映射`) // 不再为每个API映射添加serviceName(第二层冗余信息) moduleApiMappings.push(...serviceApiMappings) } catch (error) { - // 静默处理错误 + console.error(`🔍 分析服务文件失败: ${serviceFile}`, error.message) } }) - // 为模块API映射添加serviceName(第一层需要) - if (firstServiceName) { - moduleApiMappings.serviceName = firstServiceName - } - + console.log(`🔍 模块 ${moduleName} 总共收集到 ${moduleApiMappings.length} 个API映射`) + // 返回模块API映射数组,serviceName 将在 collectApiMappings 中添加到每个API映射 return moduleApiMappings } diff --git a/gofaster/app/plugins/modules/call-chain-tracer.js b/gofaster/app/plugins/modules/call-chain-tracer.js index 435f3b9..752a340 100644 --- a/gofaster/app/plugins/modules/call-chain-tracer.js +++ b/gofaster/app/plugins/modules/call-chain-tracer.js @@ -10,25 +10,9 @@ const traverse = require('@babel/traverse').default */ class CallChainTracer { constructor() { - this.debugMode = process.env.ROUTE_MAPPING_DEBUG === 'true' || process.argv.includes('--debug') this.processedFiles = new Set() // 跟踪已处理的文件,避免重复处理 } - /** - * 调试日志输出 - * @param {string} message - 日志消息 - * @param {any} data - 附加数据 - */ - debugLog(message, data = null) { - if (this.debugMode) { - const timestamp = new Date().toISOString() - if (data) { - console.log(`[${timestamp}] [CallChainTracer] ${message}`, data) - } else { - console.log(`[${timestamp}] [CallChainTracer] ${message}`) - } - } - } /** * 清理已处理文件的记录 @@ -36,7 +20,6 @@ class CallChainTracer { */ clearProcessedFiles() { this.processedFiles.clear() - this.debugLog('已清理已处理文件记录') } /** @@ -45,41 +28,35 @@ class CallChainTracer { * @returns {Array} 增强的API映射数组 */ traceMethodTriggersToVisualComponents(apiMappings) { - const enhancedApiMappings = apiMappings.map(module => { - const enhancedApiMappings = module.apiMappings.map(api => { - if (!api.triggerSources || api.triggerSources.length === 0) { - return api - } - - // 只处理triggerType为method的触发源 - const enhancedTriggerSources = api.triggerSources.map(trigger => { - if (trigger.triggerType === 'method') { - const result = this.traceMethodToVisualComponent( - trigger, - module.module, - module.serviceName, - api.apiMethodName - ) - return result - } - return trigger - }) - - return { - ...api, - triggerSources: enhancedTriggerSources + const enhancedApiMappings = apiMappings.map(api => { + if (!api.triggerSources || api.triggerSources.length === 0) { + return api + } + + // 只处理triggerType为method的触发源 + const enhancedTriggerSources = api.triggerSources.map(trigger => { + if (trigger.triggerType === 'method') { + const result = this.traceMethodToVisualComponent( + trigger, + api.module, + api.serviceName, + api.apiMethodName + ) + return result } + return trigger }) return { - ...module, - apiMappings: enhancedApiMappings + ...api, + triggerSources: enhancedTriggerSources } }) return enhancedApiMappings } + /** * 追溯单个method到可视控件 * @param {Object} trigger - 触发源对象 @@ -611,19 +588,15 @@ class CallChainTracer { // 检查文件是否已经被处理过,避免重复处理 const fileKey = `${filePath}-${nameValue}` if (this.processedFiles.has(fileKey)) { - this.debugLog(`文件 ${filePath} 的 ${nameValue} 已被处理过,跳过`) return } const content = readFileSync(filePath, 'utf-8') - this.debugLog(`开始修改Vue文件: ${filePath}`) - this.debugLog(`目标节点: ${node.tag}, name: ${nameValue}, type: ${triggerType}`) // 获取节点的位置信息 const loc = node.loc if (!loc) { - this.debugLog(`节点没有位置信息,无法修改Vue元素`) return } @@ -632,7 +605,6 @@ class CallChainTracer { const endLine = loc.end.line const endColumn = loc.end.column - this.debugLog(`节点位置: 第${startLine}行第${startColumn}列 到 第${endLine}行第${endColumn}列`) const lines = content.split('\n') @@ -640,7 +612,6 @@ class CallChainTracer { const targetLine = lines[startLine - 1] if (targetLine.includes(`name="`) || targetLine.includes(`name='`) || targetLine.includes(`:visible="false"`) || targetLine.includes(`:visible='false'`)) { - this.debugLog(`元素已包含name或:visible属性,跳过修改`) return } @@ -659,12 +630,9 @@ class CallChainTracer { // 标记文件为已处理 this.processedFiles.add(fileKey) - this.debugLog(`已成功修改Vue文件: ${filePath}`) - this.debugLog(`添加的属性: name="${nameValue}"${triggerType === 'button' ? ', :visible="false"' : ', :disabled="true"'}`) } catch (error) { - this.debugLog(`修改Vue元素时出错:`, error.message) - this.debugLog(`错误堆栈:`, error.stack) + // 静默处理错误 } } @@ -679,12 +647,10 @@ class CallChainTracer { */ modifySingleLineElement(lines, lineIndex, startCol, endCol, nameValue, triggerType) { const line = lines[lineIndex] - this.debugLog(`修改单行元素: ${line}`) // 检查是否已经存在name属性或:visible属性,避免重复修改 if (line.includes(`name="`) || line.includes(`name='`) || line.includes(`:visible="false"`) || line.includes(`:visible='false'`)) { - this.debugLog(`单行元素已包含name或:visible属性,跳过修改`) return } @@ -706,7 +672,6 @@ class CallChainTracer { } lines[lineIndex] = `${beforeTag}${newAttributes}${afterTag}` - this.debugLog(`单行元素修改完成: ${lines[lineIndex]}`) } } @@ -722,7 +687,6 @@ class CallChainTracer { */ modifyMultiLineElement(lines, startLineIndex, startCol, endLineIndex, endCol, nameValue, triggerType) { const startLine = lines[startLineIndex] - this.debugLog(`修改多行元素开始行: ${startLine}`) // 检查整个多行元素是否已经存在name属性或:visible属性,避免重复修改 let hasExistingAttributes = false @@ -736,7 +700,6 @@ class CallChainTracer { } if (hasExistingAttributes) { - this.debugLog(`多行元素已包含name或:visible属性,跳过修改`) return } @@ -748,14 +711,12 @@ class CallChainTracer { // 如果当前行没有找到结束标签,查找后续行 if (tagStart !== -1 && tagEnd === -1) { - this.debugLog(`当前行没有找到结束标签,查找后续行`) for (let i = startLineIndex; i <= endLineIndex && i < lines.length; i++) { const line = lines[i] const endPos = line.indexOf('>') if (endPos !== -1) { tagEnd = endPos tagEndLineIndex = i - this.debugLog(`在第${i + 1}行找到结束标签,位置: ${endPos}`) break } } @@ -776,12 +737,9 @@ class CallChainTracer { const afterEndTag = endLine.substring(tagEnd) lines[tagEndLineIndex] = `${beforeEndTag}${newAttributes}${afterEndTag}` - this.debugLog(`多行元素修改完成: ${lines[tagEndLineIndex]}`) } else { - this.debugLog(`未找到有效的标签位置: tagStart=${tagStart}, tagEnd=${tagEnd}`) // 如果找不到结束标签,尝试在开始标签后直接添加 if (tagStart !== -1) { - this.debugLog(`尝试在开始标签后直接添加属性`) const beforeTag = startLine.substring(0, tagStart + 1) // 包含 < 字符 const afterTag = startLine.substring(tagStart + 1) @@ -793,7 +751,6 @@ class CallChainTracer { } lines[startLineIndex] = `${beforeTag}${newAttributes} ${afterTag}` - this.debugLog(`多行元素修改完成(备用方案): ${lines[startLineIndex]}`) } } } diff --git a/gofaster/app/plugins/modules/file-generator.js b/gofaster/app/plugins/modules/file-generator.js index 5a8a588..7eae9dd 100644 --- a/gofaster/app/plugins/modules/file-generator.js +++ b/gofaster/app/plugins/modules/file-generator.js @@ -139,18 +139,16 @@ export default { * @returns {Array} 瘦身后的API映射数组 */ slimApiMappings(apiMappings) { - return apiMappings.map(moduleMapping => ({ - module: moduleMapping.module, - serviceName: moduleMapping.serviceName, - apiMappings: moduleMapping.apiMappings.map(api => ({ - apiMethodName: api.apiMethodName, - method: api.method, - path: api.path, - triggerSources: api.triggerSources.map(trigger => ({ - component: trigger.component, - triggerName: trigger.triggerName, - triggerType: trigger.triggerType - })) + return apiMappings.map(api => ({ + apiMethodName: api.apiMethodName, + method: api.method, + path: api.path, + serviceName: api.serviceName, + module: api.module, + triggerSources: api.triggerSources.map(trigger => ({ + component: trigger.component, + triggerName: trigger.triggerName, + triggerType: trigger.triggerType })) })) } @@ -164,31 +162,20 @@ export default { const optimizedApiMappings = [] let totalRemoved = 0 - apiMappings.forEach(moduleMapping => { - const deduplicatedApiMappings = [] + apiMappings.forEach(apiMapping => { + // 删除无触发器的API映射 + if (!apiMapping.triggerSources || apiMapping.triggerSources.length === 0) { + totalRemoved++ + return + } - moduleMapping.apiMappings.forEach(apiMapping => { - // 删除无触发器的API映射 - if (!apiMapping.triggerSources || apiMapping.triggerSources.length === 0) { - totalRemoved++ - return - } - - // 去重触发器源 - const uniqueTriggerSources = this.deduplicateTriggerSources(apiMapping.triggerSources) - - deduplicatedApiMappings.push({ - ...apiMapping, - triggerSources: uniqueTriggerSources - }) - }) + // 去重触发器源 + const uniqueTriggerSources = this.deduplicateTriggerSources(apiMapping.triggerSources) - if (deduplicatedApiMappings.length > 0) { - optimizedApiMappings.push({ - ...moduleMapping, - apiMappings: deduplicatedApiMappings - }) - } + optimizedApiMappings.push({ + ...apiMapping, + triggerSources: uniqueTriggerSources + }) }) return optimizedApiMappings diff --git a/gofaster/app/plugins/modules/trigger-analyzer-simple.js b/gofaster/app/plugins/modules/trigger-analyzer-simple.js index 210c66f..fe24c34 100644 --- a/gofaster/app/plugins/modules/trigger-analyzer-simple.js +++ b/gofaster/app/plugins/modules/trigger-analyzer-simple.js @@ -20,30 +20,24 @@ class TriggerAnalyzerSimple { * @returns {Array} 增强的API映射数组 */ findTriggerSourcesForApiMappings(apiMappings, routes) { - const enhancedApiMappings = apiMappings.map(module => { - const enhancedApiMappings = module.apiMappings.map(api => { - // 查找该API的触发源 - const triggerSources = this.findTriggerSourcesForApiMethod( - module.serviceName, - api.apiMethodName, - module.module - ) - - return { - ...api, - triggerSources: triggerSources - } - }) + const enhancedApiMappings = apiMappings.map(api => { + // 查找该API的触发源 + const triggerSources = this.findTriggerSourcesForApiMethod( + api.serviceName, + api.apiMethodName, + api.module + ) return { - ...module, - apiMappings: enhancedApiMappings + ...api, + triggerSources: triggerSources } }) return enhancedApiMappings } + /** * 查找API方法的触发源 * @param {string} serviceName - 服务名称 diff --git a/gofaster/app/src/renderer/modules/route-sync/RouteCollector.js b/gofaster/app/src/renderer/modules/route-sync/RouteCollector.js index 99958c7..9489ef0 100644 --- a/gofaster/app/src/renderer/modules/route-sync/RouteCollector.js +++ b/gofaster/app/src/renderer/modules/route-sync/RouteCollector.js @@ -69,9 +69,8 @@ export class RouteCollector { if (moduleMapping.module === route.module) { moduleMapping.apiMappings.forEach(apiMapping => { // 检查API调用是否与当前路由相关 - const isRelated = apiMapping.callingComponents.some(component => - component.component === route.component || - component.path === route.path + const isRelated = apiMapping.triggerSources.some(trigger => + trigger.component === route.component ) if (isRelated) { @@ -79,7 +78,7 @@ export class RouteCollector { type: 'api', method: apiMapping.method, path: apiMapping.path, - methodName: apiMapping.methodName, + methodName: apiMapping.apiMethodName, serviceName: moduleMapping.serviceName }) } diff --git a/gofaster/app/src/renderer/modules/route-sync/RouteSyncManager.js b/gofaster/app/src/renderer/modules/route-sync/RouteSyncManager.js index 4a89e31..181865d 100644 --- a/gofaster/app/src/renderer/modules/route-sync/RouteSyncManager.js +++ b/gofaster/app/src/renderer/modules/route-sync/RouteSyncManager.js @@ -80,33 +80,21 @@ export class RouteSyncManager { try { console.log('🔄 开始执行初始路由同步...') - // 收集前端路由 - const frontendRoutes = this.routeCollector.collectRoutes() - // console.log(`📊 收集到 ${frontendRoutes.length} 个前端路由:`, frontendRoutes) + // 直接从 direct-route-mappings.js 文件同步 + const directMappings = await this._loadDirectMappings() - if (frontendRoutes.length === 0) { - console.error('❌ 没有收集到前端路由') - return - } - - // 生成路由映射 - const routeMappings = this.routeMapper.generateRouteMappings(frontendRoutes) - // console.log(`📊 生成了 ${routeMappings.length} 个路由映射:`, routeMappings) - - if (routeMappings.length === 0) { - console.error('❌ 没有生成路由映射') - // console.log('🔍 调试信息:') - // console.log(' - frontendRoutes:', frontendRoutes) - // console.log(' - routeMapper:', this.routeMapper) + if (!directMappings) { + console.error('❌ 无法加载 direct-route-mappings.js 文件') return } // 同步到后端 console.log('🔄 开始同步到后端...') - const result = await this.routeSyncService.syncRoutes(routeMappings) + const result = await this.routeSyncService.syncFromDirectMappings(directMappings) if (result.success) { console.log('✅ 初始路由同步成功') + console.log(`📊 同步了 ${Object.keys(result.details).length} 个模块`) } else { console.error('❌ 初始路由同步失败:', result.errors) } @@ -116,6 +104,17 @@ export class RouteSyncManager { } } + // 加载 direct-route-mappings.js 文件 + async _loadDirectMappings() { + try { + const { default: directMappings } = await import('./direct-route-mappings.js') + return directMappings + } catch (error) { + console.error('❌ 加载 direct-route-mappings.js 失败:', error) + return null + } + } + // 停止同步 stop() { if (this.syncTimer) { diff --git a/gofaster/app/src/renderer/modules/route-sync/RouteSyncService.js b/gofaster/app/src/renderer/modules/route-sync/RouteSyncService.js index 68f4757..8030258 100644 --- a/gofaster/app/src/renderer/modules/route-sync/RouteSyncService.js +++ b/gofaster/app/src/renderer/modules/route-sync/RouteSyncService.js @@ -54,6 +54,45 @@ export class RouteSyncService { } } + // 从 direct-route-mappings.js 格式同步路由 + async syncFromDirectMappings(directMappings) { + try { + if (!directMappings || !directMappings.routes || !directMappings.apiMappings) { + return { success: false, errors: ['direct-route-mappings.js 格式不正确'] } + } + + const results = { + success: true, + errors: [], + details: {} + } + + // 处理每个模块的API映射 + for (const moduleMapping of directMappings.apiMappings) { + try { + const result = await this._syncModuleFromDirectMappings(moduleMapping, directMappings.routes) + results.details[moduleMapping.module] = result + + if (!result.success) { + results.success = false + results.errors.push(...result.errors) + } + } catch (error) { + results.success = false + results.errors.push(`模块 "${moduleMapping.module}" 同步失败: ${error.message}`) + results.details[moduleMapping.module] = { success: false, error: error.message } + } + } + + return results + } catch (error) { + return { + success: false, + errors: [`同步失败: ${error.message}`] + } + } + } + // 按模块分组映射 _groupMappingsByModule(mappings) { const groups = {} @@ -102,7 +141,113 @@ export class RouteSyncService { } } - // 构建前端路由数据 + // 从 direct-route-mappings 格式同步单个模块 + async _syncModuleFromDirectMappings(moduleMapping, routes) { + try { + // 构建前端路由数据 + const frontendRouteData = this._buildFrontendRouteDataFromDirectMappings(moduleMapping, routes) + + if (frontendRouteData.length === 0) { + return { success: false, errors: [`模块 "${moduleMapping.module}" 没有有效的前端路由数据`] } + } + + // 发送到后端 + const response = await this.axios.post('/api/frontend-routes/batch-sync', frontendRouteData) + + return { + success: true, + data: response.data, + count: frontendRouteData.length + } + } catch (error) { + if (error.response) { + return { + success: false, + errors: [`HTTP ${error.response.status}: ${error.response.data?.message || error.message}`] + } + } else { + return { + success: false, + errors: [`网络错误: ${error.message}`] + } + } + } + } + + // 从 direct-route-mappings 格式构建前端路由数据 + _buildFrontendRouteDataFromDirectMappings(moduleMapping, routes) { + const frontendRouteGroups = {} + + // 根据模块名称推断对应的路由路径 + const modulePathMap = { + 'role-management': '/role-management', + 'user-management': '/user-management', + 'user-profile': '/user-profile', + 'settings': '/settings' + } + + const modulePath = modulePathMap[moduleMapping.module] + if (!modulePath) { + console.warn(`⚠️ 未找到模块 "${moduleMapping.module}" 对应的路由路径`) + return [] + } + + // 找到该模块对应的路由 + const moduleRoutes = routes.filter(route => route.path === modulePath) + + // 为每个路由创建基础结构 + moduleRoutes.forEach(route => { + frontendRouteGroups[route.path] = { + path: route.path, + name: route.name || route.component, + component: route.component, + module: moduleMapping.module, + description: route.description || `${route.name || route.component}页面`, + sort: this._generateSort(moduleMapping.module), + backend_routes: [] + } + }) + + // 处理API映射 + moduleMapping.apiMappings.forEach(apiMapping => { + // 为每个 triggerSource 创建后端路由关联 + apiMapping.triggerSources.forEach(trigger => { + // 找到对应的前端路由 + const frontendRoute = moduleRoutes.find(route => route.component === trigger.component) + + if (frontendRoute && frontendRouteGroups[frontendRoute.path]) { + // 检查是否已存在相同的后端路由 + const existingRoute = frontendRouteGroups[frontendRoute.path].backend_routes.find( + route => route.backend_route === apiMapping.path && + route.http_method === apiMapping.method + ) + + if (!existingRoute) { + frontendRouteGroups[frontendRoute.path].backend_routes.push({ + backend_route: apiMapping.path, + http_method: apiMapping.method, + module: moduleMapping.module, + description: apiMapping.apiMethodName || 'unknown' + }) + } + } + }) + }) + + return Object.values(frontendRouteGroups) + } + + // 生成排序值 + _generateSort(module) { + const moduleSortMap = { + 'user-management': 1, + 'role-management': 2, + 'system-settings': 3 + } + return moduleSortMap[module] || 99 + } + + // 构建前端路由数据(原有方法,保持兼容性) _buildFrontendRouteData(module, mappings) { const frontendRouteGroups = {} diff --git a/gofaster/app/src/renderer/modules/route-sync/direct-route-mappings.js b/gofaster/app/src/renderer/modules/route-sync/direct-route-mappings.js index b8ff73a..aa75bb3 100644 --- a/gofaster/app/src/renderer/modules/route-sync/direct-route-mappings.js +++ b/gofaster/app/src/renderer/modules/route-sync/direct-route-mappings.js @@ -28,189 +28,5 @@ export default { "description": "角色管理" } ], - "apiMappings": [ - { - "module": "role-management", - "serviceName": "roleService", - "apiMappings": [ - { - "apiMethodName": "createRole", - "method": "POST", - "path": "/api/auth/roles", - "triggerSources": [ - { - "component": "RoleManagement", - "triggerName": "rolemanagement-submit-lhm6fs", - "triggerType": "button" - } - ] - }, - { - "apiMethodName": "updateRole", - "method": "PUT", - "path": "/api/auth/roles/{id}", - "triggerSources": [ - { - "component": "RoleManagement", - "triggerName": "rolemanagement-submit-lhm6fs", - "triggerType": "button" - }, - { - "component": "PermissionManager", - "triggerName": "permissionmanager-button-k7wqyp", - "triggerType": "button" - } - ] - }, - { - "apiMethodName": "deleteRole", - "method": "DELETE", - "path": "/api/auth/roles/{id}", - "triggerSources": [ - { - "component": "RoleManagement", - "triggerName": "rolemanagement-button-0eqx80", - "triggerType": "button" - } - ] - }, - { - "apiMethodName": "assignRolesToUser", - "method": "POST", - "path": "/api/auth/roles/users/{userId}/assign", - "triggerSources": [ - { - "component": "UserRoleAssignment", - "triggerName": "userroleassignment-button-3npmn8", - "triggerType": "button" - } - ] - }, - { - "apiMethodName": "removeRolesFromUser", - "method": "DELETE", - "path": "/api/auth/roles/users/{userId}/remove", - "triggerSources": [ - { - "component": "UserRoleAssignment", - "triggerName": "userroleassignment-button-3npmn8", - "triggerType": "button" - } - ] - }, - { - "apiMethodName": "assignPermissionsToRole", - "method": "POST", - "path": "/api/auth/permissions/roles/{roleId}/assign", - "triggerSources": [ - { - "component": "RolePermissionAssignment", - "triggerName": "rolepermissionassignment-button-7uizm5", - "triggerType": "button" - }, - { - "component": "RolePermissionAssignment", - "triggerName": "rolepermissionassignment-button-a0nyh8", - "triggerType": "button" - } - ] - }, - { - "apiMethodName": "removePermissionsFromRole", - "method": "DELETE", - "path": "/api/auth/permissions/roles/{roleId}/remove", - "triggerSources": [ - { - "component": "RolePermissionAssignment", - "triggerName": "rolepermissionassignment-button-q86qi4", - "triggerType": "button" - }, - { - "component": "RolePermissionAssignment", - "triggerName": "rolepermissionassignment-button-sj6qb7", - "triggerType": "button" - } - ] - } - ] - }, - { - "module": "user-management", - "serviceName": "userService", - "apiMappings": [ - { - "apiMethodName": "createUser", - "method": "POST", - "path": "/api/auth/admin/users", - "triggerSources": [ - { - "component": "UserManagement", - "triggerName": "usermanagement-submit-fksbqh", - "triggerType": "button" - } - ] - }, - { - "apiMethodName": "updateUser", - "method": "PUT", - "path": "/api/auth/admin/users/{id}", - "triggerSources": [ - { - "component": "UserManagement", - "triggerName": "usermanagement-submit-fksbqh", - "triggerType": "button" - } - ] - }, - { - "apiMethodName": "deleteUser", - "method": "DELETE", - "path": "/api/auth/admin/users/{id}", - "triggerSources": [ - { - "component": "UserManagement", - "triggerName": "usermanagement-button-tvncrr", - "triggerType": "button" - } - ] - }, - { - "apiMethodName": "changePassword", - "method": "POST", - "path": "/api/auth/change-password", - "triggerSources": [ - { - "component": "PasswordChangeModal", - "triggerName": "passwordchangemodal-submit-2p704c", - "triggerType": "button" - } - ] - }, - { - "apiMethodName": "validatePassword", - "method": "POST", - "path": "/api/auth/validate-password", - "triggerSources": [ - { - "component": "PasswordChangeModal", - "triggerName": "passwordchangemodal-input-b0ca4h", - "triggerType": "input" - } - ] - }, - { - "apiMethodName": "changePassword", - "method": "POST", - "path": "/api/auth/change-password", - "triggerSources": [ - { - "component": "PasswordChangeModal", - "triggerName": "passwordchangemodal-submit-2p704c", - "triggerType": "button" - } - ] - } - ] - } - ] + "apiMappings": [] }; \ No newline at end of file