Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService interface {
Login(req *models.LoginRequest) (*models.LoginResponse, error)
ValidateToken(token string) (*auth.Claims, error)
}
AuthService 认证服务接口
func NewAuthService ¶
func NewAuthService(userRepo repository.UserRepository, jwtManager *auth.JWTManager, logger logger.Logger) AuthService
NewAuthService 创建认证服务
type ProductService ¶
type ProductService interface {
CreateProduct(req *models.CreateProductRequest) (*models.Product, error)
GetProduct(id uint) (*models.Product, error)
UpdateProduct(id uint, req *models.UpdateProductRequest) (*models.Product, error)
DeleteProduct(id uint) error
ListProducts(query *models.ProductQuery) (*models.ProductListResponse, error)
}
ProductService 产品服务接口
func NewProductService ¶
func NewProductService(repo repository.ProductRepository, cache *cache.RedisClient, logger logger.Logger) ProductService
NewProductService 创建产品服务
type UserService ¶
type UserService interface {
CreateUser(req *models.CreateUserRequest) (*models.User, error)
GetUser(id uint) (*models.User, error)
UpdateUser(id uint, req *models.UpdateUserRequest) (*models.User, error)
DeleteUser(id uint) error
ListUsers(page, limit int) ([]*models.User, int64, error)
}
UserService 用户服务接口
func NewUserService ¶
func NewUserService(repo repository.UserRepository, cache *cache.RedisClient, logger logger.Logger) UserService
NewUserService 创建用户服务
Click to show internal directories.
Click to hide internal directories.