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: 4 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 Achievement

type Achievement struct {
	Uuid     string
	Score    int32
	Agree    int32
	Collect  int32
	View     int32
	Follow   int32
	Followed int32
}

type AchievementRepo

type AchievementRepo interface {
	GetAchievementList(ctx context.Context, uuids []string) ([]*Achievement, error)
	GetUserAchievement(ctx context.Context, uuid string) (*Achievement, error)
	GetUserActive(ctx context.Context, uuid string) (*Active, error)
	GetUserMedal(ctx context.Context, uuid string) (*Medal, error)
	SetUserMedal(ctx context.Context, medal, uuid string) error
	CancelUserMedalSet(ctx context.Context, medal, uuid string) error
	AccessUserMedal(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) AccessUserMedal

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

func (*AchievementUseCase) CancelUserMedalSet

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

func (*AchievementUseCase) GetAchievementList

func (r *AchievementUseCase) GetAchievementList(ctx context.Context, uuids []string) ([]*Achievement, error)

func (*AchievementUseCase) GetUserAchievement

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

func (*AchievementUseCase) GetUserMedal

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

func (*AchievementUseCase) GetUserMedalProgress

func (r *AchievementUseCase) GetUserMedalProgress(ctx context.Context) (*MedalProgress, error)

func (*AchievementUseCase) SetUserMedal

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

type Active

type Active struct {
	Agree int32
}

type AdsInfo

type AdsInfo struct {
	HitFlag int32
	Count   int32
}

type Article

type Article struct {
	Id      int32
	Agree   int32
	View    int32
	Collect int32
	Comment int32
	Total   int32
	Title   string
	Tags    string
	Uuid    string
	Text    string
	Cover   string
	Update  string
}

type ArticleDraft

type ArticleDraft struct {
	Id     int32
	Status int32
}

type ArticleRepo

type ArticleRepo interface {
	CreateArticleDraft(ctx context.Context, uuid string) (int32, error)
	GetLastArticleDraft(ctx context.Context, uuid string) (*ArticleDraft, error)
	GetArticleList(ctx context.Context, page int32) ([]*Article, error)
	GetArticleListHot(ctx context.Context, page int32) ([]*Article, error)
	GetUserArticleListAll(ctx context.Context, uuid string) ([]*Article, error)
	GetColumnArticleList(ctx context.Context, id int32) ([]*Article, error)
	GetArticleCount(ctx context.Context, uuid string) (int32, error)
	GetArticleCountVisitor(ctx context.Context, uuid string) (int32, error)
	GetUserArticleList(ctx context.Context, page int32, uuid string) ([]*Article, error)
	GetUserArticleListVisitor(ctx context.Context, page int32, uuid string) ([]*Article, error)
	GetArticleStatistic(ctx context.Context, id int32, uuid string) (*ArticleStatistic, error)
	GetUserArticleAgree(ctx context.Context, uuid string) (map[int32]bool, error)
	GetUserArticleCollect(ctx context.Context, uuid string) (map[int32]bool, error)
	GetArticleListStatistic(ctx context.Context, articleList []*Article) ([]*ArticleStatistic, error)
	GetArticleDraftList(ctx context.Context, uuid string) ([]*ArticleDraft, error)
	GetArticleSearch(ctx context.Context, page int32, search, time string) ([]*Article, int32, error)
	GetArticleImageReview(ctx context.Context, page int32, uuid string) ([]*CreationImageReview, error)
	GetArticleContentReview(ctx context.Context, page int32, uuid string) ([]*CreationContentReview, error)
	ArticleDraftMark(ctx context.Context, id int32, uuid string) error
	SendArticle(ctx context.Context, id int32, uuid, ip string) error
	SendArticleEdit(ctx context.Context, id int32, uuid, ip string) error
	DeleteArticle(ctx context.Context, id int32, uuid string) error
	DeleteArticleDraft(ctx context.Context, id int32, uuid string) error
	SetArticleAgree(ctx context.Context, id int32, uuid, userUuid string) error
	SetArticleView(ctx context.Context, id int32, uuid string) error
	SetArticleCollect(ctx context.Context, id, collectionsId int32, uuid, userUuid string) error
	CancelArticleAgree(ctx context.Context, id int32, uuid, userUuid string) error
	CancelArticleCollect(ctx context.Context, id int32, uuid, userUuid string) error
	ArticleStatisticJudge(ctx context.Context, id int32, uuid string) (*ArticleStatisticJudge, error)
}

type ArticleStatistic

type ArticleStatistic struct {
	Id      int32
	Uuid    string
	Agree   int32
	View    int32
	Collect int32
	Comment int32
}

type ArticleStatisticJudge

type ArticleStatisticJudge struct {
	Agree   bool
	Collect bool
}

type ArticleUseCase

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

func NewArticleUseCase

func NewArticleUseCase(repo ArticleRepo, re Recovery, logger log.Logger) *ArticleUseCase

func (*ArticleUseCase) ArticleDraftMark

func (r *ArticleUseCase) ArticleDraftMark(ctx context.Context, id int32) error

func (*ArticleUseCase) ArticleStatisticJudge

func (r *ArticleUseCase) ArticleStatisticJudge(ctx context.Context, id int32) (*ArticleStatisticJudge, error)

func (*ArticleUseCase) CancelArticleAgree

func (r *ArticleUseCase) CancelArticleAgree(ctx context.Context, id int32, uuid string) error

func (*ArticleUseCase) CancelArticleCollect

func (r *ArticleUseCase) CancelArticleCollect(ctx context.Context, id int32, uuid string) error

func (*ArticleUseCase) CreateArticleDraft

func (r *ArticleUseCase) CreateArticleDraft(ctx context.Context) (int32, error)

func (*ArticleUseCase) DeleteArticle

func (r *ArticleUseCase) DeleteArticle(ctx context.Context, id int32) error

func (*ArticleUseCase) DeleteArticleDraft added in v1.3.0

func (r *ArticleUseCase) DeleteArticleDraft(ctx context.Context, id int32) error

func (*ArticleUseCase) GetArticleContentReview

func (r *ArticleUseCase) GetArticleContentReview(ctx context.Context, page int32) ([]*CreationContentReview, error)

func (*ArticleUseCase) GetArticleCount

func (r *ArticleUseCase) GetArticleCount(ctx context.Context) (int32, error)

func (*ArticleUseCase) GetArticleCountVisitor

func (r *ArticleUseCase) GetArticleCountVisitor(ctx context.Context, uuid string) (int32, error)

func (*ArticleUseCase) GetArticleDraftList

func (r *ArticleUseCase) GetArticleDraftList(ctx context.Context) ([]*ArticleDraft, error)

func (*ArticleUseCase) GetArticleImageReview

func (r *ArticleUseCase) GetArticleImageReview(ctx context.Context, page int32) ([]*CreationImageReview, error)

func (*ArticleUseCase) GetArticleList

func (r *ArticleUseCase) GetArticleList(ctx context.Context, page int32) ([]*Article, error)

func (*ArticleUseCase) GetArticleListHot

func (r *ArticleUseCase) GetArticleListHot(ctx context.Context, page int32) ([]*Article, error)

func (*ArticleUseCase) GetArticleListStatistic

func (r *ArticleUseCase) GetArticleListStatistic(ctx context.Context, ids []int32) ([]*ArticleStatistic, error)

GetArticleListStatistic todo: delete

func (*ArticleUseCase) GetArticleSearch

func (r *ArticleUseCase) GetArticleSearch(ctx context.Context, page int32, search, time string) ([]*Article, int32, error)

func (*ArticleUseCase) GetArticleStatistic

func (r *ArticleUseCase) GetArticleStatistic(ctx context.Context, id int32, uuid string) (*ArticleStatistic, error)

func (*ArticleUseCase) GetColumnArticleList

func (r *ArticleUseCase) GetColumnArticleList(ctx context.Context, id int32) ([]*Article, error)

func (*ArticleUseCase) GetLastArticleDraft

func (r *ArticleUseCase) GetLastArticleDraft(ctx context.Context) (*ArticleDraft, error)

func (*ArticleUseCase) GetUserArticleAgree

func (r *ArticleUseCase) GetUserArticleAgree(ctx context.Context) (map[int32]bool, error)

func (*ArticleUseCase) GetUserArticleCollect

func (r *ArticleUseCase) GetUserArticleCollect(ctx context.Context) (map[int32]bool, error)

func (*ArticleUseCase) GetUserArticleList

func (r *ArticleUseCase) GetUserArticleList(ctx context.Context, page int32) ([]*Article, error)

func (*ArticleUseCase) GetUserArticleListAll

func (r *ArticleUseCase) GetUserArticleListAll(ctx context.Context) ([]*Article, error)

func (*ArticleUseCase) GetUserArticleListSimple

func (r *ArticleUseCase) GetUserArticleListSimple(ctx context.Context, page int32) ([]*Article, error)

func (*ArticleUseCase) GetUserArticleListVisitor

func (r *ArticleUseCase) GetUserArticleListVisitor(ctx context.Context, page int32, uuid string) ([]*Article, error)

func (*ArticleUseCase) SendArticle

func (r *ArticleUseCase) SendArticle(ctx context.Context, id int32) error

func (*ArticleUseCase) SendArticleEdit

func (r *ArticleUseCase) SendArticleEdit(ctx context.Context, id int32) error

func (*ArticleUseCase) SetArticleAgree

func (r *ArticleUseCase) SetArticleAgree(ctx context.Context, id int32, uuid string) error

func (*ArticleUseCase) SetArticleCollect

func (r *ArticleUseCase) SetArticleCollect(ctx context.Context, id, collectionsId int32, uuid string) error

func (*ArticleUseCase) SetArticleView

func (r *ArticleUseCase) SetArticleView(ctx context.Context, id int32, uuid string) error

type Collections

type Collections struct {
	Id      int32
	Uuid    string
	Auth    int32
	Article int32
	Column  int32
	Talk    int32
}

type CollectionsDraft

type CollectionsDraft struct {
	Id     int32
	Status int32
}

type Column

type Column struct {
	Id        int32
	Agree     int32
	View      int32
	Collect   int32
	Total     int32
	Name      string
	Tags      string
	Uuid      string
	Introduce string
	Cover     string
	Update    string
}

type ColumnDraft

type ColumnDraft struct {
	Id     int32
	Status int32
}

type ColumnRepo

type ColumnRepo interface {
	GetLastColumnDraft(ctx context.Context, uuid string) (*ColumnDraft, error)
	GetColumnList(ctx context.Context, page int32) ([]*Column, error)
	GetColumnListHot(ctx context.Context, page int32) ([]*Column, error)
	GetUserColumnList(ctx context.Context, page int32, uuid string) ([]*Column, error)
	GetUserColumnListVisitor(ctx context.Context, page int32, uuid string) ([]*Column, error)
	GetColumnCount(ctx context.Context, uuid string) (int32, error)
	GetColumnCountVisitor(ctx context.Context, uuid string) (int32, error)
	GetColumnListStatistic(ctx context.Context, columnList []*Column) ([]*ColumnStatistic, error)
	GetColumnStatistic(ctx context.Context, id int32, uuid string) (*ColumnStatistic, error)
	GetSubscribeList(ctx context.Context, page int32, uuid string) ([]*Column, error)
	GetSubscribeListCount(ctx context.Context, uuid string) (int32, error)
	GetColumnSubscribes(ctx context.Context, uuid string, ids []int32) ([]*Subscribe, error)
	GetColumnSearch(ctx context.Context, page int32, search, time string) ([]*Column, int32, error)
	GetUserColumnAgree(ctx context.Context, uuid string) (map[int32]bool, error)
	GetUserColumnCollect(ctx context.Context, uuid string) (map[int32]bool, error)
	GetUserSubscribeColumn(ctx context.Context, uuid string) (map[int32]bool, error)
	GetColumnImageReview(ctx context.Context, page int32, uuid string) ([]*CreationImageReview, error)
	GetColumnContentReview(ctx context.Context, page int32, uuid string) ([]*CreationContentReview, error)
	SendColumn(ctx context.Context, id int32, uuid, ip string) error
	SendColumnEdit(ctx context.Context, id int32, uuid, ip string) error
	CreateColumnDraft(ctx context.Context, uuid string) (int32, error)
	SubscribeColumn(ctx context.Context, id int32, uuid string) error
	SubscribeJudge(ctx context.Context, id int32, uuid string) (bool, error)
	DeleteColumn(ctx context.Context, id int32, uuid string) error
	ColumnStatisticJudge(ctx context.Context, id int32, uuid string) (*ColumnStatisticJudge, error)
	SetColumnView(ctx context.Context, id int32, uuid string) error
	SetColumnAgree(ctx context.Context, id int32, uuid, userUuid string) error
	SetColumnCollect(ctx context.Context, id, collectionsId int32, uuid, userUuid string) error
	CancelColumnAgree(ctx context.Context, id int32, uuid, userUuid string) error
	CancelColumnCollect(ctx context.Context, id int32, uuid, userUuid string) error
	CancelSubscribeColumn(ctx context.Context, id int32, uuid string) error
	AddColumnIncludes(ctx context.Context, id, articleId int32, uuid string) error
	DeleteColumnIncludes(ctx context.Context, id, articleId int32, uuid string) error
}

type ColumnStatistic

type ColumnStatistic struct {
	Id      int32
	Uuid    string
	Agree   int32
	View    int32
	Collect int32
}

type ColumnStatisticJudge

type ColumnStatisticJudge struct {
	Agree   bool
	Collect bool
}

type ColumnUseCase

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

func NewColumnUseCase

func NewColumnUseCase(repo ColumnRepo, re Recovery, logger log.Logger) *ColumnUseCase

func (*ColumnUseCase) AddColumnIncludes

func (r *ColumnUseCase) AddColumnIncludes(ctx context.Context, id, articleId int32) error

func (*ColumnUseCase) CancelColumnAgree

func (r *ColumnUseCase) CancelColumnAgree(ctx context.Context, id int32, uuid string) error

func (*ColumnUseCase) CancelColumnCollect

func (r *ColumnUseCase) CancelColumnCollect(ctx context.Context, id int32, uuid string) error

func (*ColumnUseCase) CancelSubscribeColumn

func (r *ColumnUseCase) CancelSubscribeColumn(ctx context.Context, id int32) error

func (*ColumnUseCase) ColumnStatisticJudge

func (r *ColumnUseCase) ColumnStatisticJudge(ctx context.Context, id int32) (*ColumnStatisticJudge, error)

func (*ColumnUseCase) CreateColumnDraft

func (r *ColumnUseCase) CreateColumnDraft(ctx context.Context) (int32, error)

func (*ColumnUseCase) DeleteColumn

func (r *ColumnUseCase) DeleteColumn(ctx context.Context, id int32) error

func (*ColumnUseCase) DeleteColumnIncludes

func (r *ColumnUseCase) DeleteColumnIncludes(ctx context.Context, id, articleId int32) error

func (*ColumnUseCase) GetColumnContentReview

func (r *ColumnUseCase) GetColumnContentReview(ctx context.Context, page int32) ([]*CreationContentReview, error)

func (*ColumnUseCase) GetColumnCount

func (r *ColumnUseCase) GetColumnCount(ctx context.Context) (int32, error)

func (*ColumnUseCase) GetColumnCountVisitor

func (r *ColumnUseCase) GetColumnCountVisitor(ctx context.Context, uuid string) (int32, error)

func (*ColumnUseCase) GetColumnImageReview

func (r *ColumnUseCase) GetColumnImageReview(ctx context.Context, page int32) ([]*CreationImageReview, error)

func (*ColumnUseCase) GetColumnList

func (r *ColumnUseCase) GetColumnList(ctx context.Context, page int32) ([]*Column, error)

func (*ColumnUseCase) GetColumnListHot

func (r *ColumnUseCase) GetColumnListHot(ctx context.Context, page int32) ([]*Column, error)

func (*ColumnUseCase) GetColumnListStatistic

func (r *ColumnUseCase) GetColumnListStatistic(ctx context.Context, ids []int32) ([]*ColumnStatistic, error)

GetColumnListStatistic todo: delete

func (*ColumnUseCase) GetColumnSearch

func (r *ColumnUseCase) GetColumnSearch(ctx context.Context, page int32, search, time string) ([]*Column, int32, error)

func (*ColumnUseCase) GetColumnStatistic

func (r *ColumnUseCase) GetColumnStatistic(ctx context.Context, id int32, uuid string) (*ColumnStatistic, error)

func (*ColumnUseCase) GetColumnSubscribes

func (r *ColumnUseCase) GetColumnSubscribes(ctx context.Context, ids []int32) ([]*Subscribe, error)

func (*ColumnUseCase) GetLastColumnDraft

func (r *ColumnUseCase) GetLastColumnDraft(ctx context.Context) (*ColumnDraft, error)

func (*ColumnUseCase) GetSubscribeList

func (r *ColumnUseCase) GetSubscribeList(ctx context.Context, page int32) ([]*Column, error)

func (*ColumnUseCase) GetSubscribeListCount

func (r *ColumnUseCase) GetSubscribeListCount(ctx context.Context, uuid string) (int32, error)

func (*ColumnUseCase) GetUserColumnAgree

func (r *ColumnUseCase) GetUserColumnAgree(ctx context.Context) (map[int32]bool, error)

func (*ColumnUseCase) GetUserColumnCollect

func (r *ColumnUseCase) GetUserColumnCollect(ctx context.Context) (map[int32]bool, error)

func (*ColumnUseCase) GetUserColumnList

func (r *ColumnUseCase) GetUserColumnList(ctx context.Context, page int32) ([]*Column, error)

func (*ColumnUseCase) GetUserColumnListSimple

func (r *ColumnUseCase) GetUserColumnListSimple(ctx context.Context, page int32) ([]*Column, error)

func (*ColumnUseCase) GetUserColumnListVisitor

func (r *ColumnUseCase) GetUserColumnListVisitor(ctx context.Context, page int32, uuid string) ([]*Column, error)

func (*ColumnUseCase) GetUserSubscribeColumn

func (r *ColumnUseCase) GetUserSubscribeColumn(ctx context.Context) (map[int32]bool, error)

func (*ColumnUseCase) SendColumn

func (r *ColumnUseCase) SendColumn(ctx context.Context, id int32) error

func (*ColumnUseCase) SendColumnEdit

func (r *ColumnUseCase) SendColumnEdit(ctx context.Context, id int32) error

func (*ColumnUseCase) SetColumnAgree

func (r *ColumnUseCase) SetColumnAgree(ctx context.Context, id int32, uuid string) error

func (*ColumnUseCase) SetColumnCollect

func (r *ColumnUseCase) SetColumnCollect(ctx context.Context, id, collectionsId int32, uuid string) error

func (*ColumnUseCase) SetColumnView

func (r *ColumnUseCase) SetColumnView(ctx context.Context, id int32, uuid string) error

func (*ColumnUseCase) SubscribeColumn

func (r *ColumnUseCase) SubscribeColumn(ctx context.Context, id int32) error

func (*ColumnUseCase) SubscribeJudge

func (r *ColumnUseCase) SubscribeJudge(ctx context.Context, id int32) (bool, error)

type Comment

type Comment struct {
	Id             int32
	Uuid           string
	UserName       string
	CreationAuthor string
	CreationId     int32
	CreationType   int32
	Agree          int32
	Comment        int32
}

type CommentContentReview

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

type CommentDraft

type CommentDraft struct {
	Id     int32
	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, page, creationId, creationType int32, key string, commentList []*Comment) ([]*CommentStatistic, error)
	GetSubCommentListStatistic(ctx context.Context, page, id int32, commentList []*SubComment) ([]*CommentStatistic, error)
	GetUserProfileList(ctx context.Context, page, creationId, creationType int32, key string, commentList []*Comment) (map[string]string, error)
	GetSubUserProfileList(ctx context.Context, page, id int32, commentList []*SubComment) (map[string]string, error)
	GetUserCommentArticleReplyList(ctx context.Context, page int32, uuid string) ([]*Comment, error)
	GetUserSubCommentArticleReplyList(ctx context.Context, page int32, uuid string) ([]*SubComment, error)
	GetUserSubCommentProfileList(ctx context.Context, page int32, key, uuid string, commentList []*SubComment) (map[string]string, error)
	GetUserCommentProfileList(ctx context.Context, page int32, key, uuid string, commentList []*Comment) (map[string]string, 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) ([]*CommentContentReview, error)
	CreateCommentDraft(ctx context.Context, uuid string) (int32, error)
	SendComment(ctx context.Context, id int32, uuid, ip string) error
	SendSubComment(ctx context.Context, id int32, uuid, ip string) error
	RemoveComment(ctx context.Context, id int32, uuid string) error
	RemoveSubComment(ctx context.Context, id int32, uuid string) error
	SetCommentAgree(ctx context.Context, id, creationId, creationType int32, uuid, userUuid string) error
	SetSubCommentAgree(ctx context.Context, id int32, uuid, userUuid string) error
	CancelCommentAgree(ctx context.Context, id, creationId, creationType int32, uuid, userUuid string) error
	CancelSubCommentAgree(ctx context.Context, id int32, uuid, userUuid string) error
}

type CommentStatistic

type CommentStatistic struct {
	Id      int32
	Agree   int32
	Comment int32
}

type CommentUseCase

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

func NewCommentUseCase

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

func (*CommentUseCase) CancelCommentAgree

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

func (*CommentUseCase) CancelSubCommentAgree

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

func (*CommentUseCase) CreateCommentDraft

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

func (*CommentUseCase) GetCommentContentReview

func (r *CommentUseCase) GetCommentContentReview(ctx context.Context, page int32) ([]*CommentContentReview, 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) GetCommentUser

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

func (*CommentUseCase) GetLastCommentDraft

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

func (*CommentUseCase) GetSubCommentList

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

func (*CommentUseCase) GetUserCommentAgree

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

func (*CommentUseCase) GetUserCommentArticleRepliedList

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

func (*CommentUseCase) GetUserCommentArticleReplyList

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

func (*CommentUseCase) GetUserCommentRepliedList

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

func (*CommentUseCase) GetUserCommentTalkRepliedList

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

func (*CommentUseCase) GetUserCommentTalkReplyList

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

func (*CommentUseCase) GetUserSubCommentArticleRepliedList

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

func (*CommentUseCase) GetUserSubCommentArticleReplyList

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

func (*CommentUseCase) GetUserSubCommentRepliedList

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

func (*CommentUseCase) GetUserSubCommentTalkRepliedList

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

func (*CommentUseCase) GetUserSubCommentTalkReplyList

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

func (*CommentUseCase) RemoveComment

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

func (*CommentUseCase) RemoveSubComment

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

func (*CommentUseCase) SendComment

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

func (*CommentUseCase) SendSubComment

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

func (*CommentUseCase) SetCommentAgree

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

func (*CommentUseCase) SetSubCommentAgree

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

type CommentUser

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

type CreationContentReview

type CreationContentReview struct {
	Id         int32
	CreationId int32
	Title      string
	Kind       string
	CreateAt   string
	Uuid       string
	JobId      string
	Label      string
	Result     int32
	Section    string
	Mode       string
}

type CreationImageReview

type CreationImageReview struct {
	Id         int32
	CreationId int32
	Kind       string
	Uid        string
	CreateAt   string
	Uuid       string
	JobId      string
	Url        string
	Label      string
	Result     int32
	Category   string
	SubLabel   string
	Mode       string
	Score      int32
}

type CreationRepo

type CreationRepo interface {
	GetLeaderBoard(ctx context.Context) ([]*LeaderBoard, error)
	GetCollectArticleList(ctx context.Context, id, page int32) ([]*Article, error)
	GetCollectArticleCount(ctx context.Context, id int32) (int32, error)
	GetCollectTalkList(ctx context.Context, id, page int32) ([]*Talk, error)
	GetCollectTalkCount(ctx context.Context, id int32) (int32, error)
	GetCollectColumnList(ctx context.Context, id, page int32) ([]*Column, error)
	GetCollectColumnCount(ctx context.Context, id int32) (int32, error)
	GetLastCollectionsDraft(ctx context.Context, uuid string) (*CollectionsDraft, error)
	GetCollectionsContentReview(ctx context.Context, page int32, uuid string) ([]*CreationContentReview, error)
	GetUserTimeLineListVisitor(ctx context.Context, page int32, uuid string) ([]*TimeLine, error)
	GetCollections(ctx context.Context, id int32, uuid string) (*Collections, error)
	GetCollectionListInfo(ctx context.Context, collectionsList []*Collections) ([]*Collections, error)
	GetCollectionsList(ctx context.Context, uuid string, page int32) ([]*Collections, error)
	GetCollectionsListAll(ctx context.Context, uuid string) ([]*Collections, error)
	GetCollectionsListByVisitor(ctx context.Context, uuid string, page int32) ([]*Collections, error)
	GetCollectionsCount(ctx context.Context, uuid string) (int32, error)
	GetCollectionsVisitorCount(ctx context.Context, uuid string) (int32, error)
	GetCreationUser(ctx context.Context, uuid string) (*CreationUser, error)
	GetCreationUserVisitor(ctx context.Context, uuid string) (*CreationUser, error)
	CreateCollectionsDraft(ctx context.Context, uuid string) (int32, error)
	SendCollections(ctx context.Context, id int32, uuid, ip string) error
	SendCollectionsEdit(ctx context.Context, id int32, uuid, ip string) error
	DeleteCollections(ctx context.Context, id int32, uuid string) error
}

type CreationUseCase

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

func NewCreationUseCase

func NewCreationUseCase(repo CreationRepo, articleRepo ArticleRepo, columnRepo ColumnRepo, talkRepo TalkRepo, re Recovery, logger log.Logger) *CreationUseCase

func (*CreationUseCase) CreateCollectionsDraft

func (r *CreationUseCase) CreateCollectionsDraft(ctx context.Context) (int32, error)

func (*CreationUseCase) DeleteCollections

func (r *CreationUseCase) DeleteCollections(ctx context.Context, id int32) error

func (*CreationUseCase) GetCollectArticleCount

func (r *CreationUseCase) GetCollectArticleCount(ctx context.Context, id int32) (int32, error)

func (*CreationUseCase) GetCollectArticleList

func (r *CreationUseCase) GetCollectArticleList(ctx context.Context, id, page int32) ([]*Article, error)

func (*CreationUseCase) GetCollectColumnCount

func (r *CreationUseCase) GetCollectColumnCount(ctx context.Context, id int32) (int32, error)

func (*CreationUseCase) GetCollectColumnList

func (r *CreationUseCase) GetCollectColumnList(ctx context.Context, id, page int32) ([]*Column, error)

func (*CreationUseCase) GetCollectTalkCount

func (r *CreationUseCase) GetCollectTalkCount(ctx context.Context, id int32) (int32, error)

func (*CreationUseCase) GetCollectTalkList

func (r *CreationUseCase) GetCollectTalkList(ctx context.Context, id, page int32) ([]*Talk, error)

func (*CreationUseCase) GetCollections

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

func (*CreationUseCase) GetCollectionsContentReview

func (r *CreationUseCase) GetCollectionsContentReview(ctx context.Context, page int32) ([]*CreationContentReview, error)

func (*CreationUseCase) GetCollectionsCount

func (r *CreationUseCase) GetCollectionsCount(ctx context.Context) (int32, error)

func (*CreationUseCase) GetCollectionsList

func (r *CreationUseCase) GetCollectionsList(ctx context.Context, page int32) ([]*Collections, error)

func (*CreationUseCase) GetCollectionsListAll

func (r *CreationUseCase) GetCollectionsListAll(ctx context.Context) ([]*Collections, error)

func (*CreationUseCase) GetCollectionsListByVisitor

func (r *CreationUseCase) GetCollectionsListByVisitor(ctx context.Context, page int32, uuid string) ([]*Collections, error)

func (*CreationUseCase) GetCollectionsVisitorCount

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

func (*CreationUseCase) GetCreationUser

func (r *CreationUseCase) GetCreationUser(ctx context.Context, uuid string) (*CreationUser, error)

func (*CreationUseCase) GetCreationUserVisitor

func (r *CreationUseCase) GetCreationUserVisitor(ctx context.Context, uuid string) (*CreationUser, error)

func (*CreationUseCase) GetLastCollectionsDraft

func (r *CreationUseCase) GetLastCollectionsDraft(ctx context.Context) (*CollectionsDraft, error)

func (*CreationUseCase) GetLeaderBoard

func (r *CreationUseCase) GetLeaderBoard(ctx context.Context) ([]*LeaderBoard, error)

func (*CreationUseCase) GetUserTimeLineListVisitor

func (r *CreationUseCase) GetUserTimeLineListVisitor(ctx context.Context, page int32, uuid string) ([]*TimeLine, error)

func (*CreationUseCase) SendCollections

func (r *CreationUseCase) SendCollections(ctx context.Context, id int32) error

func (*CreationUseCase) SendCollectionsEdit

func (r *CreationUseCase) SendCollectionsEdit(ctx context.Context, id int32) error

type CreationUser

type CreationUser struct {
	Article     int32
	Column      int32
	Talk        int32
	Collect     int32
	Subscribe   int32
	Collections int32
}

type Credentials

type Credentials struct {
	TmpSecretID  string
	TmpSecretKey string
	SessionToken string
	StartTime    int64
	ExpiredTime  int64
}

type Follow

type Follow struct {
	Follow      string
	Followed    string
	Username    string
	Introduce   string
	Agree       int32
	View        int32
	Collect     int32
	FollowNum   int32
	FollowedNum int32
	Status      int32
}

type Follows

type Follows struct {
	Uuid   string
	Follow int32
}

type Github added in v1.3.0

type Github struct {
	Token    string
	Avatar   string
	Register bool
	Uuid     string
}

type IllegalInfo

type IllegalInfo struct {
	HitFlag int32
	Count   int32
}

type LeaderBoard

type LeaderBoard struct {
	Id   int32
	Uuid string
	Mode string
}

type MailBox

type MailBox struct {
	Time int32
}

type Medal

type Medal struct {
	Creation1 int32
	Creation2 int32
	Creation3 int32
	Creation4 int32
	Creation5 int32
	Creation6 int32
	Creation7 int32
	Agree1    int32
	Agree2    int32
	Agree3    int32
	Agree4    int32
	Agree5    int32
	Agree6    int32
	View1     int32
	View2     int32
	View3     int32
	Comment1  int32
	Comment2  int32
	Comment3  int32
	Collect1  int32
	Collect2  int32
	Collect3  int32
}

type MedalProgress

type MedalProgress struct {
	Article     int32
	Talk        int32
	Agree       int32
	ActiveAgree int32
	View        int32
	Comment     int32
	Collect     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
}

type MessageUseCase

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

func NewMessageUseCase

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

func (*MessageUseCase) GetMailBoxLastTime

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

func (*MessageUseCase) GetMessageNotification

func (r *MessageUseCase) GetMessageNotification(ctx context.Context) (*Notification, error)

func (*MessageUseCase) GetMessageSystemNotification

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

func (*MessageUseCase) RemoveMailBoxCommentCount

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

func (*MessageUseCase) RemoveMailBoxSubCommentCount

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

func (*MessageUseCase) RemoveMailBoxSystemNotificationCount

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

func (*MessageUseCase) SetMailBoxLastTime

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

type News

type News struct {
	Id      string
	Update  string
	Title   string
	Author  string
	Text    string
	Tags    string
	Cover   string
	Url     string
	Content string
}

type NewsRepo

type NewsRepo interface {
	GetNews(ctx context.Context, page int32) ([]*News, error)
	GetNewsSearch(ctx context.Context, page int32, search, time string) ([]*News, int32, error)
}

type NewsUseCase

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

func NewNewsUseCase

func NewNewsUseCase(repo NewsRepo, re Recovery, logger log.Logger) *NewsUseCase

func (*NewsUseCase) GetNews

func (r *NewsUseCase) GetNews(ctx context.Context, page int32) ([]*News, error)

func (*NewsUseCase) GetNewsSearch added in v1.4.0

func (r *NewsUseCase) GetNewsSearch(ctx context.Context, page int32, search, time string) ([]*News, 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 SubComment

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

type Subscribe

type Subscribe struct {
	ColumnId int32
	AuthorId string
	Uuid     string
	Status   int32
}

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
}

type Talk

type Talk struct {
	Id      int32
	Agree   int32
	View    int32
	Collect int32
	Comment int32
	Total   int32
	Title   string
	Tags    string
	Uuid    string
	Text    string
	Cover   string
	Update  string
}

type TalkDraft

type TalkDraft struct {
	Id     int32
	Status int32
}

type TalkRepo

type TalkRepo interface {
	GetTalkList(ctx context.Context, page int32) ([]*Talk, error)
	GetTalkListHot(ctx context.Context, page int32) ([]*Talk, error)
	GetUserTalkList(ctx context.Context, page int32, uuid string) ([]*Talk, error)
	GetUserTalkListVisitor(ctx context.Context, page int32, uuid string) ([]*Talk, error)
	GetTalkCount(ctx context.Context, uuid string) (int32, error)
	GetTalkCountVisitor(ctx context.Context, uuid string) (int32, error)
	GetTalkListStatistic(ctx context.Context, talkList []*Talk) ([]*TalkStatistic, error)
	GetTalkStatistic(ctx context.Context, id int32, uuid string) (*TalkStatistic, error)
	GetLastTalkDraft(ctx context.Context, uuid string) (*TalkDraft, error)
	GetTalkSearch(ctx context.Context, page int32, search, time string) ([]*Talk, int32, error)
	GetUserTalkAgree(ctx context.Context, uuid string) (map[int32]bool, error)
	GetUserTalkCollect(ctx context.Context, uuid string) (map[int32]bool, error)
	GetTalkImageReview(ctx context.Context, page int32, uuid string) ([]*CreationImageReview, error)
	GetTalkContentReview(ctx context.Context, page int32, uuid string) ([]*CreationContentReview, error)
	CreateTalkDraft(ctx context.Context, uuid string) (int32, error)
	SendTalk(ctx context.Context, id int32, uuid, ip string) error
	SendTalkEdit(ctx context.Context, id int32, uuid, ip string) error
	DeleteTalk(ctx context.Context, id int32, uuid string) error
	SetTalkAgree(ctx context.Context, id int32, uuid, userUuid string) error
	CancelTalkAgree(ctx context.Context, id int32, uuid, userUuid string) error
	CancelTalkCollect(ctx context.Context, id int32, uuid, userUuid string) error
	SetTalkView(ctx context.Context, id int32, uuid string) error
	SetTalkCollect(ctx context.Context, id, collectionsId int32, uuid, userUuid string) error
	TalkStatisticJudge(ctx context.Context, id int32, uuid string) (*TalkStatisticJudge, error)
}

type TalkStatistic

type TalkStatistic struct {
	Id      int32
	Uuid    string
	Agree   int32
	View    int32
	Collect int32
	Comment int32
}

type TalkStatisticJudge

type TalkStatisticJudge struct {
	Agree   bool
	Collect bool
}

type TalkUseCase

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

func NewTalkUseCase

func NewTalkUseCase(repo TalkRepo, re Recovery, logger log.Logger) *TalkUseCase

func (*TalkUseCase) CancelTalkAgree

func (r *TalkUseCase) CancelTalkAgree(ctx context.Context, id int32, uuid string) error

func (*TalkUseCase) CancelTalkCollect

func (r *TalkUseCase) CancelTalkCollect(ctx context.Context, id int32, uuid string) error

func (*TalkUseCase) CreateTalkDraft

func (r *TalkUseCase) CreateTalkDraft(ctx context.Context) (int32, error)

func (*TalkUseCase) DeleteTalk

func (r *TalkUseCase) DeleteTalk(ctx context.Context, id int32) error

func (*TalkUseCase) GetLastTalkDraft

func (r *TalkUseCase) GetLastTalkDraft(ctx context.Context) (*TalkDraft, error)

func (*TalkUseCase) GetTalkContentReview

func (r *TalkUseCase) GetTalkContentReview(ctx context.Context, page int32) ([]*CreationContentReview, error)

func (*TalkUseCase) GetTalkCount

func (r *TalkUseCase) GetTalkCount(ctx context.Context) (int32, error)

func (*TalkUseCase) GetTalkCountVisitor

func (r *TalkUseCase) GetTalkCountVisitor(ctx context.Context, uuid string) (int32, error)

func (*TalkUseCase) GetTalkImageReview

func (r *TalkUseCase) GetTalkImageReview(ctx context.Context, page int32) ([]*CreationImageReview, error)

func (*TalkUseCase) GetTalkList

func (r *TalkUseCase) GetTalkList(ctx context.Context, page int32) ([]*Talk, error)

func (*TalkUseCase) GetTalkListHot

func (r *TalkUseCase) GetTalkListHot(ctx context.Context, page int32) ([]*Talk, error)

func (*TalkUseCase) GetTalkListStatistic

func (r *TalkUseCase) GetTalkListStatistic(ctx context.Context, ids []int32) ([]*TalkStatistic, error)

GetTalkListStatistic todo: delete

func (*TalkUseCase) GetTalkSearch

func (r *TalkUseCase) GetTalkSearch(ctx context.Context, page int32, search, time string) ([]*Talk, int32, error)

func (*TalkUseCase) GetTalkStatistic

func (r *TalkUseCase) GetTalkStatistic(ctx context.Context, id int32, uuid string) (*TalkStatistic, error)

func (*TalkUseCase) GetUserTalkAgree

func (r *TalkUseCase) GetUserTalkAgree(ctx context.Context) (map[int32]bool, error)

func (*TalkUseCase) GetUserTalkCollect

func (r *TalkUseCase) GetUserTalkCollect(ctx context.Context) (map[int32]bool, error)

func (*TalkUseCase) GetUserTalkList

func (r *TalkUseCase) GetUserTalkList(ctx context.Context, page int32) ([]*Talk, error)

func (*TalkUseCase) GetUserTalkListSimple

func (r *TalkUseCase) GetUserTalkListSimple(ctx context.Context, page int32) ([]*Talk, error)

func (*TalkUseCase) GetUserTalkListVisitor

func (r *TalkUseCase) GetUserTalkListVisitor(ctx context.Context, page int32, uuid string) ([]*Talk, error)

func (*TalkUseCase) SendTalk

func (r *TalkUseCase) SendTalk(ctx context.Context, id int32) error

func (*TalkUseCase) SendTalkEdit

func (r *TalkUseCase) SendTalkEdit(ctx context.Context, id int32) error

func (*TalkUseCase) SetTalkAgree

func (r *TalkUseCase) SetTalkAgree(ctx context.Context, id int32, uuid string) error

func (*TalkUseCase) SetTalkCollect

func (r *TalkUseCase) SetTalkCollect(ctx context.Context, id, collectionsId int32, uuid string) error

func (*TalkUseCase) SetTalkView

func (r *TalkUseCase) SetTalkView(ctx context.Context, id int32, uuid string) error

func (*TalkUseCase) TalkStatisticJudge

func (r *TalkUseCase) TalkStatisticJudge(ctx context.Context, id int32) (*TalkStatisticJudge, error)

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      []*Section
}

type TimeLIneFollows

type TimeLIneFollows struct {
	Uuid     string
	Username string
}

type TimeLine

type TimeLine struct {
	Id         int32
	Uuid       string
	CreationId int32
	Mode       int32
	Agree      int32
	View       int32
	Collect    int32
	Comment    int32
}

type UserAccount

type UserAccount struct {
	Phone    string
	Email    string
	Qq       string
	Wechat   string
	Gitee    int32
	Github   int32
	Password string
}

type UserImageReview

type UserImageReview struct {
	Id       int32
	Uuid     string
	CreateAt string
	JobId    string
	Url      string
	Label    string
	Result   int32
	Score    int32
	Category string
	SubLabel string
}

type UserProfile

type UserProfile struct {
	Uuid        string
	Username    string
	Avatar      string
	School      string
	Company     string
	Job         string
	Homepage    string
	Github      string
	Gitee       string
	Introduce   string
	Created     string
	Score       int32
	Agree       int32
	Collect     int32
	View        int32
	Follow      int32
	Followed    int32
	Article     int32
	Column      int32
	Subscribe   int32
	Talk        int32
	Collections int32
}

type UserProfileUpdate

type UserProfileUpdate struct {
	UserProfile
	Status int32
}

type UserRepo

type UserRepo interface {
	UserRegister(ctx context.Context, email, password, code string) error
	LoginByPassword(ctx context.Context, account, password, mode string) (string, error)
	LoginByCode(ctx context.Context, phone, code string) (string, error)
	LoginPasswordReset(ctx context.Context, account, password, code, mode string) error
	LoginByWechat(ctx context.Context, code string) (string, error)
	LoginByQQ(ctx context.Context, code string) (string, error)
	LoginByGithub(ctx context.Context, code string) (*Github, error)
	LoginByGitee(ctx context.Context, code string) (string, error)
	SendPhoneCode(ctx context.Context, template, phone string) error
	SendEmailCode(ctx context.Context, template, email string) error
	GetCosSessionKey(ctx context.Context, uuid string) (*Credentials, error)
	GetAccount(ctx context.Context, uuid string) (*UserAccount, error)
	GetProfile(ctx context.Context, uuid string) (*UserProfile, error)
	GetProfileList(ctx context.Context, uuids []string) ([]*UserProfile, error)
	GetUserInfo(ctx context.Context, uuid string) (*UserProfile, error)
	GetProfileUpdate(ctx context.Context, uuid string) (*UserProfileUpdate, error)
	GetFollowList(ctx context.Context, page int32, uuid string) ([]*Follow, error)
	GetFollowProfileList(ctx context.Context, page int32, uuid string, followList []*Follow) ([]*UserProfile, error)
	GetFollowAchievementList(ctx context.Context, page int32, uuid string, followList []*Follow) ([]*Achievement, error)
	GetFollowedProfileList(ctx context.Context, page int32, uuid string, followedList []*Follow) ([]*UserProfile, error)
	GetFollowedAchievementList(ctx context.Context, page int32, uuid string, followedList []*Follow) ([]*Achievement, error)
	GetSearchAchievementList(ctx context.Context, searchList []*UserSearch) ([]*Achievement, error)
	GetFollowListCount(ctx context.Context, uuid string) (int32, error)
	GetFollowedList(ctx context.Context, page int32, uuid string) ([]*Follow, error)
	GetFollowedListCount(ctx context.Context, uuid string) (int32, error)
	GetUserFollow(ctx context.Context, uuid, userUuid string) (bool, error)
	GetUserFollows(ctx context.Context, uuid string) (map[string]bool, error)
	GetUserSearch(ctx context.Context, page int32, search string) ([]*UserSearch, int32, error)
	GetAvatarReview(ctx context.Context, page int32, uuid string) ([]*UserImageReview, error)
	GetCoverReview(ctx context.Context, page int32, uuid string) ([]*UserImageReview, error)
	SetProfileUpdate(ctx context.Context, profile *UserProfileUpdate) error
	SetUserPhone(ctx context.Context, uuid, phone, code string) error
	SetUserPassword(ctx context.Context, uuid, password string) error
	SetUserWechat(ctx context.Context, uuid, code, redirectUrl string) error
	SetUserQQ(ctx context.Context, uuid, code, redirectUrl string) error
	SetUserGitee(ctx context.Context, uuid, code, redirectUrl string) error
	SetUserGithub(ctx context.Context, uuid, code, redirectUrl string) error
	SetUserEmail(ctx context.Context, uuid, email, code string) error
	SetUserFollow(ctx context.Context, uuid, userUuid string) error
	CancelUserFollow(ctx context.Context, uuid, userUuid string) error
	ChangeUserPassword(ctx context.Context, uuid, oldpassword, password string) error
	UnbindUserPhone(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
	UnbindUserEmail(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
	UnbindUserWechat(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
	UnbindUserQQ(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
	UnbindUserGitee(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
	UnbindUserGithub(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
}

type UserSearch

type UserSearch struct {
	Uuid        string
	Username    string
	Introduce   string
	Agree       int32
	View        int32
	Collect     int32
	FollowNum   int32
	FollowedNum int32
}

type UserUseCase

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

func NewUserUseCase

func NewUserUseCase(repo UserRepo, achRepo AchievementRepo, creationRepo CreationRepo, re Recovery, logger log.Logger) *UserUseCase

func (*UserUseCase) CancelUserFollow

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

func (*UserUseCase) ChangeUserPassword

func (r *UserUseCase) ChangeUserPassword(ctx context.Context, oldpassword, password string) error

func (*UserUseCase) GetAccount

func (r *UserUseCase) GetAccount(ctx context.Context) (*UserAccount, error)

func (*UserUseCase) GetAvatarReview

func (r *UserUseCase) GetAvatarReview(ctx context.Context, page int32) ([]*UserImageReview, error)

func (*UserUseCase) GetCosSessionKey

func (r *UserUseCase) GetCosSessionKey(ctx context.Context) (*Credentials, error)

func (*UserUseCase) GetCoverReview

func (r *UserUseCase) GetCoverReview(ctx context.Context, page int32) ([]*UserImageReview, error)

func (*UserUseCase) GetFollowList

func (r *UserUseCase) GetFollowList(ctx context.Context, page int32, uuid string) ([]*Follow, error)

func (*UserUseCase) GetFollowListCount

func (r *UserUseCase) GetFollowListCount(ctx context.Context, uuid string) (int32, error)

func (*UserUseCase) GetFollowedList

func (r *UserUseCase) GetFollowedList(ctx context.Context, page int32, uuid string) ([]*Follow, error)

func (*UserUseCase) GetFollowedListCount

func (r *UserUseCase) GetFollowedListCount(ctx context.Context, uuid string) (int32, error)

func (*UserUseCase) GetProfile

func (r *UserUseCase) GetProfile(ctx context.Context) (*UserProfile, error)

func (*UserUseCase) GetProfileList

func (r *UserUseCase) GetProfileList(ctx context.Context, uuids []string) ([]*UserProfile, error)

func (*UserUseCase) GetProfileUpdate

func (r *UserUseCase) GetProfileUpdate(ctx context.Context) (*UserProfileUpdate, error)

func (*UserUseCase) GetTimeLineUsers

func (r *UserUseCase) GetTimeLineUsers(ctx context.Context) ([]*TimeLIneFollows, error)

func (*UserUseCase) GetUserFollow

func (r *UserUseCase) GetUserFollow(ctx context.Context, uuid string) (bool, error)

func (*UserUseCase) GetUserFollows

func (r *UserUseCase) GetUserFollows(ctx context.Context) (map[string]bool, error)

func (*UserUseCase) GetUserInfo

func (r *UserUseCase) GetUserInfo(ctx context.Context) (*UserProfile, error)

func (*UserUseCase) GetUserInfoVisitor

func (r *UserUseCase) GetUserInfoVisitor(ctx context.Context, uuid string) (*UserProfile, error)

func (*UserUseCase) GetUserSearch

func (r *UserUseCase) GetUserSearch(ctx context.Context, page int32, search string) ([]*UserSearch, int32, error)

func (*UserUseCase) LoginByCode

func (r *UserUseCase) LoginByCode(ctx context.Context, phone, code string) (string, error)

func (*UserUseCase) LoginByGitee added in v1.3.0

func (r *UserUseCase) LoginByGitee(ctx context.Context, code string) (string, error)

func (*UserUseCase) LoginByGithub added in v1.3.0

func (r *UserUseCase) LoginByGithub(ctx context.Context, code string) (*Github, error)

func (*UserUseCase) LoginByPassword

func (r *UserUseCase) LoginByPassword(ctx context.Context, account, password, mode string) (string, error)

func (*UserUseCase) LoginByQQ added in v1.3.0

func (r *UserUseCase) LoginByQQ(ctx context.Context, code string) (string, error)

func (*UserUseCase) LoginByWechat added in v1.3.0

func (r *UserUseCase) LoginByWechat(ctx context.Context, code string) (string, error)

func (*UserUseCase) LoginPasswordReset

func (r *UserUseCase) LoginPasswordReset(ctx context.Context, account, password, code, mode string) error

func (*UserUseCase) SendEmailCode

func (r *UserUseCase) SendEmailCode(ctx context.Context, template, email string) error

func (*UserUseCase) SendPhoneCode

func (r *UserUseCase) SendPhoneCode(ctx context.Context, template, phone string) error

func (*UserUseCase) SetUserEmail

func (r *UserUseCase) SetUserEmail(ctx context.Context, email, code string) error

func (*UserUseCase) SetUserFollow

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

func (*UserUseCase) SetUserGitee added in v1.3.0

func (r *UserUseCase) SetUserGitee(ctx context.Context, code, redirectUrl string) error

func (*UserUseCase) SetUserGithub added in v1.3.0

func (r *UserUseCase) SetUserGithub(ctx context.Context, code, redirectUrl string) error

func (*UserUseCase) SetUserPassword

func (r *UserUseCase) SetUserPassword(ctx context.Context, password string) error

func (*UserUseCase) SetUserPhone

func (r *UserUseCase) SetUserPhone(ctx context.Context, phone, code string) error

func (*UserUseCase) SetUserProfile

func (r *UserUseCase) SetUserProfile(ctx context.Context, profile *UserProfileUpdate) error

func (*UserUseCase) SetUserQQ added in v1.3.0

func (r *UserUseCase) SetUserQQ(ctx context.Context, code, redirectUrl string) error

func (*UserUseCase) SetUserWechat added in v1.3.0

func (r *UserUseCase) SetUserWechat(ctx context.Context, code, redirectUrl string) error

func (*UserUseCase) UnbindUserEmail

func (r *UserUseCase) UnbindUserEmail(ctx context.Context, phone, email, account, password, code, choose, mode, redirectUri string) error

func (*UserUseCase) UnbindUserGitee added in v1.3.0

func (r *UserUseCase) UnbindUserGitee(ctx context.Context, phone, email, account, password, code, choose, mode, redirectUri string) error

func (*UserUseCase) UnbindUserGithub added in v1.3.0

func (r *UserUseCase) UnbindUserGithub(ctx context.Context, phone, email, account, password, code, choose, mode, redirectUri string) error

func (*UserUseCase) UnbindUserPhone

func (r *UserUseCase) UnbindUserPhone(ctx context.Context, phone, email, account, password, code, choose, mode, redirectUri string) error

func (*UserUseCase) UnbindUserQQ added in v1.3.0

func (r *UserUseCase) UnbindUserQQ(ctx context.Context, phone, email, account, password, code, choose, mode, redirectUri string) error

func (*UserUseCase) UnbindUserWechat added in v1.3.0

func (r *UserUseCase) UnbindUserWechat(ctx context.Context, phone, email, account, password, code, choose, mode, redirectUri string) error

func (*UserUseCase) UserRegister

func (r *UserUseCase) UserRegister(ctx context.Context, email, password, code string) error

Jump to

Keyboard shortcuts

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