| 
									
										
										
										
											2025-09-01 18:29:59 +08:00
										 |  |  | package article | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							|  |  |  | 	"context" | 
					
						
							|  |  |  | 	"tyapi-server/internal/application/article/dto/commands" | 
					
						
							|  |  |  | 	appQueries "tyapi-server/internal/application/article/dto/queries" | 
					
						
							|  |  |  | 	"tyapi-server/internal/application/article/dto/responses" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // ArticleApplicationService 文章应用服务接口 | 
					
						
							|  |  |  | type ArticleApplicationService interface { | 
					
						
							|  |  |  | 	// 文章管理 | 
					
						
							|  |  |  | 	CreateArticle(ctx context.Context, cmd *commands.CreateArticleCommand) error | 
					
						
							|  |  |  | 	UpdateArticle(ctx context.Context, cmd *commands.UpdateArticleCommand) error | 
					
						
							|  |  |  | 	DeleteArticle(ctx context.Context, cmd *commands.DeleteArticleCommand) error | 
					
						
							|  |  |  | 	GetArticleByID(ctx context.Context, query *appQueries.GetArticleQuery) (*responses.ArticleInfoResponse, error) | 
					
						
							|  |  |  | 	ListArticles(ctx context.Context, query *appQueries.ListArticleQuery) (*responses.ArticleListResponse, error) | 
					
						
							| 
									
										
										
										
											2025-09-01 21:15:15 +08:00
										 |  |  | 	ListArticlesForAdmin(ctx context.Context, query *appQueries.ListArticleQuery) (*responses.ArticleListResponse, error) | 
					
						
							| 
									
										
										
										
											2025-09-02 16:37:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-09-01 18:29:59 +08:00
										 |  |  | 	// 文章状态管理 | 
					
						
							|  |  |  | 	PublishArticle(ctx context.Context, cmd *commands.PublishArticleCommand) error | 
					
						
							|  |  |  | 	PublishArticleByID(ctx context.Context, articleID string) error | 
					
						
							|  |  |  | 	SchedulePublishArticle(ctx context.Context, cmd *commands.SchedulePublishCommand) error | 
					
						
							| 
									
										
										
										
											2025-09-03 13:51:52 +08:00
										 |  |  | 	UpdateSchedulePublishArticle(ctx context.Context, cmd *commands.SchedulePublishCommand) error | 
					
						
							| 
									
										
										
										
											2025-09-02 16:37:28 +08:00
										 |  |  | 	CancelSchedulePublishArticle(ctx context.Context, cmd *commands.CancelScheduleCommand) error | 
					
						
							| 
									
										
										
										
											2025-09-01 18:29:59 +08:00
										 |  |  | 	ArchiveArticle(ctx context.Context, cmd *commands.ArchiveArticleCommand) error | 
					
						
							|  |  |  | 	SetFeatured(ctx context.Context, cmd *commands.SetFeaturedCommand) error | 
					
						
							| 
									
										
										
										
											2025-09-02 16:37:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-09-01 18:29:59 +08:00
										 |  |  | 	// 文章交互 | 
					
						
							|  |  |  | 	RecordView(ctx context.Context, articleID string, userID string, ipAddress string, userAgent string) error | 
					
						
							| 
									
										
										
										
											2025-09-02 16:37:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-09-01 18:29:59 +08:00
										 |  |  | 	// 统计信息 | 
					
						
							|  |  |  | 	GetArticleStats(ctx context.Context) (*responses.ArticleStatsResponse, error) | 
					
						
							| 
									
										
										
										
											2025-09-02 16:37:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-09-01 18:29:59 +08:00
										 |  |  | 	// 分类管理 | 
					
						
							|  |  |  | 	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 *appQueries.GetCategoryQuery) (*responses.CategoryInfoResponse, error) | 
					
						
							|  |  |  | 	ListCategories(ctx context.Context) (*responses.CategoryListResponse, error) | 
					
						
							| 
									
										
										
										
											2025-09-02 16:37:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-09-01 18:29:59 +08:00
										 |  |  | 	// 标签管理 | 
					
						
							|  |  |  | 	CreateTag(ctx context.Context, cmd *commands.CreateTagCommand) error | 
					
						
							|  |  |  | 	UpdateTag(ctx context.Context, cmd *commands.UpdateTagCommand) error | 
					
						
							|  |  |  | 	DeleteTag(ctx context.Context, cmd *commands.DeleteTagCommand) error | 
					
						
							|  |  |  | 	GetTagByID(ctx context.Context, query *appQueries.GetTagQuery) (*responses.TagInfoResponse, error) | 
					
						
							|  |  |  | 	ListTags(ctx context.Context) (*responses.TagListResponse, error) | 
					
						
							|  |  |  | } |