Skip to content

feat: enhance homepage version management with database persistence#757

Merged
zhuwh merged 3 commits intoSuanmoSuanyangTechnology:developfrom
wanxunyang:feature/tenant-billing-user-management
Apr 1, 2026
Merged

feat: enhance homepage version management with database persistence#757
zhuwh merged 3 commits intoSuanmoSuanyangTechnology:developfrom
wanxunyang:feature/tenant-billing-user-management

Conversation

@wanxunyang
Copy link
Copy Markdown
Collaborator

@wanxunyang wanxunyang commented Apr 1, 2026

Summary by Sourcery

从数据库中持久化并提供首页版本信息,并在需要时回退到基于环境变量的 JSON 配置。

新功能:

  • 暴露一个 API 端点,从基于数据库的版本说明中返回最新发布的系统版本及其本地化介绍,并在必要时回退到配置。

增强改进:

  • 增加仓库层支持以获取最新发布版本的介绍,并重构版本介绍的获取逻辑,以使用结构化字段,包括本地化内容和基于时间戳的发布日期。
Original summary in English

Summary by Sourcery

Persist and serve homepage version information from the database with a fallback to environment-based JSON configuration.

New Features:

  • Expose an API endpoint that returns the latest published system version and its localized introduction from database-backed version notes, falling back to configuration when necessary.

Enhancements:

  • Add repository support for fetching the latest published version introduction and refactor version introduction retrieval to use structured fields, including localized content and timestamp-based release dates.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 1, 2026

Reviewer's Guide

添加基于数据库的首页最新已发布版本信息检索;重构版本介绍查询逻辑以直接使用存储在 version_notes 中的字段;更新版本 API endpoint,在具备安全默认值的前提下优先使用数据库数据,并以 JSON 作为回退方案。

带数据库回退逻辑的系统版本增强检索顺序图

sequenceDiagram
    actor User
    participant HomePageController
    participant SessionLocal
    participant DB
    participant HomePageRepository
    participant HomePageService

    User->>HomePageController: GET /home/version

    HomePageController->>SessionLocal: create Session
    SessionLocal-->>HomePageController: db_session

    HomePageController->>HomePageRepository: get_latest_version_introduction(db_session)
    HomePageRepository->>DB: query version_notes where is_published == true
    DB-->>HomePageRepository: latest published note
    HomePageRepository-->>HomePageController: (version, version_info) or (None, None)

    HomePageController->>SessionLocal: db_session.close()

    alt latest version from DB found
        HomePageController-->>User: success(version, version_info)
    else no DB version or DB error
        HomePageController->>HomePageService: load_version_introduction(settings.SYSTEM_VERSION)
        HomePageService-->>HomePageController: version_info or None

        alt JSON version info found
            HomePageController-->>User: success(version=settings.SYSTEM_VERSION, version_info)
        else no DB and no JSON info
            HomePageController->>HomePageController: build empty introduction/introduction_en
            HomePageController-->>User: success(version=settings.SYSTEM_VERSION, empty_version_info)
        end
    end
Loading

基于 version_notes 的首页版本数据 ER 图

erDiagram
    version_notes {
        int id PK
        varchar version
        varchar code_name
        varchar code_name_en
        date release_date
        varchar upgrade_position
        varchar upgrade_position_en
        json core_upgrades
        json core_upgrades_en
        bool is_published
    }

    version_note_items {
        int id PK
        int note_id FK
        int sort_order
        varchar title
        text content
    }

    version_notes ||--o{ version_note_items : has
Loading

更新后的首页版本管理类图

classDiagram

    class HomePageController {
        +get_system_version() ApiResponse
    }

    class HomePageRepository {
        +get_latest_version_introduction(db Session) (str, Dict)
        +get_version_introduction(db Session, version str) Dict
    }

    class HomePageService {
        +load_version_introduction(version str) Dict
    }

    class VersionNotes {
        +id: int
        +version: str
        +code_name: str
        +code_name_en: str
        +release_date: date
        +upgrade_position: str
        +upgrade_position_en: str
        +core_upgrades: list
        +core_upgrades_en: list
        +is_published: bool
    }

    class SessionLocal {
        +__call__() Session
    }

    class Session {
        +bind: Engine
        +engine: Engine
        +query(table)
        +close()
    }

    HomePageController ..> HomePageRepository : uses
    HomePageController ..> HomePageService : uses
    HomePageController ..> SessionLocal : creates_session

    HomePageRepository ..> Session : db_access
    HomePageRepository ..> VersionNotes : reflects_table
Loading

File-Level Changes

Change Details Files
添加仓储辅助方法,通过反射从数据库中获取最新已发布的版本介绍,并组装本地化的介绍负载。
  • 在首页仓储中新增静态方法 get_latest_version_introduction,通过 SQLAlchemy MetaData 反射 version_notes 表。
  • release_dateversion 排序查询最新的已发布版本,将行字段映射为 introductionintroduction_en 结构,包含代号、毫秒级时间戳的发布时间、升级位置以及核心升级数组。
  • 在数据缺失或出现异常时返回 (None, None),并打印 traceback 以便调试。
api/app/repositories/home_page_repository.py
重构指定版本介绍的获取逻辑,改为使用新的 schema 字段和时间戳格式,而不是关联 version_note_items
  • 移除对 version_note_items 表的反射和查询,以及从独立条目手动组装 core_upgrades 的逻辑。
  • 使用 version_notes 上新增的字段(code_name, code_name_en, upgrade_position, upgrade_position_en, core_upgrades, core_upgrades_en)来构建双语版本介绍负载。
  • releaseDate 从 ISO 字符串改为毫秒级 UNIX 时间戳,通过 datetime.combinetime 构建,并新增通用异常处理,在失败时返回 None
api/app/repositories/home_page_repository.py
更新系统版本 API endpoint,在存在环境变量和空结构回退的前提下,优先使用基于数据库的最新已发布版本信息。
  • 修改 get_system_version 控制器,首先打开数据库会话并调用仓储的 get_latest_version_introduction,在查询前后记录 debug 日志。
  • 如果未找到数据库版本或发生错误,则回退到 settings.SYSTEM_VERSION 和基于 JSON 的 HomePageService.load_version_introduction
  • 通过在数据库和 JSON 查询都失败时提供空的 introduction/introduction_en 结构来确保 version_info 非空,同时仍返回解析后的版本字符串。
api/app/controllers/home_page_controller.py

Tips and commands

Interacting with Sourcery

  • 触发新评审: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的评审评论。
  • 从评审评论生成 GitHub issue: 在评审评论下回复,请求 Sourcery 从该评论创建 issue。你也可以直接回复 @sourcery-ai issue 来从该评论创建 issue。
  • 生成 pull request 标题: 在 pull request 标题任意位置写上 @sourcery-ai 即可随时生成标题。也可以在 pull request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 pull request 总结: 在 pull request 正文任意位置写上 @sourcery-ai summary,即可在该位置生成 PR 总结。也可以在 pull request 中评论 @sourcery-ai summary 来(重新)生成总结。
  • 生成 Reviewer's Guide: 在 pull request 中评论 @sourcery-ai guide 来(重新)生成 Reviewer's Guide。
  • 一次性标记解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,将所有 Sourcery 评论标记为已解决。适用于你已经处理完所有评论且不想继续看到它们的情况。
  • 一次性取消所有 Sourcery 评审: 在 pull request 中评论 @sourcery-ai dismiss 来取消所有现有的 Sourcery 评审。尤其适合希望以一次全新的评审重新开始的场景——别忘了再评论 @sourcery-ai review 来触发新的评审!

Customizing Your Experience

前往你的 dashboard 以:

  • 启用或禁用评审功能,例如 Sourcery 自动生成的 pull request 总结、Reviewer's Guide 等。
  • 修改评审语言。
  • 添加、删除或编辑自定义评审指令。
  • 调整其他评审设置。

Getting Help

Original review guide in English

Reviewer's Guide

Adds database-backed retrieval of the latest published homepage version information, refactors version introduction lookup to use fields stored in version_notes directly, and updates the version API endpoint to prefer DB data with a JSON-based fallback and safe defaults.

Sequence diagram for enhanced system version retrieval with DB fallback

sequenceDiagram
    actor User
    participant HomePageController
    participant SessionLocal
    participant DB
    participant HomePageRepository
    participant HomePageService

    User->>HomePageController: GET /home/version

    HomePageController->>SessionLocal: create Session
    SessionLocal-->>HomePageController: db_session

    HomePageController->>HomePageRepository: get_latest_version_introduction(db_session)
    HomePageRepository->>DB: query version_notes where is_published == true
    DB-->>HomePageRepository: latest published note
    HomePageRepository-->>HomePageController: (version, version_info) or (None, None)

    HomePageController->>SessionLocal: db_session.close()

    alt latest version from DB found
        HomePageController-->>User: success(version, version_info)
    else no DB version or DB error
        HomePageController->>HomePageService: load_version_introduction(settings.SYSTEM_VERSION)
        HomePageService-->>HomePageController: version_info or None

        alt JSON version info found
            HomePageController-->>User: success(version=settings.SYSTEM_VERSION, version_info)
        else no DB and no JSON info
            HomePageController->>HomePageController: build empty introduction/introduction_en
            HomePageController-->>User: success(version=settings.SYSTEM_VERSION, empty_version_info)
        end
    end
Loading

ER diagram for version_notes based homepage version data

erDiagram
    version_notes {
        int id PK
        varchar version
        varchar code_name
        varchar code_name_en
        date release_date
        varchar upgrade_position
        varchar upgrade_position_en
        json core_upgrades
        json core_upgrades_en
        bool is_published
    }

    version_note_items {
        int id PK
        int note_id FK
        int sort_order
        varchar title
        text content
    }

    version_notes ||--o{ version_note_items : has
Loading

Class diagram for updated homepage version management

classDiagram

    class HomePageController {
        +get_system_version() ApiResponse
    }

    class HomePageRepository {
        +get_latest_version_introduction(db Session) (str, Dict)
        +get_version_introduction(db Session, version str) Dict
    }

    class HomePageService {
        +load_version_introduction(version str) Dict
    }

    class VersionNotes {
        +id: int
        +version: str
        +code_name: str
        +code_name_en: str
        +release_date: date
        +upgrade_position: str
        +upgrade_position_en: str
        +core_upgrades: list
        +core_upgrades_en: list
        +is_published: bool
    }

    class SessionLocal {
        +__call__() Session
    }

    class Session {
        +bind: Engine
        +engine: Engine
        +query(table)
        +close()
    }

    HomePageController ..> HomePageRepository : uses
    HomePageController ..> HomePageService : uses
    HomePageController ..> SessionLocal : creates_session

    HomePageRepository ..> Session : db_access
    HomePageRepository ..> VersionNotes : reflects_table
Loading

File-Level Changes

Change Details Files
Add repository helper to fetch the latest published version introduction from the database using reflection and assemble localized introduction payloads.
  • Introduce get_latest_version_introduction static method in the home page repository that reflects the version_notes table via SQLAlchemy MetaData.
  • Query the latest published version ordered by release_date and version, and map row fields into introduction and introduction_en structures with code name, release timestamp in ms, upgrade position, and core upgrades arrays.
  • Handle missing data and any exceptions by returning (None, None) and printing a traceback for debugging.
api/app/repositories/home_page_repository.py
Refactor retrieval of a specific version introduction to use new schema fields and timestamp format instead of joining version_note_items.
  • Remove reflection and querying of the version_note_items table and the manual assembly of core_upgrades from separate items.
  • Use additional fields on version_notes (code_name, code_name_en, upgrade_position, upgrade_position_en, core_upgrades, core_upgrades_en) to build both localized introduction payloads.
  • Change releaseDate from ISO string to a millisecond UNIX timestamp built via datetime.combine and time, and add a generic exception handler that returns None on failure.
api/app/repositories/home_page_repository.py
Update the system version API endpoint to prefer DB-based latest published version info with environment-based and empty-structure fallbacks.
  • Modify get_system_version controller to first open a DB session and call the repository’s get_latest_version_introduction, logging debug messages around the lookup.
  • If no DB version is found or an error occurs, fall back to settings.SYSTEM_VERSION and JSON-based HomePageService.load_version_introduction.
  • Ensure a non-null version_info response by providing empty introduction/introduction_en structures when both DB and JSON lookups fail, while still returning the resolved version string.
api/app/controllers/home_page_controller.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了两个问题,并且给出了一些整体性的反馈:

  • get_latest_version_introduction 中,你使用了 datetimetime 却没有导入它们(不同于 get_version_introduction 中的做法),这会导致 NameError;建议在该函数中添加相同的导入,或者把时间戳转换逻辑集中到一个共享的辅助函数中。
  • 新增的数据库访问路径(get_latest_version_introductionget_system_version)中使用了 print / traceback.print_exc() 以及宽泛的 except Exception;建议改用统一的日志记录机制,并将异常范围收窄到预期的失败场景,这样更易于维护。
  • version_info 字典的构建逻辑(introduction/introduction_en 字段和时间戳转换)在 get_latest_version_introductionget_version_introduction 和 controller 的兜底逻辑之间是重复的;建议提取一个共享的辅助函数,避免逻辑分叉,也方便后续修改。
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `get_latest_version_introduction` you use `datetime` and `time` without importing them (unlike in `get_version_introduction`), which will raise a `NameError`; consider adding the same import there or centralizing the timestamp conversion helper.
- The new database access paths (`get_latest_version_introduction` and `get_system_version`) use `print`/`traceback.print_exc()` and broad `except Exception` blocks; it would be cleaner to use your standard logging facilities and narrow the exceptions to expected failure cases.
- The construction of the `version_info` dict (introduction/introduction_en fields and timestamp conversion) is duplicated between `get_latest_version_introduction`, `get_version_introduction`, and the controller fallback; consider extracting a shared helper to avoid divergence and make future changes easier.

## Individual Comments

### Comment 1
<location path="api/app/controllers/home_page_controller.py" line_range="43-52" />
<code_context>
+    try:
+        db = SessionLocal()
+        try:
+            print(f"[DEBUG] 开始从数据库获取最新版本...")
+            current_version, version_info = HomePageRepository.get_latest_version_introduction(db)
+            if current_version:
+                print(f"[DEBUG] 数据库获取成功:version={current_version}")
+            else:
+                print(f"[DEBUG] 数据库获取失败:current_version=None")
+        finally:
+            db.close()
+    except Exception as e:
+        print(f"[DEBUG] 数据库查询异常:{e}")
+        pass
+    
</code_context>
<issue_to_address>
**suggestion:** Direct `print`-based debugging in the controller will clutter stdout and is hard to manage in production.

In `get_system_version`, replace the `[DEBUG]` print statements with the existing logging framework (e.g., `logger.info` / `logger.warning`) so logs can be managed and filtered properly. If these were only for local troubleshooting, they should be removed before merging.
</issue_to_address>

### Comment 2
<location path="api/app/controllers/home_page_controller.py" line_range="61-66" />
<code_context>
+    
+    # 3️⃣ 如果数据库和 JSON 都没有,返回基本信息
+    if not version_info:
+        version_info = {
+            "introduction": {"codeName": "", "releaseDate": "", "upgradePosition": "", "coreUpgrades": []},
+            "introduction_en": {"codeName": "", "releaseDate": "", "upgradePosition": "", "coreUpgrades": []}
+        }
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Fallback `releaseDate` type differs from the integer timestamp used in the DB-backed paths.

Repository methods now use an integer timestamp (ms) for `releaseDate`, but this fallback sets it to an empty string. This type mismatch can break callers expecting a number. Please return a numeric value (e.g., `0`) or `None` here to keep `releaseDate`’s type consistent across all code paths.

```suggestion
    # 3️⃣ 如果数据库和 JSON 都没有,返回基本信息
    #    注意:releaseDate 保持为整型时间戳(ms),避免与数据库返回的类型不一致
    if not version_info:
        version_info = {
            "introduction": {"codeName": "", "releaseDate": 0, "upgradePosition": "", "coreUpgrades": []},
            "introduction_en": {"codeName": "", "releaseDate": 0, "upgradePosition": "", "coreUpgrades": []}
        }
```
</issue_to_address>

Sourcery 对开源项目免费——如果你觉得我们的审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English

Hey - I've found 2 issues, and left some high level feedback:

  • In get_latest_version_introduction you use datetime and time without importing them (unlike in get_version_introduction), which will raise a NameError; consider adding the same import there or centralizing the timestamp conversion helper.
  • The new database access paths (get_latest_version_introduction and get_system_version) use print/traceback.print_exc() and broad except Exception blocks; it would be cleaner to use your standard logging facilities and narrow the exceptions to expected failure cases.
  • The construction of the version_info dict (introduction/introduction_en fields and timestamp conversion) is duplicated between get_latest_version_introduction, get_version_introduction, and the controller fallback; consider extracting a shared helper to avoid divergence and make future changes easier.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `get_latest_version_introduction` you use `datetime` and `time` without importing them (unlike in `get_version_introduction`), which will raise a `NameError`; consider adding the same import there or centralizing the timestamp conversion helper.
- The new database access paths (`get_latest_version_introduction` and `get_system_version`) use `print`/`traceback.print_exc()` and broad `except Exception` blocks; it would be cleaner to use your standard logging facilities and narrow the exceptions to expected failure cases.
- The construction of the `version_info` dict (introduction/introduction_en fields and timestamp conversion) is duplicated between `get_latest_version_introduction`, `get_version_introduction`, and the controller fallback; consider extracting a shared helper to avoid divergence and make future changes easier.

## Individual Comments

### Comment 1
<location path="api/app/controllers/home_page_controller.py" line_range="43-52" />
<code_context>
+    try:
+        db = SessionLocal()
+        try:
+            print(f"[DEBUG] 开始从数据库获取最新版本...")
+            current_version, version_info = HomePageRepository.get_latest_version_introduction(db)
+            if current_version:
+                print(f"[DEBUG] 数据库获取成功:version={current_version}")
+            else:
+                print(f"[DEBUG] 数据库获取失败:current_version=None")
+        finally:
+            db.close()
+    except Exception as e:
+        print(f"[DEBUG] 数据库查询异常:{e}")
+        pass
+    
</code_context>
<issue_to_address>
**suggestion:** Direct `print`-based debugging in the controller will clutter stdout and is hard to manage in production.

In `get_system_version`, replace the `[DEBUG]` print statements with the existing logging framework (e.g., `logger.info` / `logger.warning`) so logs can be managed and filtered properly. If these were only for local troubleshooting, they should be removed before merging.
</issue_to_address>

### Comment 2
<location path="api/app/controllers/home_page_controller.py" line_range="61-66" />
<code_context>
+    
+    # 3️⃣ 如果数据库和 JSON 都没有,返回基本信息
+    if not version_info:
+        version_info = {
+            "introduction": {"codeName": "", "releaseDate": "", "upgradePosition": "", "coreUpgrades": []},
+            "introduction_en": {"codeName": "", "releaseDate": "", "upgradePosition": "", "coreUpgrades": []}
+        }
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Fallback `releaseDate` type differs from the integer timestamp used in the DB-backed paths.

Repository methods now use an integer timestamp (ms) for `releaseDate`, but this fallback sets it to an empty string. This type mismatch can break callers expecting a number. Please return a numeric value (e.g., `0`) or `None` here to keep `releaseDate`’s type consistent across all code paths.

```suggestion
    # 3️⃣ 如果数据库和 JSON 都没有,返回基本信息
    #    注意:releaseDate 保持为整型时间戳(ms),避免与数据库返回的类型不一致
    if not version_info:
        version_info = {
            "introduction": {"codeName": "", "releaseDate": 0, "upgradePosition": "", "coreUpgrades": []},
            "introduction_en": {"codeName": "", "releaseDate": 0, "upgradePosition": "", "coreUpgrades": []}
        }
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread api/app/controllers/home_page_controller.py Outdated
Comment on lines +61 to +66
# 3️⃣ 如果数据库和 JSON 都没有,返回基本信息
if not version_info:
version_info = {
"introduction": {"codeName": "", "releaseDate": "", "upgradePosition": "", "coreUpgrades": []},
"introduction_en": {"codeName": "", "releaseDate": "", "upgradePosition": "", "coreUpgrades": []}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): 兜底逻辑里的 releaseDate 类型与数据库路径中使用的整型时间戳不一致。

当前仓库方法对 releaseDate 使用的是整型时间戳(毫秒),但这里的兜底逻辑却把它设为一个空字符串。这种类型不一致会导致期望数字的调用方出现问题。请在这里返回数值类型(例如 0)或 None,以保证所有代码路径中 releaseDate 的类型保持一致。

Suggested change
# 3️⃣ 如果数据库和 JSON 都没有,返回基本信息
if not version_info:
version_info = {
"introduction": {"codeName": "", "releaseDate": "", "upgradePosition": "", "coreUpgrades": []},
"introduction_en": {"codeName": "", "releaseDate": "", "upgradePosition": "", "coreUpgrades": []}
}
# 3️⃣ 如果数据库和 JSON 都没有,返回基本信息
# 注意:releaseDate 保持为整型时间戳(ms),避免与数据库返回的类型不一致
if not version_info:
version_info = {
"introduction": {"codeName": "", "releaseDate": 0, "upgradePosition": "", "coreUpgrades": []},
"introduction_en": {"codeName": "", "releaseDate": 0, "upgradePosition": "", "coreUpgrades": []}
}
Original comment in English

suggestion (bug_risk): Fallback releaseDate type differs from the integer timestamp used in the DB-backed paths.

Repository methods now use an integer timestamp (ms) for releaseDate, but this fallback sets it to an empty string. This type mismatch can break callers expecting a number. Please return a numeric value (e.g., 0) or None here to keep releaseDate’s type consistent across all code paths.

Suggested change
# 3️⃣ 如果数据库和 JSON 都没有,返回基本信息
if not version_info:
version_info = {
"introduction": {"codeName": "", "releaseDate": "", "upgradePosition": "", "coreUpgrades": []},
"introduction_en": {"codeName": "", "releaseDate": "", "upgradePosition": "", "coreUpgrades": []}
}
# 3️⃣ 如果数据库和 JSON 都没有,返回基本信息
# 注意:releaseDate 保持为整型时间戳(ms),避免与数据库返回的类型不一致
if not version_info:
version_info = {
"introduction": {"codeName": "", "releaseDate": 0, "upgradePosition": "", "coreUpgrades": []},
"introduction_en": {"codeName": "", "releaseDate": 0, "upgradePosition": "", "coreUpgrades": []}
}

@zhuwh zhuwh merged commit 7b5b2ab into SuanmoSuanyangTechnology:develop Apr 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants