topic

package
v0.30.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2022 License: AGPL-3.0, AGPL-3.0-only Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentType added in v0.30.3

type CommentType uint32
const (
	CommentTypeUnknown CommentType = iota
	CommentTypeSubjectTopic
	CommentTypeGroupTopic
	CommentIndex
	CommentCharacter
	CommentPerson
	CommentEpisode
)

type Repo added in v0.30.3

type Repo interface {
	Get(ctx context.Context, topicType Type, id model.TopicID) (model.Topic, error)

	// Count all topic for a subject/group.
	Count(ctx context.Context, topicType Type, id uint32, displays []model.TopicDisplay) (int64, error)

	// List return paged topic list of a subject/group.
	// userID should not be filtered
	List(
		ctx context.Context,
		topicType Type,
		id uint32,
		displays []model.TopicDisplay,
		limit int, offset int,
	) ([]model.Topic, error)

	GetTopicContent(ctx context.Context, topicType Type, id model.TopicID) (model.Comment, error)

	// CountReplies top comments for a topic/index/character/person/episode.
	// 一级回复
	// 小组和条目帖子会去除楼主发帖
	CountReplies(ctx context.Context, commentType CommentType, id model.TopicID) (int64, error)

	// ListReplies return paged top comment tree.
	//
	//  []model.Comment{
	//    一级回复
	// 		{
	//  	  一级回复对应的 **全部** 二级回复
	//	 		SubComments: []model.SubComments{}
	// 		}
	// }
	ListReplies(
		ctx context.Context, commentType CommentType, id model.TopicID, limit int, offset int,
	) ([]model.Comment, error)
}

func NewMysqlRepo

func NewMysqlRepo(q *query.Query, log *zap.Logger) (Repo, error)

type Type added in v0.30.3

type Type uint32
const (
	TypeUnknown Type = iota
	TypeSubject
	TypeGroup
)

func (Type) Zap added in v0.30.3

func (t Type) Zap() zap.Field

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL