Documentation ¶
Index ¶
- Variables
- type AuthService
- type BlogService
- func (s BlogService) Create(user *models.User, postReq *dto.BlogPostCreateRequest) (*dto.BlogPostCreateResponse, error)
- func (s BlogService) Delete(postID uint) error
- func (s BlogService) Get(postID uint) (*dto.BlogPost, error)
- func (s BlogService) Query(params *dto.BlogPostQueryParams) (any, error)
- func (s BlogService) QueryByFollowing(user *models.User, params *dto.BlogPostQueryParams) (*dto.BlogPostPagination, error)
- func (s BlogService) Update(userID *models.User, postID uint, postReq *dto.BlogPostUpdateRequest) (*dto.BlogPostUpdateResponse, error)
- type CommentService
- func (s CommentService) Create(user *models.User, commentReq *dto.CommentCreateRequest) (*dto.CommentCreateResponse, error)
- func (s CommentService) Delete(commentID uint) error
- func (s CommentService) Get(commentID uint) (*dto.Comment, error)
- func (s CommentService) Query(params *dto.CommentQueryParams) (any, error)
- func (s CommentService) Update(userID *models.User, commentID uint, commentReq *dto.CommentUpdateRequest) (*dto.CommentUpdateResponse, error)
- type UserService
- func (s UserService) Follow(user *models.User, followReq *dto.FollowerCreateRequest) error
- func (s UserService) Get(id uint) (*dto.User, error)
- func (s UserService) MeUpdate(user *models.User, meReq *dto.MeUpdateRequest) error
- func (s UserService) MeUpdatePassword(user *models.User, passwordReq *dto.MePasswordRequest) error
- func (s UserService) Query(params *dto.UserQueryParams) (any, error)
- func (s UserService) UnFollow(user *models.User, followReq *dto.UnFollowerCreateRequest) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module( "services", fx.Provide(NewAuthService), fx.Provide(NewUserService), fx.Provide(NewBlogService), fx.Provide(NewCommentService), )
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 (s BlogService) Create(user *models.User, postReq *dto.BlogPostCreateRequest) (*dto.BlogPostCreateResponse, error)
func (BlogService) Delete ¶
func (s BlogService) Delete(postID uint) 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 (s CommentService) Create(user *models.User, commentReq *dto.CommentCreateRequest) (*dto.CommentCreateResponse, error)
func (CommentService) Delete ¶
func (s CommentService) Delete(commentID uint) 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) 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
Click to show internal directories.
Click to hide internal directories.