Improve search

This commit is contained in:
2025-09-08 19:34:57 +08:00
parent b4a63d3935
commit 5fe45611c9
4 changed files with 71 additions and 69 deletions

View File

@@ -9,6 +9,10 @@ import (
"time"
)
const (
maxTagLength = 20
)
func init() {
// Start a goroutine to delete unused tags every hour
go func() {
@@ -25,6 +29,9 @@ func init() {
}
func CreateTag(uid uint, name string) (*model.TagView, error) {
if len([]rune(name)) > maxTagLength {
return nil, model.NewRequestError("Tag name too long")
}
canUpload, err := checkUserCanUpload(uid)
if err != nil {
log.Error("Error checking user permissions:", err)