fix: UID 类型混用统一(uint ↔ string)

- Comment.ReplyToUID string→uint, 移除 varchar(36) gorm 约束
- CommentMention.UID string→uint, 移除 varchar(36) gorm 约束
- UserSearchResult.UID string→uint
- 移除 SearchUsersByLevel 中 strconv.FormatUint 转换
- 删除 GetUserUIDByID 方法,CreateReply 直接使用 parent.UserID
- fillReplyToNames 使用 map[uint]string 替代 map[string]string
- 更新 commentStore 接口声明
- 修复前端 mention 下拉 show.html 中 u.id→u.uid
This commit is contained in:
2026-06-02 19:26:44 +08:00
parent 5911cee01c
commit 99d16190a8
6 changed files with 18 additions and 34 deletions

View File

@ -154,11 +154,10 @@ type commentStore interface {
FindPostIDByComment(commentID uint) (uint, error)
FindPostAuthorID(postID uint) (uint, error)
SearchUsersByLevel(keyword string, minLevel, limit int) ([]struct {
UID string
UID uint
Username string
Exp int
}, error)
GetUserUIDByID(userID uint) (string, error)
GetUsernameByID(userID uint) (string, error)
ListAllComments(keyword string, showDeleted bool, offset, limit int) ([]model.AdminCommentRow, int64, error)
}