feat: 优化首页帖子列表并新增右侧栏最新注册组件
首页列表精简 meta 与统计展示,板块色标前移并淡化;有回复时显示最后回复人。右侧栏新增最新注册(4 列头像网格),友链改为标签块并排换行。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1141,6 +1141,19 @@ func (h *Handlers) APIRecentComments(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"comments": list})
|
||||
}
|
||||
|
||||
// APIRecentUsers 最新注册用户(右栏)
|
||||
func (h *Handlers) APIRecentUsers(c *gin.Context) {
|
||||
list, err := h.User.ListRecentRegistered(8)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []service.RecentUserItem{}
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"users": list})
|
||||
}
|
||||
|
||||
// APIFavorites 我的收藏
|
||||
func (h *Handlers) APIFavorites(c *gin.Context) {
|
||||
page, _ := strconv.Atoi(c.DefaultQuery("page", "1"))
|
||||
|
||||
Reference in New Issue
Block a user