Skip to content

[Bug] 代码生成的部分后端部分接收参数是long xxxId,与前端传入的ApiId<string>类型不匹配导致值丢失 #49

Open

Description

@coffee0818

前置确认

  • 我已搜索过 现有 Issue,确认这不是重复问题
  • 我已尝试更新到最新版本,问题依旧存在
  • 我确认这是一个 Bug,而非使用方式或环境配置问题

问题描述

XiHanBasicApp\backend\src\modules\XiHan.BasicApp.CodeGeneration\Application\AppServices\CodeGenerationAppService.cs文件,Task SyncSchemaAsync(long tableId,...),这里要接收的是long类型。但是前端传参是 syncSchema(tableId: ApiId) ;而ApiId是string类型,导致参数不匹配丢失数值默认到tableId=0报错。
前端代码生成-添加数据源,然后点击测试连接,一样的问题。

复现步骤

代码生成 - 表配置 - 选择数据表导入后,更多-同步表结构就能报错。
代码生成 - 数据源 - 新增数据源,点测试连接后就能报错。

期望行为

正常同步。

实际行为

No response

影响范围

后端(.NET / API)

相关模块

CodeGeneration(代码生成)

版本

v5.9.1

运行环境

  • 操作系统:
  • .NET SDK:10
  • Node.js / pnpm:22.14.1
  • 数据库(PostgreSQL / MySQL / MariaDB + 版本):PostgreSQL 18
  • Redis:8.8.1
  • 浏览器(前端问题):Chrome 156.0.8078.48

日志 / 截图


补充说明

No response

Activity

  1. changed the title [-][Bug][/-] [+][Bug] 代码生成的部分后端部分接收参数是long xxxId,与前端传入的ApiId<string>类型不匹配导致值丢失[/+] on Oct 23, 2026
  2. zhaifanhua commented on Oct 28, 2026

    @zhaifanhua
    Member

    下个版本(next),将整体重构整个框架,欢迎关注。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions