Beispiel #1
0
func comments(article *models.Article) (a []*Article) {
	_, list, _ := article.AdminComments(0, 0)
	for _, c := range list {
		art := convertArticle(&c)
		if len(c.Reviews) > 0 {
			art.CommentList = comments(&c)
		}
		a = append(a, art)
	}
	return a
}
Beispiel #2
0
func comments(redis *models.RedisLogger, article *models.Article, pageIndex, pageCount int) (a []*articleInfo) {
	_, list, _ := article.AdminComments(pageIndex, pageCount)
	for _, c := range list {
		art := convertArticle(&c, redis)
		if len(c.Reviews) > 0 {
			art.Comments = comments(redis, &c, 0, 0)
		}
		a = append(a, art)
	}
	return a
}