Documentation ¶
Index ¶
- type CategoryService
- func (c *CategoryService) AllCategories() (*[]models.Category, error)
- func (c *CategoryService) CategoryByPK(pk string) (*models.Category, bool)
- func (c *CategoryService) CategoryByTitle(title string) (*models.Category, bool)
- func (c *CategoryService) CreateCategory(req *dto.CategoryRequest) (*models.Category, error)
- func (c *CategoryService) DeleteCategory(pk string) error
- func (c *CategoryService) UpdateCategory(pk string, req *dto.CategoryRequest) (*models.Category, error)
- type CommentsService
- func (c *CommentsService) AddLike(pk string, userID int) error
- func (c *CommentsService) CommentByPK(pk string) (*models.Comments, bool)
- func (c *CommentsService) CommentLikeByPKAndUser(pk string, userID int) (*models.CommentLikes, bool)
- func (c *CommentsService) CreateComment(req *dto.CommentsRequest, userID int, productSlug string) (*models.Comments, error)
- func (c *CommentsService) DeleteComment(pk string) error
- type OtpService
- type ProductImagesService
- type ProductService
- func (p *ProductService) AllProducts() (*[]models.Products, error)
- func (p *ProductService) CreateProduct(req *dto.ProductRequest, pk string) (*models.Products, error)
- func (p *ProductService) DeleteProduct(pk string) error
- func (p *ProductService) ProductByName(name string) (*models.Products, bool)
- func (p *ProductService) ProductByPK(pk string) (*models.Products, bool)
- func (p *ProductService) UpdateProduct(pk string, req *dto.ProductRequest) (*models.Products, error)
- type TagService
- func (t *TagService) CreateTag(req *dto.TagRequest) (*models.Tags, error)
- func (t *TagService) DeleteTag(pk string) error
- func (t *TagService) GetAllTags() (*[]models.Tags, error)
- func (t *TagService) GetTagByName(name string) (*models.Tags, bool)
- func (t *TagService) GetTagByPK(pk string) (*models.Tags, bool)
- func (t *TagService) UpdateTag(pk string, req *dto.TagRequest) (*models.Tags, error)
- type TokenService
- func (t *TokenService) GenerateAccessToken(userID string, phone string) (string, error)
- func (t *TokenService) GenerateRefreshToken(userID string) (string, error)
- func (t *TokenService) GetClaims(token string) (map[string]any, error)
- func (t *TokenService) VerifyToken(token string) (*jwt.Token, error)
- type UserService
- func (s *UserService) ActivateUser(r *http.Request) error
- func (s *UserService) GetUserByID(id string) (*models.Users, bool)
- func (s *UserService) GetUserByIP(r *http.Request) (*models.Users, error)
- func (s *UserService) GetUserByPhone(phone string) (*models.Users, bool)
- func (s *UserService) RegisterLoginByPhone(req *dto.RegisterLoginRequest) error
- func (s *UserService) UpdateUserByID(id string, data *dto.UpdateUserRequest) (*models.Users, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
func NewCategoryService ¶
func NewCategoryService(logs *common.Logger) *CategoryService
func (*CategoryService) AllCategories ¶
func (c *CategoryService) AllCategories() (*[]models.Category, error)
func (*CategoryService) CategoryByPK ¶
func (c *CategoryService) CategoryByPK(pk string) (*models.Category, bool)
func (*CategoryService) CategoryByTitle ¶
func (c *CategoryService) CategoryByTitle(title string) (*models.Category, bool)
func (*CategoryService) CreateCategory ¶
func (c *CategoryService) CreateCategory(req *dto.CategoryRequest) (*models.Category, error)
func (*CategoryService) DeleteCategory ¶
func (c *CategoryService) DeleteCategory(pk string) error
func (*CategoryService) UpdateCategory ¶
func (c *CategoryService) UpdateCategory(pk string, req *dto.CategoryRequest) (*models.Category, error)
type CommentsService ¶
type CommentsService struct {
// contains filtered or unexported fields
}
func NewCommentsService ¶
func NewCommentsService(logs *common.Logger) *CommentsService
func (*CommentsService) CommentByPK ¶
func (c *CommentsService) CommentByPK(pk string) (*models.Comments, bool)
func (*CommentsService) CommentLikeByPKAndUser ¶
func (c *CommentsService) CommentLikeByPKAndUser(pk string, userID int) (*models.CommentLikes, bool)
func (*CommentsService) CreateComment ¶
func (c *CommentsService) CreateComment(req *dto.CommentsRequest, userID int, productSlug string) (*models.Comments, error)
func (*CommentsService) DeleteComment ¶
func (c *CommentsService) DeleteComment(pk string) error
type OtpService ¶
type OtpService struct {
// contains filtered or unexported fields
}
func NewOTPService ¶
func NewOTPService(logs *common.Logger) *OtpService
func (*OtpService) IsOtpEqual ¶
func (o *OtpService) IsOtpEqual(code string, r *http.Request) bool
func (*OtpService) IsOtpExpire ¶
func (o *OtpService) IsOtpExpire(r *http.Request) bool
type ProductImagesService ¶
type ProductImagesService struct {
// contains filtered or unexported fields
}
func NewProductImagesService ¶
func NewProductImagesService(logs *common.Logger) *ProductImagesService
func (*ProductImagesService) CreateProductImages ¶
func (p *ProductImagesService) CreateProductImages(req *dto.MediaRequest, param string, ctx *gin.Context) error
func (*ProductImagesService) GetFileURL ¶
func (*ProductImagesService) ProductByPK ¶
func (p *ProductImagesService) ProductByPK(pk string) (*models.Products, bool)
type ProductService ¶
type ProductService struct {
// contains filtered or unexported fields
}
func NewProductService ¶
func NewProductService(logs *common.Logger) *ProductService
func (*ProductService) AllProducts ¶
func (p *ProductService) AllProducts() (*[]models.Products, error)
func (*ProductService) CreateProduct ¶
func (p *ProductService) CreateProduct(req *dto.ProductRequest, pk string) (*models.Products, error)
func (*ProductService) DeleteProduct ¶
func (p *ProductService) DeleteProduct(pk string) error
func (*ProductService) ProductByName ¶
func (p *ProductService) ProductByName(name string) (*models.Products, bool)
func (*ProductService) ProductByPK ¶
func (p *ProductService) ProductByPK(pk string) (*models.Products, bool)
func (*ProductService) UpdateProduct ¶
func (p *ProductService) UpdateProduct(pk string, req *dto.ProductRequest) (*models.Products, error)
type TagService ¶
type TagService struct {
// contains filtered or unexported fields
}
func NewTagService ¶
func NewTagService(logs *common.Logger) *TagService
func (*TagService) CreateTag ¶
func (t *TagService) CreateTag(req *dto.TagRequest) (*models.Tags, error)
func (*TagService) DeleteTag ¶
func (t *TagService) DeleteTag(pk string) error
func (*TagService) GetAllTags ¶
func (t *TagService) GetAllTags() (*[]models.Tags, error)
func (*TagService) GetTagByName ¶
func (t *TagService) GetTagByName(name string) (*models.Tags, bool)
func (*TagService) GetTagByPK ¶
func (t *TagService) GetTagByPK(pk string) (*models.Tags, bool)
func (*TagService) UpdateTag ¶
func (t *TagService) UpdateTag(pk string, req *dto.TagRequest) (*models.Tags, error)
type TokenService ¶
type TokenService struct {
// contains filtered or unexported fields
}
func NewTokenService ¶
func NewTokenService(logs *common.Logger) *TokenService
func (*TokenService) GenerateAccessToken ¶
func (t *TokenService) GenerateAccessToken(userID string, phone string) (string, error)
func (*TokenService) GenerateRefreshToken ¶
func (t *TokenService) GenerateRefreshToken(userID string) (string, error)
func (*TokenService) GetClaims ¶
func (t *TokenService) GetClaims(token string) (map[string]any, error)
func (*TokenService) VerifyToken ¶
func (t *TokenService) VerifyToken(token string) (*jwt.Token, error)
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(logs *common.Logger) *UserService
func (*UserService) ActivateUser ¶
func (s *UserService) ActivateUser(r *http.Request) error
func (*UserService) GetUserByID ¶
func (s *UserService) GetUserByID(id string) (*models.Users, bool)
func (*UserService) GetUserByIP ¶
func (*UserService) GetUserByPhone ¶
func (s *UserService) GetUserByPhone(phone string) (*models.Users, bool)
func (*UserService) RegisterLoginByPhone ¶
func (s *UserService) RegisterLoginByPhone(req *dto.RegisterLoginRequest) error
func (*UserService) UpdateUserByID ¶
func (s *UserService) UpdateUserByID(id string, data *dto.UpdateUserRequest) (*models.Users, error)
Click to show internal directories.
Click to hide internal directories.