-
Notifications
You must be signed in to change notification settings - Fork 2
feat(admin): add transfer log tab and polish storage ui #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8aae2b2
feat(admin): add transfer log tab and polish storage ui
zy84338719 6d6c931
优化
zy84338719 de0bf67
release: v1.9.1
zy84338719 db3f230
release: v1.9.1 docs & remove generated embed
zy84338719 16df4a7
ci: gate heavy workflows to tags and explicit flags/labels
zy84338719 68407df
docs(CONTRIBUTING): explain CI gating and how to trigger heavy workflows
zy84338719 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package db | ||
|
|
||
| import "gorm.io/gorm" | ||
|
|
||
| // TransferLog 记录上传/下载操作日志 | ||
| // 当系统要求登录上传/下载时,用于追踪用户行为 | ||
| // Operation: upload 或 download | ||
| // DurationMs: 针对下载记录耗时,上传默认为0 | ||
| // Username保留冗余信息,便于查询,即使用户被删除仍保留原始名字 | ||
| type TransferLog struct { | ||
| gorm.Model | ||
| Operation string `gorm:"size:20;index" json:"operation"` | ||
| FileCodeID uint `gorm:"index" json:"file_code_id"` | ||
| FileCode string `gorm:"size:255" json:"file_code"` | ||
| FileName string `gorm:"size:255" json:"file_name"` | ||
| FileSize int64 `json:"file_size"` | ||
| UserID *uint `gorm:"index" json:"user_id"` | ||
| Username string `gorm:"size:100" json:"username"` | ||
| IP string `gorm:"size:45" json:"ip"` | ||
| DurationMs int64 `json:"duration_ms"` | ||
| } | ||
|
|
||
| // TransferLogQuery 查询条件 | ||
| type TransferLogQuery struct { | ||
| Operation string `json:"operation"` | ||
| UserID *uint `json:"user_id"` | ||
| Search string `json:"search"` | ||
| Page int `json:"page"` | ||
| PageSize int `json:"page_size"` | ||
| } |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling
strings.TrimSpaceon empty default values is unnecessary since empty strings don't have leading/trailing whitespace. Consider checking for non-empty values before trimming or moving the trimming logic into the service layer.