49 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			49 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
|  | package queries | ||
|  | 
 | ||
|  | import "tyapi-server/internal/domains/article/entities" | ||
|  | 
 | ||
|  | // ListArticleQuery 文章列表查询 | ||
|  | type ListArticleQuery struct { | ||
|  | 	Page       int                    `json:"page"` | ||
|  | 	PageSize   int                    `json:"page_size"` | ||
|  | 	Status     entities.ArticleStatus `json:"status"` | ||
|  | 	CategoryID string                 `json:"category_id"` | ||
|  | 	TagID      string                 `json:"tag_id"` | ||
|  | 	Title      string                 `json:"title"` | ||
|  | 	Summary    string                 `json:"summary"` | ||
|  | 	IsFeatured *bool                  `json:"is_featured"` | ||
|  | 	OrderBy    string                 `json:"order_by"` | ||
|  | 	OrderDir   string                 `json:"order_dir"` | ||
|  | } | ||
|  | 
 | ||
|  | // SearchArticleQuery 文章搜索查询 | ||
|  | type SearchArticleQuery struct { | ||
|  | 	Page       int    `json:"page"` | ||
|  | 	PageSize   int    `json:"page_size"` | ||
|  | 	Keyword    string `json:"keyword"` | ||
|  | 	CategoryID string `json:"category_id"` | ||
|  | 	AuthorID   string `json:"author_id"` | ||
|  | 	Status     entities.ArticleStatus `json:"status"` | ||
|  | 	OrderBy    string `json:"order_by"` | ||
|  | 	OrderDir   string `json:"order_dir"` | ||
|  | } | ||
|  | 
 | ||
|  | // GetArticleQuery 获取文章详情查询 | ||
|  | type GetArticleQuery struct { | ||
|  | 	ID string `json:"id"` | ||
|  | } | ||
|  | 
 | ||
|  | // GetArticlesByAuthorQuery 获取作者文章查询 | ||
|  | type GetArticlesByAuthorQuery struct { | ||
|  | 	AuthorID string `json:"author_id"` | ||
|  | 	Page     int    `json:"page"` | ||
|  | 	PageSize int    `json:"page_size"` | ||
|  | } | ||
|  | 
 | ||
|  | // GetArticlesByCategoryQuery 获取分类文章查询 | ||
|  | type GetArticlesByCategoryQuery struct { | ||
|  | 	CategoryID string `json:"category_id"` | ||
|  | 	Page       int    `json:"page"` | ||
|  | 	PageSize   int    `json:"page_size"` | ||
|  | } |