biz

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IpPost

type IpPost struct {
	IpPostId, PostId int
	Ip               string
}

type IpPostRepo

type IpPostRepo interface {
	ListIpPosts(ctx context.Context, parent string) (*IpPosts, error)
	GetIpPost(ctx context.Context, name string) (*IpPost, error)
	CreateIpPost(ctx context.Context, ipPost *IpPost) (*IpPost, error)
	UpdateIpPost(ctx context.Context, ipPost *IpPost) (*IpPost, error)
	DeleteIpPost(ctx context.Context, name string) (*emptypb.Empty, error)
}

type IpPostUsecase

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

func NewIpPostUsecase

func NewIpPostUsecase(repo IpPostRepo, logger log.Logger) *IpPostUsecase

func (*IpPostUsecase) CreateIpPost

func (ivu *IpPostUsecase) CreateIpPost(ctx context.Context, ipPost *IpPost) (*IpPost, error)

func (*IpPostUsecase) DeleteIpPost

func (ivu *IpPostUsecase) DeleteIpPost(ctx context.Context, name string) (*emptypb.Empty, error)

func (*IpPostUsecase) GetIpPost

func (ivu *IpPostUsecase) GetIpPost(ctx context.Context, name string) (*IpPost, error)

func (*IpPostUsecase) ListIpPosts

func (ivu *IpPostUsecase) ListIpPosts(ctx context.Context, parent string) (*IpPosts, error)

func (*IpPostUsecase) UpdateIpPost

func (ivu *IpPostUsecase) UpdateIpPost(ctx context.Context, ipPost *IpPost) (*IpPost, error)

type IpPosts

type IpPosts struct {
	Collection    []*IpPost
	NextPageToken string
}

type IpVote

type IpVote struct {
	IpVoteId, VoteId, PostId int
	Ip, Opts, TxtField       string
}

type IpVoteRepo

type IpVoteRepo interface {
	ListIpVotes(ctx context.Context, parent string) (*IpVotes, error)
	GetIpVote(ctx context.Context, name string) (*IpVote, error)
	CreateIpVote(ctx context.Context, ipVote *IpVote) (*IpVote, error)
	UpdateIpVote(ctx context.Context, ipVote *IpVote) (*IpVote, error)
	DeleteIpVote(ctx context.Context, name string) (*emptypb.Empty, error)
}

type IpVoteUsecase

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

func NewIpVoteUsecase

func NewIpVoteUsecase(repo IpVoteRepo, logger log.Logger) *IpVoteUsecase

func (*IpVoteUsecase) CreateIpVote

func (ivu *IpVoteUsecase) CreateIpVote(ctx context.Context, ipVote *IpVote) (*IpVote, error)

func (*IpVoteUsecase) DeleteIpVote

func (ivu *IpVoteUsecase) DeleteIpVote(ctx context.Context, name string) (*emptypb.Empty, error)

func (*IpVoteUsecase) GetIpVote

func (ivu *IpVoteUsecase) GetIpVote(ctx context.Context, name string) (*IpVote, error)

func (*IpVoteUsecase) ListIpVotes

func (ivu *IpVoteUsecase) ListIpVotes(ctx context.Context, parent string) (*IpVotes, error)

func (*IpVoteUsecase) UpdateIpVote

func (ivu *IpVoteUsecase) UpdateIpVote(ctx context.Context, ipVote *IpVote) (*IpVote, error)

type IpVotes

type IpVotes struct {
	Collection    []*IpVote
	NextPageToken string
}

type PidVids

type PidVids struct {
	Pid  int
	Vids []int
}

type Post

type Post struct {
	PostId, IsClosed       int
	Title, Detail          string
	CreateTime, UpdateTime time.Time
}

type PostRepo

type PostRepo interface {
	ListPosts(ctx context.Context, parent string) (*Posts, error)
	GetPost(ctx context.Context, name string) (*Post, error)
	SearchPosts(ctx context.Context, name string) (*Posts, error)
	CreatePost(ctx context.Context, post *Post) (*Post, error)
	UpdatePost(ctx context.Context, post *Post) (*Post, error)
	DeletePost(ctx context.Context, name string) (*emptypb.Empty, error)
}

type PostUsecase

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

func NewPostUsecase

func NewPostUsecase(repo PostRepo, logger log.Logger) *PostUsecase

func (*PostUsecase) CreatePost

func (pu *PostUsecase) CreatePost(ctx context.Context, post *Post) (*Post, error)

func (*PostUsecase) DeletePost

func (pu *PostUsecase) DeletePost(ctx context.Context, name string) (*emptypb.Empty, error)

func (*PostUsecase) GetPost

func (pu *PostUsecase) GetPost(ctx context.Context, name string) (*Post, error)

func (*PostUsecase) ListPosts

func (pu *PostUsecase) ListPosts(ctx context.Context, parent string) (*Posts, error)

func (*PostUsecase) SearchPosts

func (pu *PostUsecase) SearchPosts(ctx context.Context, name string) (*Posts, error)

func (*PostUsecase) UpdatePost

func (pu *PostUsecase) UpdatePost(ctx context.Context, post *Post) (*Post, error)

type PostVote

type PostVote struct {
	PostVoteId, PostId, VoteId int
}

type PostVoteRepo

type PostVoteRepo interface {
	ListPostVotes(ctx context.Context, parent string) (*PostVotes, error)
	GetPostVote(ctx context.Context, name string) (*PostVote, error)
	GetByPidVid(ctx context.Context, name string) (*PostVote, error)
	ListVidsByPid(ctx context.Context, name string) (*PidVids, error)
	CreatePostVote(ctx context.Context, postVote *PostVote) (*PostVote, error)
	UpdatePostVote(ctx context.Context, postVote *PostVote) (*PostVote, error)
	DeletePostVote(ctx context.Context, name string) (*emptypb.Empty, error)
}

type PostVoteUsecase

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

func NewPostVoteUsecase

func NewPostVoteUsecase(repo PostVoteRepo, logger log.Logger) *PostVoteUsecase

func (*PostVoteUsecase) CreatePostVote

func (pvu *PostVoteUsecase) CreatePostVote(ctx context.Context, postVote *PostVote) (*PostVote, error)

func (*PostVoteUsecase) DeletePostVote

func (pvu *PostVoteUsecase) DeletePostVote(ctx context.Context, name string) (*emptypb.Empty, error)

func (*PostVoteUsecase) GetByPidVid

func (pvu *PostVoteUsecase) GetByPidVid(ctx context.Context, name string) (*PostVote, error)

func (*PostVoteUsecase) GetPostVote

func (pvu *PostVoteUsecase) GetPostVote(ctx context.Context, name string) (*PostVote, error)

func (*PostVoteUsecase) ListPostVotes

func (pvu *PostVoteUsecase) ListPostVotes(ctx context.Context, parent string) (*PostVotes, error)

func (*PostVoteUsecase) ListVidsByPid

func (pvu *PostVoteUsecase) ListVidsByPid(ctx context.Context, name string) (*PidVids, error)

func (*PostVoteUsecase) UpdatePostVote

func (pvu *PostVoteUsecase) UpdatePostVote(ctx context.Context, postVote *PostVote) (*PostVote, error)

type PostVotes

type PostVotes struct {
	Collection    []*PostVote
	NextPageToken string
}

type Posts

type Posts struct {
	Collection    []*Post
	NextPageToken string
}

type User

type User struct {
	UserId, State, Deleted               int
	UserIp, Username, Password           string
	Realname, Nickname, AvatarUrl, Phone string
	CreateTime, UpdateTime               time.Time
}

type UserRepo

type UserRepo interface {
	ListUsers(ctx context.Context, parent string) (*Users, error)
	GetUser(ctx context.Context, name string) (*User, error)
	SearchUsers(ctx context.Context, name string) (*Users, error)
	CreateUser(ctx context.Context, user *User) (*User, error)
	UpdateUser(ctx context.Context, user *User) (*User, error)
	DeleteUser(ctx context.Context, name string) (*emptypb.Empty, error)
	UndeleteUser(ctx context.Context, name string) (*emptypb.Empty, error)
	PermanentlyDeleteUser(ctx context.Context, name string) (*emptypb.Empty, error)
}

type UserUsecase

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

func NewUserUsecase

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

func (*UserUsecase) CreateUser

func (uu *UserUsecase) CreateUser(ctx context.Context, user *User) (*User, error)

func (*UserUsecase) DeleteUser

func (uu *UserUsecase) DeleteUser(ctx context.Context, name string) (*emptypb.Empty, error)

func (*UserUsecase) GetUser

func (uu *UserUsecase) GetUser(ctx context.Context, name string) (*User, error)

func (*UserUsecase) ListUsers

func (uu *UserUsecase) ListUsers(ctx context.Context, parent string) (*Users, error)

func (*UserUsecase) PermanentlyDeleteUser

func (uu *UserUsecase) PermanentlyDeleteUser(ctx context.Context, name string) (*emptypb.Empty, error)

func (*UserUsecase) SearchUsers

func (uu *UserUsecase) SearchUsers(ctx context.Context, name string) (*Users, error)

func (*UserUsecase) UndeleteUser

func (uu *UserUsecase) UndeleteUser(ctx context.Context, name string) (*emptypb.Empty, error)

func (*UserUsecase) UpdateUser

func (uu *UserUsecase) UpdateUser(ctx context.Context, user *User) (*User, error)

type Users

type Users struct {
	Collection    []*User
	NextPageToken string
}

type Vote

type Vote struct {
	VoteId, IsRadio, HasTxtField  int
	Title, A, B, C, D, E, F, G, H string
	CreateTime, UpdateTime        time.Time
}

type VoteRepo

type VoteRepo interface {
	ListVotes(ctx context.Context, parent string) (*Votes, error)
	GetVote(ctx context.Context, name string) (*Vote, error)
	SearchVotes(ctx context.Context, name string) (*Votes, error)
	CreateVote(ctx context.Context, vote *Vote) (*Vote, error)
	UpdateVote(ctx context.Context, vote *Vote) (*Vote, error)
	DeleteVote(ctx context.Context, name string) (*emptypb.Empty, error)
}

type VoteUsecase

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

func NewVoteUsecase

func NewVoteUsecase(repo VoteRepo, logger log.Logger) *VoteUsecase

func (*VoteUsecase) CreateVote

func (pu *VoteUsecase) CreateVote(ctx context.Context, vote *Vote) (*Vote, error)

func (*VoteUsecase) DeleteVote

func (pu *VoteUsecase) DeleteVote(ctx context.Context, name string) (*emptypb.Empty, error)

func (*VoteUsecase) GetVote

func (pu *VoteUsecase) GetVote(ctx context.Context, name string) (*Vote, error)

func (*VoteUsecase) ListVotes

func (pu *VoteUsecase) ListVotes(ctx context.Context, parent string) (*Votes, error)

func (*VoteUsecase) SearchVotes

func (pu *VoteUsecase) SearchVotes(ctx context.Context, name string) (*Votes, error)

func (*VoteUsecase) UpdateVote

func (pu *VoteUsecase) UpdateVote(ctx context.Context, vote *Vote) (*Vote, error)

type Votes

type Votes struct {
	Collection    []*Vote
	NextPageToken string
}

Jump to

Keyboard shortcuts

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