合并 master 更新到 AI 游戏创作分支
合入 master 的画布 Agent、精选素材审核、外部编辑器 API 与认证投影更新 保留当前分支的 AI 游戏创作壳、配置项和 LLM 运行接口改造 解决图片编辑器、LLM、去背景完成、外部生成排序和文档冲突 沿用 master 的 SpacetimeDB auth_store_projection 迁移与生成绑定
This commit is contained in:
@@ -6,11 +6,14 @@ use axum::{
|
||||
use crate::{
|
||||
admin::{
|
||||
admin_dashboard, admin_debug_http, admin_get_creation_entry_config,
|
||||
admin_get_editor_generation_pricing, admin_list_database_table_rows,
|
||||
admin_list_database_tables, admin_list_tracking_event_keys, admin_list_tracking_events,
|
||||
admin_list_work_visibility, admin_login, admin_me, admin_overview,
|
||||
admin_update_work_visibility, admin_upsert_creation_entry_config,
|
||||
admin_upsert_creation_entry_event_banners_config, admin_upsert_editor_generation_pricing,
|
||||
admin_get_editor_generation_pricing, admin_get_editor_showcase_campaign,
|
||||
admin_list_database_table_rows, admin_list_database_tables, admin_list_editor_assets,
|
||||
admin_list_editor_showcase_assets, admin_list_tracking_event_keys,
|
||||
admin_list_tracking_events, admin_list_work_visibility, admin_login, admin_me,
|
||||
admin_overview, admin_review_editor_showcase_asset,
|
||||
admin_update_editor_showcase_asset_display, admin_update_work_visibility,
|
||||
admin_upsert_creation_entry_config, admin_upsert_creation_entry_event_banners_config,
|
||||
admin_upsert_editor_generation_pricing, admin_upsert_editor_showcase_campaign,
|
||||
admin_upsert_public_work_interaction_config, require_admin_auth,
|
||||
},
|
||||
runtime_profile::{
|
||||
@@ -113,6 +116,42 @@ pub fn router(state: AppState) -> Router<AppState> {
|
||||
require_admin_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/admin/api/editor-assets",
|
||||
get(admin_list_editor_assets).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_admin_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/admin/api/editor-showcase/assets",
|
||||
get(admin_list_editor_showcase_assets).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_admin_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/admin/api/editor-showcase/assets/review",
|
||||
post(admin_review_editor_showcase_asset).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_admin_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/admin/api/editor-showcase/assets/display",
|
||||
post(admin_update_editor_showcase_asset_display).route_layer(
|
||||
middleware::from_fn_with_state(state.clone(), require_admin_auth),
|
||||
),
|
||||
)
|
||||
.route(
|
||||
"/admin/api/editor-showcase/campaign",
|
||||
get(admin_get_editor_showcase_campaign)
|
||||
.post(admin_upsert_editor_showcase_campaign)
|
||||
.route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_admin_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/admin/api/works/visibility",
|
||||
get(admin_list_work_visibility)
|
||||
|
||||
@@ -7,6 +7,11 @@ use axum::{
|
||||
|
||||
use crate::{
|
||||
auth::require_bearer_auth,
|
||||
editor_agent::{
|
||||
create_editor_agent_conversation, delete_editor_agent_conversation,
|
||||
get_editor_agent_conversation, list_editor_agent_conversations,
|
||||
stream_editor_agent_message,
|
||||
},
|
||||
editor_project::{
|
||||
create_editor_asset, create_editor_asset_folder, create_editor_project,
|
||||
create_editor_project_resource, delete_editor_asset, delete_editor_asset_folder,
|
||||
@@ -15,12 +20,14 @@ use crate::{
|
||||
get_editor_generation_pricing, get_editor_project, list_editor_projects,
|
||||
list_public_editor_project_resources, load_recent_editor_project,
|
||||
remove_editor_image_background, rename_editor_project, save_editor_project_layout,
|
||||
update_editor_asset, update_editor_asset_folder, update_editor_project_resource_showcase,
|
||||
submit_editor_asset_showcase, toggle_editor_showcase_asset_like, update_editor_asset,
|
||||
update_editor_asset_folder, update_editor_project_resource_showcase,
|
||||
},
|
||||
state::AppState,
|
||||
};
|
||||
|
||||
const EDITOR_IMAGE_REFERENCE_BODY_LIMIT_BYTES: usize = 12 * 1024 * 1024;
|
||||
const EDITOR_AGENT_MESSAGE_BODY_LIMIT_BYTES: usize = 2 * 1024 * 1024;
|
||||
|
||||
pub fn router(state: AppState) -> Router<AppState> {
|
||||
Router::new()
|
||||
@@ -72,6 +79,33 @@ pub fn router(state: AppState) -> Router<AppState> {
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/editor/projects/{project_id}/agent-conversations",
|
||||
get(list_editor_agent_conversations)
|
||||
.post(create_editor_agent_conversation)
|
||||
.route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/editor/agent-conversations/{conversation_id}",
|
||||
get(get_editor_agent_conversation)
|
||||
.delete(delete_editor_agent_conversation)
|
||||
.route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/editor/agent-conversations/{conversation_id}/messages/stream",
|
||||
post(stream_editor_agent_message)
|
||||
.layer(DefaultBodyLimit::max(EDITOR_AGENT_MESSAGE_BODY_LIMIT_BYTES))
|
||||
.route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/editor/project-resources/{resource_id}/showcase",
|
||||
patch(update_editor_project_resource_showcase).route_layer(
|
||||
@@ -117,6 +151,20 @@ pub fn router(state: AppState) -> Router<AppState> {
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/editor/assets/{asset_id}/showcase-submissions",
|
||||
post(submit_editor_asset_showcase).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/editor/showcase/assets/{showcase_id}/likes",
|
||||
post(toggle_editor_showcase_asset_like).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/editor/images/generations",
|
||||
post(generate_editor_image)
|
||||
|
||||
Reference in New Issue
Block a user