service

package
v0.0.0-...-048bef2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 17 Imported by: 0

README

Service

业务逻辑层

Documentation

Index

Constants

View Source
const (
	// LikeTypeUnknown 未知类型
	LikeTypeUnknown LikeType = 0
	// LikeTypePost 帖子
	LikeTypePost LikeType = 1
	// LikeTypeComment 评论
	LikeTypeComment LikeType = 2

	// LikeStatusDisliked 未点赞
	LikeStatusDisliked LikeStatus = 0
	// LikeStatusLiked 已点赞
	LikeStatusLiked LikeStatus = 1
)
View Source
const (
	// PostTypeUnknown Post 类型
	PostTypeUnknown PostType = 0 // 未知
	PostTypeText    PostType = 1 // 文本
	PostTypeImage   PostType = 2 // 图片
	PostTypeVideo   PostType = 3 // 视频

	DelFlagNormal  DeleteType = 0 // 正常
	DelFlagByUser  DeleteType = 1 // 用户删除
	DelFlagByAdmin DeleteType = 2 // 管理员删除

	VisibleAll      VisibleType = 0 // 公开
	VisibleOnlySelf VisibleType = 1 // 仅自己可见
)

Variables

ProviderSet is service providers.

Functions

This section is empty.

Types

type CommentServiceServer

type CommentServiceServer struct {
	v1.UnimplementedCommentServiceServer
	// contains filtered or unexported fields
}

func NewCommentServiceServer

func NewCommentServiceServer(
	postRepo repository.PostInfoRepo,
	cmtInfoRepo repository.CommentInfoRepo,
	cmtContentRepo repository.CommentContentRepo,
	cmtLatestRepo repository.CommentLatestRepo,
	cmtTopRepo repository.CommentHotRepo,
	userCmtRepo repository.UserCommentRepo,
) *CommentServiceServer

func (*CommentServiceServer) BatchGetComment

func (*CommentServiceServer) CreateComment

func (*CommentServiceServer) DeleteComment

func (*CommentServiceServer) GetComment

func (*CommentServiceServer) ListHotComment

func (*CommentServiceServer) ListLatestComment

func (s *CommentServiceServer) ListLatestComment(ctx context.Context, req *v1.ListCommentRequest) (*v1.ListCommentReply, error)

func (*CommentServiceServer) ListReplyComment

func (*CommentServiceServer) ReplyComment

func (*CommentServiceServer) UpdateComment

type CommentType

type CommentType int
const (
	// CommentTypeText text comment type
	CommentTypeText CommentType = 1
	// CommentTypeImage image comment type
	CommentTypeImage CommentType = 2
)

type DeleteType

type DeleteType int

type IGreeterService

type IGreeterService interface {
	SayHi(ctx context.Context, name string) (string, error)
}

type LikeServiceServer

type LikeServiceServer struct {
	v1.UnimplementedLikeServiceServer
	// contains filtered or unexported fields
}

func NewLikeServiceServer

func NewLikeServiceServer(
	likeRepo repository.UserLikeRepo,
	postRepo repository.PostInfoRepo,
	cmtInfoRepo repository.CommentInfoRepo,
) *LikeServiceServer

func (*LikeServiceServer) BatchGetLike

func (*LikeServiceServer) CreateLike

func (*LikeServiceServer) DeleteLike

func (*LikeServiceServer) GetLike

func (*LikeServiceServer) ListCommentLike

func (s *LikeServiceServer) ListCommentLike(ctx context.Context, req *v1.ListCommentLikeRequest) (*v1.ListLikeReply, error)

func (*LikeServiceServer) ListPostLike

func (*LikeServiceServer) UpdateLike

type LikeStatus

type LikeStatus int

type LikeType

type LikeType int

type PostImage

type PostImage struct {
	Text   string `json:"text"`
	Images []struct {
		ImageKey  string `json:"image_key"`
		ImageType string `json:"image_type"`
		Width     int32  `json:"width"`
		Height    int32  `json:"height"`
	} `json:"images"`
}

type PostServiceServer

type PostServiceServer struct {
	v1.UnimplementedPostServiceServer
	// contains filtered or unexported fields
}

func NewPostServiceServer

func NewPostServiceServer(
	postRepo repository.PostInfoRepo,
	latestRepo repository.PostLatestRepo,
	hotRepo repository.PostHotRepo,
	userPostRepo repository.UserPostRepo,
) *PostServiceServer

func (*PostServiceServer) BatchGetPost

func (*PostServiceServer) CreatePost

func (*PostServiceServer) DeletePost

func (*PostServiceServer) GetPost

func (*PostServiceServer) ListHotPost

func (*PostServiceServer) ListLatestPost

func (*PostServiceServer) ListMyPost

func (*PostServiceServer) UpdatePost

type PostText

type PostText struct {
	Text string `json:"text"`
}

type PostType

type PostType int

type PostVideo

type PostVideo struct {
	Text        string `json:"text"`
	VideoKey    string `json:"video_key"`
	Duration    int    `json:"duration"`
	CoverKey    string `json:"cover_key"`
	CoverWidth  int    `json:"cover_width"`
	CoverHeight int    `json:"cover_height"`
}

type Service

type Service interface {
	Greeter() IGreeterService
}

Service define all service

var Svc Service

Svc global var

func New

func New() Service

New init service

type VisibleType

type VisibleType int

Jump to

Keyboard shortcuts

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