fix: 实现空间 TotalReads 统计,修复 selectMention 闭包
- P0-2: posts/show.html selectMention 闭包 var→let 修复 - P0-3: GetUserStats 增加 SUM(views_count) 统计,替换硬编码 int64(0) - 更新 Fix_List.md 标注 P0-1/2/3 已修复
This commit is contained in:
@ -56,7 +56,7 @@ type spaceUserStore interface {
|
||||
type spacePostStore interface {
|
||||
FindByUserID(userID uint, offset, limit int) ([]model.Post, int64, error)
|
||||
CountUserPosts(userID uint) (int64, error)
|
||||
GetUserStats(userID uint) (likes, favorites int64, err error)
|
||||
GetUserStats(userID uint) (likes, favorites, reads int64, err error)
|
||||
}
|
||||
|
||||
// postAdminStatStore AdminService 所需的帖子统计接口(ISP:2 个方法)
|
||||
|
||||
@ -29,8 +29,8 @@ func (s *SpaceService) CountUserPosts(uid uint) (int64, error) {
|
||||
return s.postRepo.CountUserPosts(uid)
|
||||
}
|
||||
|
||||
// GetUserStats 获取用户文章统计数据(总获赞、总收藏)
|
||||
func (s *SpaceService) GetUserStats(uid uint) (likes, favorites int64, err error) {
|
||||
// GetUserStats 获取用户文章统计数据(总获赞、总收藏、总阅读)
|
||||
func (s *SpaceService) GetUserStats(uid uint) (likes, favorites, reads int64, err error) {
|
||||
return s.postRepo.GetUserStats(uid)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user