feat(version): add version history tracking with GetVersionHistoryList endpoint#470
Closed
155TuT wants to merge 0 commit into
Closed
feat(version): add version history tracking with GetVersionHistoryList endpoint#470155TuT wants to merge 0 commit into
155TuT wants to merge 0 commit into
Conversation
renbaoshuo
reviewed
Apr 26, 2026
Member
renbaoshuo
left a comment
There was a problem hiding this comment.
现在既然已经把版本信息存到了数据库里面,那么获取版本信息的时候也可以直接从数据库里面返回了,存到又拍云的 version.json 可以准备弃用掉。实现的时候记得加 Redis 缓存。
Comment on lines
+144
to
+153
| struct VersionHistory{ | ||
| 1: required i64 id, | ||
| 2: required string version, | ||
| 3: required string code, | ||
| 4: required string url, | ||
| 5: required string feature, | ||
| 6: required bool force, | ||
| 7: required string type, | ||
| 8: required string created_at, | ||
| } |
Author
There was a problem hiding this comment.
已移到model.thrift中并删除了源文件中的 VersionHistory
Comment on lines
+36
to
+47
| // GetVersionHistoryList returns all version history records ordered by created_at descending. | ||
| // Returns an empty slice (not nil) when no records exist. | ||
| func (c *DBVersion) GetVersionHistoryList(ctx context.Context) ([]*model.VersionHistory, error) { | ||
| var history []*model.VersionHistory | ||
| err := c.client.WithContext(ctx).Table(constants.VersionHistoryTableName). | ||
| Order("created_at desc"). | ||
| Find(&history).Error | ||
| if err != nil { | ||
| return nil, errno.Errorf(errno.InternalDatabaseErrorCode, "dal.GetVersionHistoryList error: %v", err) | ||
| } | ||
| return history, nil | ||
| } |
Author
There was a problem hiding this comment.
已拆到 pkg/db/version/get_version_history.go,包括 GetVersionHistoryList 和GetLatestVersionByType
原文件只保留了 CreateversionHistory
Author
GetReleaseVersion/GetBetaVersion 现在从 version_history DB 读取 10 分钟 Redis 缓存
|
Author
|
添加且仅添加了ssh签名(未改动上一版代码),变基到了现有的分支以在commit中不显示合并其他人的commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
自查 PR 结构
PR 标题符合这个格式: <type>(optional scope): <description>
此 PR 标题的描述以用户为导向,足够清晰,其他人可以理解。
我已经对所有 commit 提供了签名(GPG 密钥签名、SSH 密钥签名)
这个 PR 属于强制变更/破坏性更改
这个 PR 的类型是什么?
这个 PR 做了什么 / 我们为什么需要这个 PR?
新增版本历史列表接口以便于后续后端dashboard的开发(大概)
(可选)这个 PR 解决了哪个/些 issue?
用以解决issues 446,新增版本历史列表接口,开一个pr先给大家审查,确保理解的标准和规范无误再增加其他接口
对 Reviewer 预留的一些提醒
已使用 SKILL.md 自查、通过本地编译,但未进行服务器部署测试(还不熟悉 + 没权限操作服务器)