services

package
v0.0.0-...-042b7a9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AuthService

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

func NewAuthService

func NewAuthService(userRepository repositories.UserRepository, jwt lib.JWT, authMail mails.AuthMail) AuthService

func (AuthService) AuthorizeJWTToken

func (a AuthService) AuthorizeJWTToken(token string) (*models.User, error)

func (AuthService) Login

func (a AuthService) Login(loginReq *dto.LoginRequest) (*dto.LoginResponse, error)

func (AuthService) Register

func (a AuthService) Register(registerReq *dto.RegisterRequest) (*dto.RegisterResponse, error)

type BlogService

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

func NewBlogService

func NewBlogService(blogPostRepository repositories.BlogPostRepository) BlogService

func (BlogService) Create

func (BlogService) Delete

func (s BlogService) Delete(postID uint) error

func (BlogService) Get

func (s BlogService) Get(postID uint) (*dto.BlogPost, error)

func (BlogService) Query

func (s BlogService) Query(params *dto.BlogPostQueryParams) (any, error)

func (BlogService) QueryByFollowing

func (s BlogService) QueryByFollowing(user *models.User, params *dto.BlogPostQueryParams) (*dto.BlogPostPagination, error)

func (BlogService) Update

func (s BlogService) Update(userID *models.User, postID uint, postReq *dto.BlogPostUpdateRequest) (*dto.BlogPostUpdateResponse, error)

type CommentService

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

func NewCommentService

func NewCommentService(commentRepository repositories.CommentRepository) CommentService

func (CommentService) Create

func (CommentService) Delete

func (s CommentService) Delete(commentID uint) error

func (CommentService) Get

func (s CommentService) Get(commentID uint) (*dto.Comment, error)

func (CommentService) Query

func (s CommentService) Query(params *dto.CommentQueryParams) (any, error)

func (CommentService) Update

func (s CommentService) Update(userID *models.User, commentID uint, commentReq *dto.CommentUpdateRequest) (*dto.CommentUpdateResponse, error)

type UserService

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

func NewUserService

func NewUserService(userRepository repositories.UserRepository, followerRepository repositories.FollowerRepository) UserService

func (UserService) Follow

func (s UserService) Follow(user *models.User, followReq *dto.FollowerCreateRequest) error

func (UserService) Get

func (s UserService) Get(id uint) (*dto.User, error)

func (UserService) MeUpdate

func (s UserService) MeUpdate(user *models.User, meReq *dto.MeUpdateRequest) error

func (UserService) MeUpdatePassword

func (s UserService) MeUpdatePassword(user *models.User, passwordReq *dto.MePasswordRequest) error

func (UserService) Query

func (s UserService) Query(params *dto.UserQueryParams) (any, error)

func (UserService) UnFollow

func (s UserService) UnFollow(user *models.User, followReq *dto.UnFollowerCreateRequest) error

Jump to

Keyboard shortcuts

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