biz

package
v0.0.0-...-aa092f0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Content

type Content struct {
	Text string
}

type FeedRepo

type FeedRepo interface {
	// 发布动态
	Publish(context.Context, *Moment) error
	// 关注的人的朋友圈动态
	Moments(context.Context, *MomentsSearch) ([]*Moment, error)
	// 我发表的朋友圈动态
	History(context.Context, *MomentsSearch) ([]*Moment, error)
}

type FeedUsecase

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

func NewFeedUsecase

func NewFeedUsecase(repo FeedRepo, logger log.Logger) *FeedUsecase

func (*FeedUsecase) History

func (uc *FeedUsecase) History(ctx context.Context, ds *MomentsSearch) ([]*Moment, error)

func (*FeedUsecase) Moments

func (uc *FeedUsecase) Moments(ctx context.Context, ds *MomentsSearch) ([]*Moment, error)

func (*FeedUsecase) Publish

func (uc *FeedUsecase) Publish(ctx context.Context, d *Moment) error

type Message

type Message struct {
	SenderUid int32
	RecverUid int32
	Content   *Content
	CTime     int64 // create time
}

type MessageRepo

type MessageRepo interface {
	SendMessage(context.Context, *Message) error
	MessageHistory(context.Context, *MessageSearch) ([]*Message, error)
	RecallMessage(context.Context, *MessageSearch) error
}

type MessageSearch

type MessageSearch struct {
	SenderUid int32
	RecverUid int32
	Page      int32
	Count     int32
}

type MessageUsecase

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

func NewMessageUsecase

func NewMessageUsecase(repo MessageRepo, logger log.Logger) *MessageUsecase

func (*MessageUsecase) MessageHistory

func (uc *MessageUsecase) MessageHistory(ctx context.Context, ms *MessageSearch) ([]*Message, error)

func (*MessageUsecase) RecallMessage

func (uc *MessageUsecase) RecallMessage(ctx context.Context, ms *MessageSearch) error

func (*MessageUsecase) SendMessage

func (uc *MessageUsecase) SendMessage(ctx context.Context, m *Message) error

type Moment

type Moment struct {
	MomentId    int64
	MomentType  int32
	User        *User
	Text        string
	Imgs        []string
	PublishTime time.Time
}

type MomentsSearch

type MomentsSearch struct {
	Uid      int32
	LastId   int64
	PageSize int32
}

type User

type User struct {
	Uid  int32
	Nick string
}

type UserRelation

type UserRelation struct {
	ActiveUid  int32
	PassiveUid int32
	Action     int32
}

type UserRepo

type UserRepo interface {
	Register(context.Context, *User) error
	Info(context.Context, int32) (*User, error)
	Followers(context.Context, *UserSearch) ([]*User, int32, error)
	Following(context.Context, *UserSearch) ([]*User, int32, error)
	Relation(context.Context, *UserRelation) error
}

type UserSearch

type UserSearch struct {
	Uid   int32
	Page  int32
	Count int32
}

type UserUsecase

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

func NewUserUsecase

func NewUserUsecase(repo UserRepo, logger log.Logger) *UserUsecase

func (*UserUsecase) Followers

func (uc *UserUsecase) Followers(ctx context.Context, us *UserSearch) ([]*User, int32, error)

func (*UserUsecase) Following

func (uc *UserUsecase) Following(ctx context.Context, us *UserSearch) ([]*User, int32, error)

func (*UserUsecase) Info

func (uc *UserUsecase) Info(ctx context.Context, uid int32) (*User, error)

func (*UserUsecase) Register

func (uc *UserUsecase) Register(ctx context.Context, u *User) error

func (*UserUsecase) Relation

func (uc *UserUsecase) Relation(ctx context.Context, ur *UserRelation) error

Jump to

Keyboard shortcuts

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