service

package
v0.0.0-...-4aec9fb Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentService

type CommentService interface {

	// 获取某个task的评论
	GetComment(ctx context.Context, taskId string) (status bool, errinfo string, data []model.Comment)

	// 发表评论
	PostComment(ctx context.Context, taskId string, comment string) (status bool, errinfo string, data *model.Comment)

	// 更改某条评论
	ChangeComment(ctx context.Context, taskId string, cId string, comment string) (status bool, errinfo string, data *model.Comment)

	// 删除某条评论
	DeleteComment(ctx context.Context, taskId string, cId string) (status bool, errinfo string, data string)

	// 点赞某条评论
	LikeComment(ctx context.Context, taskId string, cId string) (status bool, errinfo string, data *model.Comment)

	// 取消点赞某条评论
	CancelLikeComment(ctx context.Context, taskId string, cId string) (status bool, errinfo string, data *model.Comment)
}

CommentService describes the service.

func New

func New(middleware []Middleware) CommentService

New returns a CommentService with all of the expected middleware wired in.

func NewBasicCommentService

func NewBasicCommentService() CommentService

NewBasicCommentService returns a naive, stateless implementation of CommentService.

type Middleware

type Middleware func(CommentService) CommentService

Middleware describes a service middleware.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware takes a logger as a dependency and returns a CommentService Middleware.

Jump to

Keyboard shortcuts

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