service

package
v0.0.0-...-d6508de Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthService

func NewAuthService(authRepo repository.AuthRepo) *authService

func NewCategoryService

func NewCategoryService(categoryRepo repository.CategoryRepo) *categoryService

func NewCommentService

func NewCommentService(commentRepo repository.CommentRepo) *commentService

func NewJwtService

func NewJwtService() *jwtService

func NewPostService

func NewPostService(postRepo repository.PostRepo) *postService

Types

type AuthService

type AuthService interface {
	Register(userDto dto.User) (*gorm.DB, model.User)
	VerifyCredential(email string, passsword string) (bool, uint64)
}

type CategoryService

type CategoryService interface {
	All() []model.Category
	Insert(categoryDto dto.Category) model.Category
	Update(categoryId uint64, categoryDto dto.Category) (model.Category, error)
	DeleteById(categoryId uint64) *gorm.DB
}

type CommentService

type CommentService interface {
	All(limit string, offset string, postId uint) []model.Comment
	Insert(commentDto dto.Comment, postId, userId uint) model.Comment
}

type JwtService

type JwtService interface {
	GenerateTokenPair(userId interface{}) map[string]string
}

type PostService

type PostService interface {
	All(limit string, offset string) (int64, []model.Post)
	FindById(postId uint64) (model.Post, error)
	Insert(postDto dto.Post) model.Post
	Update(postId uint64, postDto dto.Post) (model.Post, error)
	DeleteById(postId uint64) *gorm.DB
}

Jump to

Keyboard shortcuts

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