feat: add generation_mode to RecentArticle and related components
- Updated RecentArticle interface to include generation_mode. - Modified workspace_service to map generation_mode from database. - Adjusted domain model for RecentArticle to accommodate generation_mode. - Enhanced SQL queries to retrieve generation_mode from generation_tasks. - Created ArticleActionGroup component for article action buttons. - Implemented ArticleGenerateStatus component to display generation status. - Developed ArticlePublishStatus component to show publish status and related platforms. - Introduced ArticleSourceMeta component to display article source information. - Added utility functions for article actions and clipboard content generation.
This commit is contained in:
@@ -13,10 +13,21 @@ WHERE tenant_id = sqlc.arg(tenant_id) AND deleted_at IS NULL;
|
||||
-- name: GetRecentArticles :many
|
||||
SELECT a.id, a.generate_status, a.publish_status, a.source_type, a.created_at,
|
||||
av.title, av.markdown_content, av.word_count, av.source_label,
|
||||
t.template_name
|
||||
t.template_name,
|
||||
COALESCE(
|
||||
NULLIF(gt.input_params_json ->> 'generation_mode', ''),
|
||||
CASE WHEN a.source_type = 'custom_generation' THEN 'instant' ELSE NULL END
|
||||
) AS generation_mode
|
||||
FROM articles a
|
||||
LEFT JOIN article_versions av ON av.id = a.current_version_id
|
||||
LEFT JOIN article_templates t ON t.id = a.template_id
|
||||
LEFT JOIN LATERAL (
|
||||
SELECT input_params_json
|
||||
FROM generation_tasks
|
||||
WHERE article_id = a.id
|
||||
ORDER BY created_at DESC
|
||||
LIMIT 1
|
||||
) gt ON true
|
||||
WHERE a.tenant_id = sqlc.arg(tenant_id) AND a.deleted_at IS NULL
|
||||
ORDER BY a.created_at DESC
|
||||
LIMIT 10;
|
||||
|
||||
Reference in New Issue
Block a user