Skip to content

标签管理#9197

Closed
Leslie-Xy wants to merge 2 commits intoAlistGo:mainfrom
Leslie-Xy:label
Closed

标签管理#9197
Leslie-Xy wants to merge 2 commits intoAlistGo:mainfrom
Leslie-Xy:label

Conversation

@Leslie-Xy
Copy link
Copy Markdown
Contributor

标签管理

@petercat-assistant
Copy link
Copy Markdown

Walkthrough

此PR引入了标签管理功能,添加了对标签和标签文件绑定的数据库模型和操作方法。它包括标签的创建、更新、删除和获取功能,以及标签与文件的绑定和解绑功能。还更新了API路由以支持这些操作。

Changes

文件 概要
internal/db/db.go 更新数据库迁移以包括新模型Label和LabelFileBinDing。
internal/db/label.go 添加标签相关的数据库操作方法。
internal/db/label_file_binding.go 添加标签文件绑定相关的数据库操作方法。
internal/model/label.go 定义Label模型。
internal/model/label_file_binding.go 定义LabelFileBinDing模型。
internal/op/label.go 添加标签删除操作方法。
internal/op/label_file_binding.go 添加获取文件名对应标签的方法。
server/handles/fsread.go 更新文件系统读取以支持标签列表。
server/handles/label.go 添加标签管理相关的HTTP处理方法。
server/handles/label_file_binding.go 添加标签文件绑定相关的HTTP处理方法。
server/router.go 更新路由以支持标签和标签文件绑定操作。

Comment thread internal/op/label_file_binding.go Outdated
func CreateLabelFileBinDing(labelIds, fileName string, userId uint) error {
labelMap := strings.Split(labelIds, ",")
for _, value := range labelMap {
labelId, _ := strconv.ParseUint(value, 10, 64)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The error returned by strconv.ParseUint is being ignored. This could lead to unexpected behavior if the conversion fails. It's important to handle this error to ensure that labelId is correctly parsed.

@Leslie-Xy
Copy link
Copy Markdown
Contributor Author

Leslie-Xy commented Jul 3, 2025 via email

@Leslie-Xy Leslie-Xy closed this by deleting the head repository Jul 24, 2025
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.

1 participant