biz

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AbuseInfo

type AbuseInfo struct {
	HitFlag int32
	Count   int32
}

type AchievementRepo

type AchievementRepo interface {
	SetAchievementAgree(ctx context.Context, uuid, userUuid string) error
	CancelAchievementAgree(ctx context.Context, uuid, userUuid string) error
	SetAchievementView(ctx context.Context, uuid string) error
	SetAchievementCollect(ctx context.Context, uuid string) error
	CancelAchievementCollect(ctx context.Context, uuid string) error
	SetAchievementFollow(ctx context.Context, follow, followed string) error
	SetUserMedalDbAndCache(ctx context.Context, medal, uuid string) error
	CancelAchievementFollow(ctx context.Context, follow, followed string) error
	CancelUserMedalDbAndCache(ctx context.Context, medal, uuid string) error
	AddAchievementScore(ctx context.Context, uuid string, score int32) error
	GetUserAchievement(ctx context.Context, uuid string) (int32, int32, error)
	GetUserActive(ctx context.Context, uuid string) (int32, error)
	AccessUserMedalDbAndCache(ctx context.Context, medal, uuid string) error
}

type AchievementUseCase

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

func NewAchievementUseCase

func NewAchievementUseCase(repo AchievementRepo, creationRepo CreationRepo, commentRepo CommentRepo, re Recovery, logger log.Logger) *AchievementUseCase

func (*AchievementUseCase) AccessUserMedalDbAndCache

func (r *AchievementUseCase) AccessUserMedalDbAndCache(ctx context.Context, medal, uuid string) error

func (*AchievementUseCase) AddAchievementScore

func (r *AchievementUseCase) AddAchievementScore(ctx context.Context, uuid string, score int32) error

func (*AchievementUseCase) CancelAchievementAgree

func (r *AchievementUseCase) CancelAchievementAgree(ctx context.Context, uuid, userUuid string) error

func (*AchievementUseCase) CancelAchievementCollect

func (r *AchievementUseCase) CancelAchievementCollect(ctx context.Context, uuid string) error

func (*AchievementUseCase) CancelAchievementFollow

func (r *AchievementUseCase) CancelAchievementFollow(ctx context.Context, follow, followed string) error

func (*AchievementUseCase) CancelUserMedalDbAndCache

func (r *AchievementUseCase) CancelUserMedalDbAndCache(ctx context.Context, medal, uuid string) error

func (*AchievementUseCase) SetAchievementAgree

func (r *AchievementUseCase) SetAchievementAgree(ctx context.Context, uuid, userUuid string) error

func (*AchievementUseCase) SetAchievementCollect

func (r *AchievementUseCase) SetAchievementCollect(ctx context.Context, uuid string) error

func (*AchievementUseCase) SetAchievementFollow

func (r *AchievementUseCase) SetAchievementFollow(ctx context.Context, follow, followed string) error

func (*AchievementUseCase) SetAchievementView

func (r *AchievementUseCase) SetAchievementView(ctx context.Context, uuid string) error

func (*AchievementUseCase) SetUserMedalDbAndCache

func (r *AchievementUseCase) SetUserMedalDbAndCache(ctx context.Context, medal, uuid string) error

type AdsInfo

type AdsInfo struct {
	HitFlag int32
	Count   int32
}

type CommentRepo

type CommentRepo interface {
	ToReviewCreateComment(id int32, uuid string) error
	ToReviewCreateSubComment(id int32, uuid string) error
	CommentCreateReviewPass(ctx context.Context, id, creationId, creationType int32, uuid string) error
	CommentContentIrregular(ctx context.Context, review *TextReview, id int32, comment, kind, uuid string) error
	SubCommentCreateReviewPass(ctx context.Context, id, rootId, parentId int32, uuid string) error
	CreateCommentDbAndCache(ctx context.Context, id, createId, createType int32, uuid string) (string, error)
	CreateSubCommentDbAndCache(ctx context.Context, id, rootId, parentId int32, uuid string) (string, string, error)
	RemoveCommentDbAndCache(ctx context.Context, id int32, uuid string) error
	RemoveSubCommentDbAndCache(ctx context.Context, id int32, uuid string) error
	SetCommentAgreeDbAndCache(ctx context.Context, id, creationId, creationType int32, uuid, userUuid string) error
	SetSubCommentAgreeDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error
	SetCommentCount(ctx context.Context, uuid string)
	SetSubCommentCount(ctx context.Context, uuid string)
	CancelCommentAgreeDbAndCache(ctx context.Context, id, creationId, creationType int32, uuid, userUuid string) error
	CancelSubCommentAgreeDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error
	AddCommentContentReviewDbAndCache(ctx context.Context, commentId, result int32, uuid, jobId, label, comment, kind, section string) error
	GetCommentUser(ctx context.Context, uuid string) (int32, error)
}

type CommentUseCase

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

func NewCommentUseCase

func NewCommentUseCase(repo CommentRepo, messageRepo MessageRepo, tm Transaction, jwt Jwt, logger log.Logger) *CommentUseCase

func (*CommentUseCase) AddCommentContentReviewDbAndCache

func (r *CommentUseCase) AddCommentContentReviewDbAndCache(ctx context.Context, commentId, result int32, uuid, jobId, label, comment, kind, section string) error

func (*CommentUseCase) CancelCommentAgreeDbAndCache

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

func (*CommentUseCase) CancelSubCommentAgreeDbAndCache

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

func (*CommentUseCase) CommentCreateReview

func (r *CommentUseCase) CommentCreateReview(ctx context.Context, tr *TextReview) error

func (*CommentUseCase) CreateCommentDbAndCache

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

func (*CommentUseCase) CreateSubCommentDbAndCache

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

func (*CommentUseCase) RemoveCommentDbAndCache

func (r *CommentUseCase) RemoveCommentDbAndCache(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) SetCommentAgreeDbAndCache

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

func (*CommentUseCase) SetSubCommentAgreeDbAndCache

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

func (*CommentUseCase) SubCommentCreateReview

func (r *CommentUseCase) SubCommentCreateReview(ctx context.Context, tr *TextReview) error

func (*CommentUseCase) ToReviewCreateComment

func (r *CommentUseCase) ToReviewCreateComment(id int32, uuid string) error

func (*CommentUseCase) ToReviewCreateSubComment

func (r *CommentUseCase) ToReviewCreateSubComment(id int32, uuid string) error

type CreationRepo

type CreationRepo interface {
	ToReviewCreateArticle(ctx context.Context, id int32, uuid string) error
	ToReviewEditArticle(ctx context.Context, id int32, uuid string) error
	ArticleCreateReviewPass(ctx context.Context, id, auth int32, uuid string) error
	ArticleEditReviewPass(ctx context.Context, id, auth int32, uuid string) error
	ArticleImageIrregular(ctx context.Context, review *ImageReview, id int32, kind, uid, uuid string) error
	ArticleContentIrregular(ctx context.Context, review *TextReview, id int32, title, kind, uuid string) error
	CreateArticleDbCacheAndSearch(ctx context.Context, id, auth int32, uuid string) error
	EditArticleCosAndSearch(ctx context.Context, id, auth int32, uuid string) error
	DeleteArticleCacheAndSearch(ctx context.Context, id int32, uuid string) error
	SetCreationUpdateTime(ctx context.Context, uuid string)
	SetArticleViewDbAndCache(ctx context.Context, id int32, uuid string) error
	SetArticleAgreeDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error
	SetArticleCollectDbAndCache(ctx context.Context, id, collectionsId int32, uuid, userUuid string) error
	CancelArticleAgreeDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error
	CancelArticleCollectDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error
	AddArticleImageReviewDbAndCache(ctx context.Context, creationId, score, result int32, kind, uid, uuid, jobId, label, category, subLabel string) error
	AddArticleContentReviewDbAndCache(ctx context.Context, creationId, result int32, uuid, jobId, label, title, kind string, section string) error

	ToReviewCreateTalk(id int32, uuid string) error
	ToReviewEditTalk(id int32, uuid string) error
	TalkCreateReviewPass(ctx context.Context, id, auth int32, uuid string) error
	TalkImageIrregular(ctx context.Context, review *ImageReview, id int32, kind, uid, uuid string) error
	TalkContentIrregular(ctx context.Context, review *TextReview, id int32, title, kind, uuid string) error
	CreateTalkDbCacheAndSearch(ctx context.Context, id, auth int32, uuid string) error
	TalkEditReviewPass(ctx context.Context, id, auth int32, uuid string) error
	AddTalkImageReviewDbAndCache(ctx context.Context, creationId, score, result int32, kind, uid, uuid, jobId, label, category, subLabel string) error
	AddTalkContentReviewDbAndCache(ctx context.Context, creationId, result int32, uuid, jobId, label, title, kind string, section string) error
	EditTalkCosAndSearch(ctx context.Context, id, auth int32, uuid string) error
	DeleteTalkCacheAndSearch(ctx context.Context, id int32, uuid string) error
	SetTalkViewDbAndCache(ctx context.Context, id int32, uuid string) error
	SetTalkAgreeDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error
	CancelTalkAgreeDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error
	SetTalkCollectDbAndCache(ctx context.Context, id, collectionsId int32, uuid, userUuid string) error
	CancelTalkCollectDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error

	ToReviewCreateColumn(id int32, uuid string) error
	ToReviewEditColumn(id int32, uuid string) error
	ColumnCreateReviewPass(ctx context.Context, id, auth int32, uuid string) error
	ColumnEditReviewPass(ctx context.Context, id, auth int32, uuid string) error
	ColumnImageIrregular(ctx context.Context, review *ImageReview, id int32, kind, uid, uuid string) error
	ColumnContentIrregular(ctx context.Context, review *TextReview, id int32, title, kind, uuid string) error
	CreateColumnDbCacheAndSearch(ctx context.Context, id, auth int32, uuid string) error
	EditColumnCosAndSearch(ctx context.Context, id, auth int32, uuid string) error
	DeleteColumnCacheAndSearch(ctx context.Context, id int32, uuid string) error
	SetColumnAgreeDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error
	SetColumnViewDbAndCache(ctx context.Context, id int32, uuid string) error
	CancelColumnAgreeDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error
	SetColumnCollectDbAndCache(ctx context.Context, id, collectionsId int32, uuid, userUuid string) error
	CancelColumnCollectDbAndCache(ctx context.Context, id int32, uuid, userUuid string) error
	AddColumnIncludesDbAndCache(ctx context.Context, id, articleId int32, uuid string) error
	DeleteColumnIncludesDbAndCache(ctx context.Context, id, articleId int32, uuid string) error
	SetColumnSubscribeDbAndCache(ctx context.Context, id int32, uuid string) error
	CancelColumnSubscribeDbAndCache(ctx context.Context, id int32, uuid string) error
	AddColumnImageReviewDbAndCache(ctx context.Context, creationId, score, result int32, kind, uid, uuid, jobId, label, category, subLabel string) error
	AddColumnContentReviewDbAndCache(ctx context.Context, creationId, result int32, uuid, jobId, label, title, kind string, section string) error

	ToReviewCreateCollections(id int32, uuid string) error
	ToReviewEditCollections(id int32, uuid string) error
	CollectionsCreateReviewPass(ctx context.Context, id, auth int32, uuid string) error
	CollectionsContentIrregular(ctx context.Context, review *TextReview, id int32, title, kind, uuid string) error
	CollectionsEditReviewPass(ctx context.Context, id, auth int32, uuid string) error
	CreateCollectionsDbAndCache(ctx context.Context, id, auth int32, uuid string) error
	EditCollectionsCos(ctx context.Context, id, auth int32, uuid string) error
	DeleteCollectionsCache(ctx context.Context, id int32, uuid string) error
	AddCollectionsContentReviewDbAndCache(ctx context.Context, creationId, result int32, uuid, jobId, label, title, kind string, section string) error

	GetCreationUser(ctx context.Context, uuid string) (int32, int32, int32, error)
}

type CreationUseCase

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

func NewCreationUseCase

func NewCreationUseCase(repo CreationRepo, messageRepo MessageRepo, tm Transaction, jwt Jwt, logger log.Logger) *CreationUseCase

func (*CreationUseCase) AddArticleContentReviewDbAndCache

func (r *CreationUseCase) AddArticleContentReviewDbAndCache(ctx context.Context, creationId, result int32, uuid, jobId, label, title, kind string, section string) error

func (*CreationUseCase) AddArticleImageReviewDbAndCache

func (r *CreationUseCase) AddArticleImageReviewDbAndCache(ctx context.Context, creationId, score, result int32, kind, uid, uuid, jobId, label, category, subLabel string) error

func (*CreationUseCase) AddCollectionsContentReviewDbAndCache

func (r *CreationUseCase) AddCollectionsContentReviewDbAndCache(ctx context.Context, creationId, result int32, uuid, jobId, label, title, kind string, section string) error

func (*CreationUseCase) AddColumnContentReviewDbAndCache

func (r *CreationUseCase) AddColumnContentReviewDbAndCache(ctx context.Context, creationId, result int32, uuid, jobId, label, title, kind string, section string) error

func (*CreationUseCase) AddColumnImageReviewDbAndCache

func (r *CreationUseCase) AddColumnImageReviewDbAndCache(ctx context.Context, creationId, score, result int32, kind, uid, uuid, jobId, label, category, subLabel string) error

func (*CreationUseCase) AddColumnIncludesDbAndCache

func (r *CreationUseCase) AddColumnIncludesDbAndCache(ctx context.Context, id, articleId int32, uuid string) error

func (*CreationUseCase) AddTalkContentReviewDbAndCache

func (r *CreationUseCase) AddTalkContentReviewDbAndCache(ctx context.Context, creationId, result int32, uuid, jobId, label, title, kind string, section string) error

func (*CreationUseCase) AddTalkImageReviewDbAndCache

func (r *CreationUseCase) AddTalkImageReviewDbAndCache(ctx context.Context, creationId, score, result int32, kind, uid, uuid, jobId, label, category, subLabel string) error

func (*CreationUseCase) ArticleCreateReview

func (r *CreationUseCase) ArticleCreateReview(ctx context.Context, tr *TextReview) error

func (*CreationUseCase) ArticleEditReview

func (r *CreationUseCase) ArticleEditReview(ctx context.Context, tr *TextReview) error

func (*CreationUseCase) ArticleImageReview

func (r *CreationUseCase) ArticleImageReview(ctx context.Context, ar *ImageReview) error

func (*CreationUseCase) CancelArticleAgreeDbAndCache

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

func (*CreationUseCase) CancelArticleCollectDbAndCache

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

func (*CreationUseCase) CancelColumnAgreeDbAndCache

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

func (*CreationUseCase) CancelColumnCollectDbAndCache

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

func (*CreationUseCase) CancelColumnSubscribeDbAndCache

func (r *CreationUseCase) CancelColumnSubscribeDbAndCache(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) CancelTalkAgreeDbAndCache

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

func (*CreationUseCase) CancelTalkCollectDbAndCache

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

func (*CreationUseCase) CollectionsCreateReview

func (r *CreationUseCase) CollectionsCreateReview(ctx context.Context, tr *TextReview) error

func (*CreationUseCase) CollectionsEditReview

func (r *CreationUseCase) CollectionsEditReview(ctx context.Context, tr *TextReview) error

func (*CreationUseCase) ColumnCreateReview

func (r *CreationUseCase) ColumnCreateReview(ctx context.Context, tr *TextReview) error

func (*CreationUseCase) ColumnEditReview

func (r *CreationUseCase) ColumnEditReview(ctx context.Context, tr *TextReview) error

func (*CreationUseCase) ColumnImageReview

func (r *CreationUseCase) ColumnImageReview(ctx context.Context, ar *ImageReview) error

func (*CreationUseCase) CreateArticleDbCacheAndSearch

func (r *CreationUseCase) CreateArticleDbCacheAndSearch(ctx context.Context, id, auth int32, uuid string) error

func (*CreationUseCase) CreateCollectionsDbAndCache

func (r *CreationUseCase) CreateCollectionsDbAndCache(ctx context.Context, id, auth int32, uuid string) error

func (*CreationUseCase) CreateColumnDbCacheAndSearch

func (r *CreationUseCase) CreateColumnDbCacheAndSearch(ctx context.Context, id, auth int32, uuid string) error

func (*CreationUseCase) CreateTalkDbCacheAndSearch

func (r *CreationUseCase) CreateTalkDbCacheAndSearch(ctx context.Context, id, auth int32, uuid string) error

func (*CreationUseCase) DeleteArticleCacheAndSearch

func (r *CreationUseCase) DeleteArticleCacheAndSearch(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) DeleteCollectionsCache

func (r *CreationUseCase) DeleteCollectionsCache(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) DeleteColumnCacheAndSearch

func (r *CreationUseCase) DeleteColumnCacheAndSearch(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) DeleteColumnIncludesDbAndCache

func (r *CreationUseCase) DeleteColumnIncludesDbAndCache(ctx context.Context, id, articleId int32, uuid string) error

func (*CreationUseCase) DeleteTalkCacheAndSearch

func (r *CreationUseCase) DeleteTalkCacheAndSearch(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) EditArticleCosAndSearch

func (r *CreationUseCase) EditArticleCosAndSearch(ctx context.Context, id, auth int32, uuid string) error

func (*CreationUseCase) EditCollectionsCos

func (r *CreationUseCase) EditCollectionsCos(ctx context.Context, id, auth int32, uuid string) error

func (*CreationUseCase) EditColumnCosAndSearch

func (r *CreationUseCase) EditColumnCosAndSearch(ctx context.Context, id, auth int32, uuid string) error

func (*CreationUseCase) EditTalkCosAndSearch

func (r *CreationUseCase) EditTalkCosAndSearch(ctx context.Context, id, auth int32, uuid string) error

func (*CreationUseCase) SetArticleAgreeDbAndCache

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

func (*CreationUseCase) SetArticleCollectDbAndCache

func (r *CreationUseCase) SetArticleCollectDbAndCache(ctx context.Context, id, collectionsId int32, uuid, userUuid string) error

func (*CreationUseCase) SetArticleViewDbAndCache

func (r *CreationUseCase) SetArticleViewDbAndCache(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) SetColumnAgreeDbAndCache

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

func (*CreationUseCase) SetColumnCollectDbAndCache

func (r *CreationUseCase) SetColumnCollectDbAndCache(ctx context.Context, id, collectionsId int32, uuid, userUuid string) error

func (*CreationUseCase) SetColumnSubscribeDbAndCache

func (r *CreationUseCase) SetColumnSubscribeDbAndCache(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) SetColumnViewDbAndCache

func (r *CreationUseCase) SetColumnViewDbAndCache(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) SetTalkAgreeDbAndCache

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

func (*CreationUseCase) SetTalkCollectDbAndCache

func (r *CreationUseCase) SetTalkCollectDbAndCache(ctx context.Context, id, collectionsId int32, uuid, userUuid string) error

func (*CreationUseCase) SetTalkViewDbAndCache

func (r *CreationUseCase) SetTalkViewDbAndCache(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) TalkCreateReview

func (r *CreationUseCase) TalkCreateReview(ctx context.Context, tr *TextReview) error

func (*CreationUseCase) TalkEditReview

func (r *CreationUseCase) TalkEditReview(ctx context.Context, tr *TextReview) error

func (*CreationUseCase) TalkImageReview

func (r *CreationUseCase) TalkImageReview(ctx context.Context, ar *ImageReview) error

func (*CreationUseCase) ToReviewCreateArticle

func (r *CreationUseCase) ToReviewCreateArticle(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) ToReviewCreateCollections

func (r *CreationUseCase) ToReviewCreateCollections(id int32, uuid string) error

func (*CreationUseCase) ToReviewCreateColumn

func (r *CreationUseCase) ToReviewCreateColumn(id int32, uuid string) error

func (*CreationUseCase) ToReviewCreateTalk

func (r *CreationUseCase) ToReviewCreateTalk(id int32, uuid string) error

func (*CreationUseCase) ToReviewEditArticle

func (r *CreationUseCase) ToReviewEditArticle(ctx context.Context, id int32, uuid string) error

func (*CreationUseCase) ToReviewEditCollections

func (r *CreationUseCase) ToReviewEditCollections(id int32, uuid string) error

func (*CreationUseCase) ToReviewEditColumn

func (r *CreationUseCase) ToReviewEditColumn(id int32, uuid string) error

func (*CreationUseCase) ToReviewEditTalk

func (r *CreationUseCase) ToReviewEditTalk(id int32, uuid string) error

type IllegalInfo

type IllegalInfo struct {
	HitFlag int32
	Count   int32
}

type ImageReview

type ImageReview struct {
	Code       string
	Message    string
	JobId      string
	State      string
	Object     string
	Url        string
	Label      string
	Result     int32
	Score      int32
	Category   string
	SubLabel   string
	BucketId   string
	Region     string
	CosHeaders map[string]string
	EventName  string
}

type Jwt

type Jwt interface {
	JwtCheck(token string) (string, error)
}

type MailBox

type MailBox struct {
	Time int32
}

type MessageRepo

type MessageRepo interface {
	GetMailBoxLastTime(ctx context.Context, uuid string) (*MailBox, error)
	GetMessageNotification(ctx context.Context, uuid string, follows []string) (*Notification, error)
	GetMessageSystemNotification(ctx context.Context, page int32, uuid string) ([]*SystemNotification, error)
	SetMailBoxLastTime(ctx context.Context, uuid string, time int32) error
	RemoveMailBoxCommentCount(ctx context.Context, uuid string) error
	RemoveMailBoxSubCommentCount(ctx context.Context, uuid string) error
	RemoveMailBoxSystemNotificationCount(ctx context.Context, uuid string) error
	AddMailBoxSystemNotification(ctx context.Context, contentId int32, notificationType string, title string, uuid string, label string, result int32, section string, text string, uid string, comment string) (*SystemNotification, error)
	AddMailBoxSystemNotificationToCache(ctx context.Context, notification *SystemNotification) error
}

type MessageUseCase

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

func NewMessageUseCase

func NewMessageUseCase(repo MessageRepo, re Recovery, logger log.Logger) *MessageUseCase

func (*MessageUseCase) GetMailBoxLastTime

func (r *MessageUseCase) GetMailBoxLastTime(ctx context.Context, uuid string) (*MailBox, error)

func (*MessageUseCase) GetMessageNotification

func (r *MessageUseCase) GetMessageNotification(ctx context.Context, uuid string, follows []string) (*Notification, error)

func (*MessageUseCase) GetMessageSystemNotification

func (r *MessageUseCase) GetMessageSystemNotification(ctx context.Context, page int32, uuid string) ([]*SystemNotification, error)

func (*MessageUseCase) RemoveMailBoxCommentCount

func (r *MessageUseCase) RemoveMailBoxCommentCount(ctx context.Context, uuid string) error

func (*MessageUseCase) RemoveMailBoxSubCommentCount

func (r *MessageUseCase) RemoveMailBoxSubCommentCount(ctx context.Context, uuid string) error

func (*MessageUseCase) RemoveMailBoxSystemNotificationCount

func (r *MessageUseCase) RemoveMailBoxSystemNotificationCount(ctx context.Context, uuid string) error

func (*MessageUseCase) SetMailBoxLastTime

func (r *MessageUseCase) SetMailBoxLastTime(ctx context.Context, uuid string, time int32) error

type Notification

type Notification struct {
	Timeline           map[string]int32
	Comment            int32
	SubComment         int32
	SystemNotification int32
}

type PornInfo

type PornInfo struct {
	HitFlag int32
	Count   int32
}

type Recovery

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

type Section

type Section struct {
	Label       string
	Result      int32
	PornInfo    *SectionPornInfo
	AdsInfo     *SectionAdsInfo
	IllegalInfo *SectionIllegalInfo
	AbuseInfo   *SectionAbuseInfo
}

type SectionAbuseInfo

type SectionAbuseInfo struct {
	HitFlag  int32
	Score    int32
	Keywords string
}

type SectionAdsInfo

type SectionAdsInfo struct {
	HitFlag  int32
	Score    int32
	Keywords string
}

type SectionIllegalInfo

type SectionIllegalInfo struct {
	HitFlag  int32
	Score    int32
	Keywords string
}

type SectionPornInfo

type SectionPornInfo struct {
	HitFlag  int32
	Score    int32
	Keywords string
}

type SystemNotification

type SystemNotification struct {
	Id               int32
	ContentId        int32
	CreatedAt        string
	NotificationType string
	Title            string
	Uid              string
	Uuid             string
	Label            string
	Result           int32
	Section          string
	Text             string
	Comment          string
}

func (SystemNotification) MarshalEasyJSON added in v1.2.0

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (SystemNotification) MarshalJSON added in v1.2.0

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

MarshalJSON supports json.Marshaler interface

func (*SystemNotification) UnmarshalEasyJSON added in v1.2.0

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SystemNotification) UnmarshalJSON added in v1.2.0

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

UnmarshalJSON supports json.Unmarshaler interface

type TextReview

type TextReview struct {
	Code         string
	Message      string
	JobId        string
	DataId       string
	State        string
	CreationTime string
	Object       string
	Label        string
	Result       int32
	PornInfo     *PornInfo
	AdsInfo      *AdsInfo
	IllegalInfo  *IllegalInfo
	AbuseInfo    *AbuseInfo
	BucketId     string
	Region       string
	CosHeaders   map[string]string
	Section      string
}

type Transaction

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

type UserRepo

type UserRepo interface {
	AvatarIrregular(ctx context.Context, review *ImageReview, uuid string) error
	CoverIrregular(ctx context.Context, review *ImageReview, uuid string) error
	UploadProfileToCos(msg map[string]interface{}) error
	ProfileReviewPass(ctx context.Context, uuid, update string) error
	ProfileReviewNotPass(ctx context.Context, uuid string) error
	SetFollowDbAndCache(ctx context.Context, uuid, userId string) error
	CancelFollowDbAndCache(ctx context.Context, uuid, userId string) error
	AddAvatarReviewDbAndCache(ctx context.Context, score, result int32, uuid, jobId, label, category, subLabel string) error
	AddCoverReviewDbAndCache(ctx context.Context, score, result int32, uuid, jobId, label, category, subLabel string) error
}

type UserUseCase

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

func NewUserUseCase

func NewUserUseCase(repo UserRepo, messageRepo MessageRepo, tm Transaction, jwt Jwt, logger log.Logger) *UserUseCase

func (*UserUseCase) AddAvatarReviewDbAndCache

func (r *UserUseCase) AddAvatarReviewDbAndCache(ctx context.Context, score, result int32, uuid, jobId, label, category, subLabel string) error

func (*UserUseCase) AddCoverReviewDbAndCache

func (r *UserUseCase) AddCoverReviewDbAndCache(ctx context.Context, score, result int32, uuid, jobId, label, category, subLabel string) error

func (*UserUseCase) AvatarReview

func (r *UserUseCase) AvatarReview(ctx context.Context, ar *ImageReview) error

func (*UserUseCase) CancelFollowDbAndCache

func (r *UserUseCase) CancelFollowDbAndCache(ctx context.Context, uuid, userId string) error

func (*UserUseCase) CoverReview

func (r *UserUseCase) CoverReview(ctx context.Context, cr *ImageReview) error

func (*UserUseCase) ProfileReview

func (r *UserUseCase) ProfileReview(ctx context.Context, tr *TextReview) error

func (*UserUseCase) SetFollowDbAndCache

func (r *UserUseCase) SetFollowDbAndCache(ctx context.Context, uuid, userId string) error

func (*UserUseCase) UploadProfileToCos

func (r *UserUseCase) UploadProfileToCos(msg map[string]interface{}) error

Jump to

Keyboard shortcuts

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