biz

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Comment

type Comment struct {
	UpdatedAt      int32
	CommentId      int32
	CreationId     int32
	CreationType   int32
	CreationAuthor string
	Uuid           string
	Agree          int32
	Comment        int32
}

type CommentDraft

type CommentDraft struct {
	Id     int32
	Uuid   string
	Status int32
}

type CommentRepo

type CommentRepo interface {
	GetLastCommentDraft(ctx context.Context, uuid string) (*CommentDraft, error)
	GetUserCommentAgree(ctx context.Context, uuid string) (map[int32]bool, error)
	GetCommentUser(ctx context.Context, uuid string) (*CommentUser, error)
	GetCommentList(ctx context.Context, page, creationId, creationType int32) ([]*Comment, error)
	GetSubCommentList(ctx context.Context, page, id int32) ([]*SubComment, error)
	GetCommentListHot(ctx context.Context, page, creationId, creationType int32) ([]*Comment, error)
	GetCommentListStatistic(ctx context.Context, ids []int32) ([]*CommentStatistic, error)
	GetSubCommentListStatistic(ctx context.Context, ids []int32) ([]*CommentStatistic, error)
	GetUserCommentArticleReplyList(ctx context.Context, page int32, uuid string) ([]*Comment, error)
	GetUserSubCommentArticleReplyList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)
	GetUserCommentTalkReplyList(ctx context.Context, page int32, uuid string) ([]*Comment, error)
	GetUserSubCommentTalkReplyList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)
	GetUserCommentArticleRepliedList(ctx context.Context, page int32, uuid string) ([]*Comment, error)
	GetUserSubCommentArticleRepliedList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)
	GetUserCommentTalkRepliedList(ctx context.Context, page int32, uuid string) ([]*Comment, error)
	GetUserSubCommentTalkRepliedList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)
	GetUserCommentRepliedList(ctx context.Context, page int32, uuid string) ([]*Comment, error)
	GetUserSubCommentRepliedList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)
	GetCommentContentReview(ctx context.Context, page int32, uuid string) ([]*TextReview, error)
	GetRootComment(ctx context.Context, id int32) (*Comment, error)
	GetSubComment(ctx context.Context, id int32) (*SubComment, error)
	GetParentCommentUserId(ctx context.Context, id, rootId int32) (string, error)
	GetSubCommentReply(ctx context.Context, id int32, uuid string) (string, error)
	GetArticleAuthor(ctx context.Context, id int32) (string, error)
	GetTalkAuthor(ctx context.Context, id int32) (string, error)

	CreateCommentDraft(ctx context.Context, uuid string) (int32, error)
	CreateCommentFolder(ctx context.Context, id int32, uuid string) error
	CreateComment(ctx context.Context, id, creationId, creationType int32, creationAuthor, uuid string) error
	CreateSubComment(ctx context.Context, id, rootId, parentId, creationId, creationType int32, creationAuthor, rootUser, uuid, reply string) error
	CreateCommentCache(ctx context.Context, id, creationId, creationType int32, creationAuthor, uuid string) error
	CreateSubCommentCache(ctx context.Context, id, rootId, parentId, creationId, creationType int32, creationAuthor, rootUser, uuid, reply string) error

	AddCreationComment(ctx context.Context, creationId, creationType int32, uuid string) error
	AddArticleCommentUser(ctx context.Context, creationAuthor, uuid string) error
	AddArticleSubCommentUser(ctx context.Context, parentId int32, rootUser, parentUser, uuid string) error
	AddTalkCommentUser(ctx context.Context, creationAuthor, uuid string) error
	AddTalkSubCommentUser(ctx context.Context, parentId int32, rootUser, parentUser, uuid string) error

	SendComment(ctx context.Context, id int32, uuid string) (*CommentDraft, error)
	SendCommentAgreeToMq(ctx context.Context, id, creationId, creationType int32, uuid, userUuid, mode string) error
	SendSubCommentAgreeToMq(ctx context.Context, id int32, uuid, userUuid, mode string) error
	SendCommentToMq(ctx context.Context, comment *Comment, mode string) error
	SendCommentContentIrregularToMq(ctx context.Context, review *TextReview) error
	SendSubCommentToMq(ctx context.Context, comment *SubComment, mode string) error
	SendReviewToMq(ctx context.Context, review *CommentReview) error
	SendCommentStatisticToMq(ctx context.Context, uuid, userUuid, mode string) error
	SendScoreToMq(ctx context.Context, score int32, uuid, mode string) error

	SetRecord(ctx context.Context, id int32, uuid, ip string) error
	SetCommentAgree(ctx context.Context, id int32, uuid string) error
	SetSubCommentAgree(ctx context.Context, id int32, uuid string) error
	SetCommentComment(ctx context.Context, id int32) error
	SetUserCommentAgree(ctx context.Context, id int32, userUuid string) error
	SetUserCommentAgreeToCache(ctx context.Context, id int32, userUuid string) error
	SetCommentAgreeToCache(ctx context.Context, id, creationId, creationType int32, uuid, userUuid string) error
	SetSubCommentAgreeToCache(ctx context.Context, id int32, uuid, userUuid string) error
	SetCommentContentIrregular(ctx context.Context, review *TextReview) (*TextReview, error)
	SetCommentContentIrregularToCache(ctx context.Context, review *TextReview) error

	CancelUserCommentAgreeFromCache(ctx context.Context, id int32, userUuid string) error
	CancelCommentAgree(ctx context.Context, id int32, uuid string) error
	CancelSubCommentAgree(ctx context.Context, id int32, uuid string) error
	CancelUserCommentAgree(ctx context.Context, id int32, userUuid string) error
	CancelCommentAgreeFromCache(ctx context.Context, id, creationId, creationType int32, uuid, userUuid string) error
	CancelSubCommentAgreeFromCache(ctx context.Context, id int32, uuid, userUuid string) error

	DeleteCommentDraft(ctx context.Context, id int32, uuid string) error

	ReduceArticleCommentUser(ctx context.Context, creationAuthor, uuid string) error
	ReduceTalkCommentUser(ctx context.Context, creationAuthor, uuid string) error
	ReduceCreationComment(ctx context.Context, createId, createType int32, uuid string) error
	ReduceArticleSubCommentUser(ctx context.Context, parentId int32, rootUser, parentUser, uuid string) error
	ReduceTalkSubCommentUser(ctx context.Context, parentId int32, rootUser, parentUser, uuid string) error

	RemoveComment(ctx context.Context, id int32, uuid string) error
	RemoveSubComment(ctx context.Context, id, rootId int32, uuid string) error
	RemoveCommentAgree(ctx context.Context, id int32, uuid string) error
	RemoveCommentCache(ctx context.Context, id, creationId, creationType int32, creationAuthor, uuid string) error
	RemoveSubCommentCache(ctx context.Context, id, rootId, parentId, creationId, creationType int32, creationAuthor, rootUser, uuid, reply string) error
}

type CommentReview

type CommentReview struct {
	Uuid string
	Id   int32
	Mode string
}

func (CommentReview) MarshalEasyJSON added in v1.2.0

func (v CommentReview) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CommentReview) MarshalJSON added in v1.2.0

func (v CommentReview) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CommentReview) UnmarshalEasyJSON added in v1.2.0

func (v *CommentReview) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CommentReview) UnmarshalJSON added in v1.2.0

func (v *CommentReview) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CommentStatistic

type CommentStatistic struct {
	CommentId int32
	Agree     int32
	Comment   int32
}

type CommentUseCase

type CommentUseCase struct {
	// contains filtered or unexported fields
}

func NewCommentUseCase

func NewCommentUseCase(repo CommentRepo, re Recovery, tm Transaction, logger log.Logger) *CommentUseCase

func (*CommentUseCase) AddCommentContentReviewDbAndCache

func (r *CommentUseCase) AddCommentContentReviewDbAndCache(ctx context.Context, review *TextReview) error

func (*CommentUseCase) CancelCommentAgree

func (r *CommentUseCase) CancelCommentAgree(ctx context.Context, id, creationId, creationType int32, uuid, userUuid string) error

func (*CommentUseCase) CancelCommentAgreeDbAndCache

func (r *CommentUseCase) CancelCommentAgreeDbAndCache(ctx context.Context, id, creationId, creationType int32, uuid, userUuid string) error

func (*CommentUseCase) CancelSubCommentAgree

func (r *CommentUseCase) CancelSubCommentAgree(ctx context.Context, id int32, uuid, userUuid string) error

func (*CommentUseCase) CancelSubCommentAgreeDbAndCache

func (r *CommentUseCase) CancelSubCommentAgreeDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error

func (*CommentUseCase) CommentContentIrregular

func (r *CommentUseCase) CommentContentIrregular(ctx context.Context, review *TextReview) error

func (*CommentUseCase) CreateComment

func (r *CommentUseCase) CreateComment(ctx context.Context, id, creationTd, creationType int32, uuid string) error

func (*CommentUseCase) CreateCommentDbAndCache

func (r *CommentUseCase) CreateCommentDbAndCache(ctx context.Context, id, creationId, creationType int32, uuid string) (string, error)

func (*CommentUseCase) CreateCommentDraft

func (r *CommentUseCase) CreateCommentDraft(ctx context.Context, uuid string) (int32, error)

func (*CommentUseCase) CreateSubComment

func (r *CommentUseCase) CreateSubComment(ctx context.Context, id, rootId, parentId int32, uuid string) error

func (*CommentUseCase) CreateSubCommentDbAndCache

func (r *CommentUseCase) CreateSubCommentDbAndCache(ctx context.Context, id, rootId, parentId int32, uuid string) (string, string, error)

func (*CommentUseCase) GetCommentContentReview

func (r *CommentUseCase) GetCommentContentReview(ctx context.Context, page int32, uuid string) ([]*TextReview, error)

func (*CommentUseCase) GetCommentList

func (r *CommentUseCase) GetCommentList(ctx context.Context, page, creationId, creationType int32) ([]*Comment, error)

func (*CommentUseCase) GetCommentListHot

func (r *CommentUseCase) GetCommentListHot(ctx context.Context, page, creationId, creationType int32) ([]*Comment, error)

func (*CommentUseCase) GetCommentListStatistic

func (r *CommentUseCase) GetCommentListStatistic(ctx context.Context, ids []int32) ([]*CommentStatistic, error)

func (*CommentUseCase) GetCommentUser

func (r *CommentUseCase) GetCommentUser(ctx context.Context, uuid string) (*CommentUser, error)

func (*CommentUseCase) GetLastCommentDraft

func (r *CommentUseCase) GetLastCommentDraft(ctx context.Context, uuid string) (*CommentDraft, error)

func (*CommentUseCase) GetSubCommentList

func (r *CommentUseCase) GetSubCommentList(ctx context.Context, page, id int32) ([]*SubComment, error)

func (*CommentUseCase) GetSubCommentListStatistic

func (r *CommentUseCase) GetSubCommentListStatistic(ctx context.Context, ids []int32) ([]*CommentStatistic, error)

func (*CommentUseCase) GetUserCommentAgree

func (r *CommentUseCase) GetUserCommentAgree(ctx context.Context, uuid string) (map[int32]bool, error)

func (*CommentUseCase) GetUserCommentArticleRepliedList

func (r *CommentUseCase) GetUserCommentArticleRepliedList(ctx context.Context, page int32, uuid string) ([]*Comment, error)

func (*CommentUseCase) GetUserCommentArticleReplyList

func (r *CommentUseCase) GetUserCommentArticleReplyList(ctx context.Context, page int32, uuid string) ([]*Comment, error)

func (*CommentUseCase) GetUserCommentRepliedList

func (r *CommentUseCase) GetUserCommentRepliedList(ctx context.Context, page int32, uuid string) ([]*Comment, error)

func (*CommentUseCase) GetUserCommentTalkRepliedList

func (r *CommentUseCase) GetUserCommentTalkRepliedList(ctx context.Context, page int32, uuid string) ([]*Comment, error)

func (*CommentUseCase) GetUserCommentTalkReplyList

func (r *CommentUseCase) GetUserCommentTalkReplyList(ctx context.Context, page int32, uuid string) ([]*Comment, error)

func (*CommentUseCase) GetUserSubCommentArticleRepliedList

func (r *CommentUseCase) GetUserSubCommentArticleRepliedList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)

func (*CommentUseCase) GetUserSubCommentArticleReplyList

func (r *CommentUseCase) GetUserSubCommentArticleReplyList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)

func (*CommentUseCase) GetUserSubCommentRepliedList

func (r *CommentUseCase) GetUserSubCommentRepliedList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)

func (*CommentUseCase) GetUserSubCommentTalkRepliedList

func (r *CommentUseCase) GetUserSubCommentTalkRepliedList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)

func (*CommentUseCase) GetUserSubCommentTalkReplyList

func (r *CommentUseCase) GetUserSubCommentTalkReplyList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)

func (*CommentUseCase) RemoveComment

func (r *CommentUseCase) RemoveComment(ctx context.Context, id int32, uuid string) error

func (*CommentUseCase) RemoveCommentDbAndCache

func (r *CommentUseCase) RemoveCommentDbAndCache(ctx context.Context, id int32, uuid string) error

func (*CommentUseCase) RemoveSubComment

func (r *CommentUseCase) RemoveSubComment(ctx context.Context, id int32, uuid string) error

func (*CommentUseCase) RemoveSubCommentDbAndCache

func (r *CommentUseCase) RemoveSubCommentDbAndCache(ctx context.Context, id int32, uuid string) error

func (*CommentUseCase) SendComment

func (r *CommentUseCase) SendComment(ctx context.Context, id int32, uuid, ip string) error

func (*CommentUseCase) SendSubComment

func (r *CommentUseCase) SendSubComment(ctx context.Context, id int32, uuid, ip string) error

func (*CommentUseCase) SetCommentAgree

func (r *CommentUseCase) SetCommentAgree(ctx context.Context, id, creationId, creationType int32, uuid, userUuid string) error

func (*CommentUseCase) SetCommentAgreeDbAndCache

func (r *CommentUseCase) SetCommentAgreeDbAndCache(ctx context.Context, id, creationId, creationType int32, uuid, userUuid string) error

func (*CommentUseCase) SetSubCommentAgree

func (r *CommentUseCase) SetSubCommentAgree(ctx context.Context, id int32, uuid, userUuid string) error

func (*CommentUseCase) SetSubCommentAgreeDbAndCache

func (r *CommentUseCase) SetSubCommentAgreeDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error

type CommentUser

type CommentUser struct {
	Uuid              string
	Comment           int32
	ArticleReply      int32
	ArticleReplySub   int32
	TalkReply         int32
	TalkReplySub      int32
	ArticleReplied    int32
	ArticleRepliedSub int32
	TalkReplied       int32
	TalkRepliedSub    int32
}

type Recovery

type Recovery interface {
	GroupRecover(context.Context, func(ctx context.Context) error) func() error
}

type SendCommentAgreeMap added in v1.2.0

type SendCommentAgreeMap struct {
	Uuid         string
	Id           int32
	CreationId   int32
	CreationType int32
	UserUuid     string
	Mode         string
}

func (SendCommentAgreeMap) MarshalEasyJSON added in v1.2.0

func (v SendCommentAgreeMap) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SendCommentAgreeMap) MarshalJSON added in v1.2.0

func (v SendCommentAgreeMap) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SendCommentAgreeMap) UnmarshalEasyJSON added in v1.2.0

func (v *SendCommentAgreeMap) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SendCommentAgreeMap) UnmarshalJSON added in v1.2.0

func (v *SendCommentAgreeMap) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SendCommentMap added in v1.2.0

type SendCommentMap struct {
	Uuid         string
	Id           int32
	CreationId   int32
	CreationType int32
	Mode         string
}

func (SendCommentMap) MarshalEasyJSON added in v1.2.0

func (v SendCommentMap) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SendCommentMap) MarshalJSON added in v1.2.0

func (v SendCommentMap) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SendCommentMap) UnmarshalEasyJSON added in v1.2.0

func (v *SendCommentMap) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SendCommentMap) UnmarshalJSON added in v1.2.0

func (v *SendCommentMap) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SendCommentStatisticMap added in v1.2.0

type SendCommentStatisticMap struct {
	Uuid     string
	UserUuid string
	Mode     string
}

func (SendCommentStatisticMap) MarshalEasyJSON added in v1.2.0

func (v SendCommentStatisticMap) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SendCommentStatisticMap) MarshalJSON added in v1.2.0

func (v SendCommentStatisticMap) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SendCommentStatisticMap) UnmarshalEasyJSON added in v1.2.0

func (v *SendCommentStatisticMap) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SendCommentStatisticMap) UnmarshalJSON added in v1.2.0

func (v *SendCommentStatisticMap) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SendScoreMap added in v1.2.0

type SendScoreMap struct {
	Uuid  string
	Score int32
	Mode  string
}

func (SendScoreMap) MarshalEasyJSON added in v1.2.0

func (v SendScoreMap) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SendScoreMap) MarshalJSON added in v1.2.0

func (v SendScoreMap) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SendScoreMap) UnmarshalEasyJSON added in v1.2.0

func (v *SendScoreMap) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SendScoreMap) UnmarshalJSON added in v1.2.0

func (v *SendScoreMap) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SendSubCommentAgreeMap added in v1.2.0

type SendSubCommentAgreeMap struct {
	Uuid     string
	Id       int32
	UserUuid string
	Mode     string
}

func (SendSubCommentAgreeMap) MarshalEasyJSON added in v1.2.0

func (v SendSubCommentAgreeMap) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SendSubCommentAgreeMap) MarshalJSON added in v1.2.0

func (v SendSubCommentAgreeMap) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SendSubCommentAgreeMap) UnmarshalEasyJSON added in v1.2.0

func (v *SendSubCommentAgreeMap) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SendSubCommentAgreeMap) UnmarshalJSON added in v1.2.0

func (v *SendSubCommentAgreeMap) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SendSubCommentMap added in v1.2.0

type SendSubCommentMap struct {
	Uuid     string
	Id       int32
	RootId   int32
	ParentId int32
	Mode     string
}

func (SendSubCommentMap) MarshalEasyJSON added in v1.2.0

func (v SendSubCommentMap) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SendSubCommentMap) MarshalJSON added in v1.2.0

func (v SendSubCommentMap) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SendSubCommentMap) UnmarshalEasyJSON added in v1.2.0

func (v *SendSubCommentMap) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SendSubCommentMap) UnmarshalJSON added in v1.2.0

func (v *SendSubCommentMap) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SubComment

type SubComment struct {
	CommentId      int32
	UpdatedAt      int32
	CreationId     int32
	RootId         int32
	ParentId       int32
	CreationType   int32
	CreationAuthor string
	RootUser       string
	Uuid           string
	Reply          string
	UserName       string
	ReplyName      string
	RootName       string
	Agree          int32
}

type TextReview

type TextReview struct {
	Id        int32
	CommentId int32
	CreateAt  string
	Comment   string
	Kind      string
	JobId     string
	Label     string
	Result    int32
	Uuid      string
	Mode      string
	Section   string
}

func (TextReview) MarshalEasyJSON added in v1.2.0

func (v TextReview) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TextReview) MarshalJSON added in v1.2.0

func (v TextReview) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TextReview) UnmarshalEasyJSON added in v1.2.0

func (v *TextReview) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TextReview) UnmarshalJSON added in v1.2.0

func (v *TextReview) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Transaction

type Transaction interface {
	ExecTx(context.Context, func(ctx context.Context) error) error
}

Jump to

Keyboard shortcuts

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