This commit is contained in:
2025-07-20 20:53:26 +08:00
parent 83bf9aea7d
commit 8ad1d7288e
158 changed files with 18156 additions and 13188 deletions

View File

@@ -13,19 +13,11 @@ type ProductApplicationService interface {
CreateProduct(ctx context.Context, cmd *commands.CreateProductCommand) error
UpdateProduct(ctx context.Context, cmd *commands.UpdateProductCommand) error
DeleteProduct(ctx context.Context, cmd *commands.DeleteProductCommand) error
GetProductByID(ctx context.Context, query *queries.GetProductQuery) (*responses.ProductInfoResponse, error)
ListProducts(ctx context.Context, query *queries.ListProductsQuery) (*responses.ProductListResponse, error)
GetProductsByIDs(ctx context.Context, query *queries.GetProductsByIDsQuery) ([]*responses.ProductInfoResponse, error)
// 产品状态管理
EnableProduct(ctx context.Context, cmd *commands.EnableProductCommand) error
DisableProduct(ctx context.Context, cmd *commands.DisableProductCommand) error
ShowProduct(ctx context.Context, cmd *commands.ShowProductCommand) error
HideProduct(ctx context.Context, cmd *commands.HideProductCommand) error
// SEO管理
UpdateProductSEO(ctx context.Context, cmd *commands.UpdateProductSEOCommand) error
// 业务查询
GetSubscribableProducts(ctx context.Context, query *queries.GetSubscribableProductsQuery) ([]*responses.ProductInfoResponse, error)
GetProductStats(ctx context.Context) (*responses.ProductStatsResponse, error)
@@ -37,42 +29,26 @@ type CategoryApplicationService interface {
CreateCategory(ctx context.Context, cmd *commands.CreateCategoryCommand) error
UpdateCategory(ctx context.Context, cmd *commands.UpdateCategoryCommand) error
DeleteCategory(ctx context.Context, cmd *commands.DeleteCategoryCommand) error
GetCategoryByID(ctx context.Context, query *queries.GetCategoryQuery) (*responses.CategoryInfoResponse, error)
ListCategories(ctx context.Context, query *queries.ListCategoriesQuery) (*responses.CategoryListResponse, error)
// 分类状态管理
EnableCategory(ctx context.Context, cmd *commands.EnableCategoryCommand) error
DisableCategory(ctx context.Context, cmd *commands.DisableCategoryCommand) error
ShowCategory(ctx context.Context, cmd *commands.ShowCategoryCommand) error
HideCategory(ctx context.Context, cmd *commands.HideCategoryCommand) error
// 分类结构管理
MoveCategory(ctx context.Context, cmd *commands.MoveCategoryCommand) error
GetCategoryTree(ctx context.Context, query *queries.GetCategoryTreeQuery) (*responses.CategoryTreeResponse, error)
GetCategoriesByLevel(ctx context.Context, query *queries.GetCategoriesByLevelQuery) ([]*responses.CategoryInfoResponse, error)
GetCategoryPath(ctx context.Context, query *queries.GetCategoryPathQuery) (*responses.CategoryPathResponse, error)
// 统计
GetCategoryStats(ctx context.Context) (*responses.CategoryStatsResponse, error)
}
// SubscriptionApplicationService 订阅应用服务接口
type SubscriptionApplicationService interface {
// 订阅管理
UpdateSubscriptionPrice(ctx context.Context, cmd *commands.UpdateSubscriptionPriceCommand) error
// 订阅管理
CreateSubscription(ctx context.Context, cmd *commands.CreateSubscriptionCommand) error
UpdateSubscription(ctx context.Context, cmd *commands.UpdateSubscriptionCommand) error
GetSubscriptionByID(ctx context.Context, query *queries.GetSubscriptionQuery) (*responses.SubscriptionInfoResponse, error)
ListSubscriptions(ctx context.Context, query *queries.ListSubscriptionsQuery) (*responses.SubscriptionListResponse, error)
// API使用管理
UpdateAPIUsage(ctx context.Context, cmd *commands.UpdateAPIUsageCommand) error
ResetAPIUsage(ctx context.Context, cmd *commands.ResetAPIUsageCommand) error
// 业务查询
GetUserSubscriptions(ctx context.Context, query *queries.GetUserSubscriptionsQuery) ([]*responses.SubscriptionInfoResponse, error)
GetProductSubscriptions(ctx context.Context, query *queries.GetProductSubscriptionsQuery) ([]*responses.SubscriptionInfoResponse, error)
GetSubscriptionUsage(ctx context.Context, subscriptionID string) (*responses.SubscriptionUsageResponse, error)
// 统计
GetSubscriptionStats(ctx context.Context) (*responses.SubscriptionStatsResponse, error)
}
}