{ "openapi": "3.1.0", "info": { "title": "NeoZQYY API", "description": "台球门店运营助手 — 后端 API(管理后台 + 微信小程序)", "version": "0.1.0" }, "paths": { "/api/auth/login": { "post": { "tags": [ "认证" ], "summary": "Login", "description": "用户登录。\n\n查询 admin_users 表验证用户名密码,成功后返回 JWT 令牌对。\n- 用户不存在或密码错误:401\n- 账号已禁用(is_active=false):401", "operationId": "login_api_auth_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/auth/refresh": { "post": { "tags": [ "认证" ], "summary": "Refresh", "description": "刷新访问令牌。\n\n验证 refresh_token 有效性,成功后仅返回新的 access_token\n(refresh_token 保持不变,由客户端继续持有)。", "operationId": "refresh_api_auth_refresh_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tasks/registry": { "get": { "tags": [ "任务配置" ], "summary": "Get Task Registry", "description": "返回按业务域分组的任务列表", "operationId": "get_task_registry_api_tasks_registry_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskRegistryResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/tasks/dwd-tables": { "get": { "tags": [ "任务配置" ], "summary": "Get Dwd Tables", "description": "返回按业务域分组的 DWD 表定义", "operationId": "get_dwd_tables_api_tasks_dwd_tables_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DwdTablesResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/tasks/flows": { "get": { "tags": [ "任务配置" ], "summary": "Get Flows", "description": "返回 7 种 Flow 定义和 4 种处理模式定义", "operationId": "get_flows_api_tasks_flows_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FlowsResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/tasks/validate": { "post": { "tags": [ "任务配置" ], "summary": "Validate Task Config", "description": "验证 TaskConfig 并返回生成的 CLI 命令预览\n\n从 JWT 注入 store_id,前端无需传递。", "operationId": "validate_task_config_api_tasks_validate_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/tasks/sync-check": { "get": { "tags": [ "任务配置" ], "summary": "Sync Check", "description": "对比后端硬编码任务列表与 ETL 真实注册表,返回差异。\n\n通过子进程调用 ETL CLI 获取真实任务列表,避免直接导入 ETL 代码。", "operationId": "sync_check_api_tasks_sync_check_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SyncCheckResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/execution/run": { "post": { "tags": [ "任务执行" ], "summary": "Run Task", "description": "直接执行任务(不经过队列)。\n\n从 JWT 注入 store_id,创建 execution_id 后异步启动子进程。", "operationId": "run_task_api_execution_run_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskConfigSchema" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExecutionRunResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/execution/queue": { "get": { "tags": [ "任务执行" ], "summary": "Get Queue", "description": "获取当前门店的待执行队列。", "operationId": "get_queue_api_execution_queue_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/QueueTaskResponse" }, "type": "array", "title": "Response Get Queue Api Execution Queue Get" } } } } }, "security": [ { "HTTPBearer": [] } ] }, "post": { "tags": [ "任务执行" ], "summary": "Enqueue Task", "description": "将任务配置添加到执行队列。", "operationId": "enqueue_task_api_execution_queue_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskConfigSchema" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueueTaskResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/execution/queue/reorder": { "put": { "tags": [ "任务执行" ], "summary": "Reorder Queue", "description": "调整队列中任务的执行顺序。", "operationId": "reorder_queue_api_execution_queue_reorder_put", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReorderRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Reorder Queue Api Execution Queue Reorder Put" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/execution/queue/{task_id}": { "delete": { "tags": [ "任务执行" ], "summary": "Delete Queue Task", "description": "从队列中删除待执行任务。仅允许删除 pending 状态的任务。", "operationId": "delete_queue_task_api_execution_queue__task_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Delete Queue Task Api Execution Queue Task Id Delete" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/execution/{execution_id}/cancel": { "post": { "tags": [ "任务执行" ], "summary": "Cancel Execution", "description": "取消正在执行的任务。", "operationId": "cancel_execution_api_execution__execution_id__cancel_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "execution_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Execution Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Cancel Execution Api Execution Execution Id Cancel Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/execution/{execution_id}/rerun": { "post": { "tags": [ "任务执行" ], "summary": "Rerun Execution", "description": "根据历史执行记录重新执行相同的任务。\n\n优先从 config JSONB 列还原完整配置;若旧记录无 config 列,\n回退到 task_codes + 默认配置。", "operationId": "rerun_execution_api_execution__execution_id__rerun_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "execution_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Execution Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExecutionRunResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/execution/history": { "get": { "tags": [ "任务执行" ], "summary": "Get Execution History", "description": "获取执行历史记录,按 started_at 降序排列。", "operationId": "get_execution_history_api_execution_history_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ExecutionHistoryItem" }, "title": "Response Get Execution History Api Execution History Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/execution/{execution_id}/logs": { "get": { "tags": [ "任务执行" ], "summary": "Get Execution Logs", "description": "获取指定执行的完整日志。\n\n优先从内存缓冲区读取(执行中),否则从数据库读取(已完成)。", "operationId": "get_execution_logs_api_execution__execution_id__logs_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "execution_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Execution Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExecutionLogsResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/schedules": { "get": { "tags": [ "调度管理" ], "summary": "List Schedules", "description": "获取当前门店的所有调度任务。", "operationId": "list_schedules_api_schedules_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/ScheduleResponse" }, "type": "array", "title": "Response List Schedules Api Schedules Get" } } } } }, "security": [ { "HTTPBearer": [] } ] }, "post": { "tags": [ "调度管理" ], "summary": "Create Schedule", "description": "创建调度任务,自动计算 next_run_at。支持 run_immediately 立即入队执行一次。", "operationId": "create_schedule_api_schedules_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateScheduleRequest" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduleResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/schedules/{schedule_id}": { "put": { "tags": [ "调度管理" ], "summary": "Update Schedule", "description": "更新调度任务,仅更新请求中提供的字段。", "operationId": "update_schedule_api_schedules__schedule_id__put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "schedule_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Schedule Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateScheduleRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduleResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "调度管理" ], "summary": "Delete Schedule", "description": "删除调度任务。", "operationId": "delete_schedule_api_schedules__schedule_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "schedule_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Schedule Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Delete Schedule Api Schedules Schedule Id Delete" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/schedules/{schedule_id}/toggle": { "patch": { "tags": [ "调度管理" ], "summary": "Toggle Schedule", "description": "切换调度任务的启用/禁用状态。\n\n禁用时 next_run_at 置 NULL;启用时重新计算 next_run_at。", "operationId": "toggle_schedule_api_schedules__schedule_id__toggle_patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "schedule_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Schedule Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduleResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/schedules/{schedule_id}/run": { "post": { "tags": [ "调度管理" ], "summary": "Run Schedule Now", "description": "手动触发调度任务执行一次,不更新 last_run_at / next_run_at / run_count。\n\n读取调度任务的 task_config,构造 TaskConfigSchema 后入队执行。\nforce=true 时绕过并发和间隔检查,直接入队。", "operationId": "run_schedule_now_api_schedules__schedule_id__run_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "schedule_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Schedule Id" } }, { "name": "force", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Force" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Run Schedule Now Api Schedules Schedule Id Run Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/schedules/{schedule_id}/history": { "get": { "tags": [ "调度管理" ], "summary": "Get Schedule History", "description": "获取调度任务的执行历史记录,按开始时间倒序,支持分页。", "operationId": "get_schedule_history_api_schedules__schedule_id__history_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "schedule_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Schedule Id" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ExecutionHistoryItem" }, "title": "Response Get Schedule History Api Schedules Schedule Id History Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/env-config": { "get": { "tags": [ "环境配置" ], "summary": "Get Env Config", "description": "读取 .env 文件,敏感值以掩码展示。", "operationId": "get_env_config_api_env_config_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EnvConfigResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] }, "put": { "tags": [ "环境配置" ], "summary": "Update Env Config", "description": "验证并写入 .env 文件。\n\n保留原文件中的注释行和空行。对于已有键,更新值;\n对于新键,追加到文件末尾。掩码值(****)的键跳过更新,保留原值。", "operationId": "update_env_config_api_env_config_put", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EnvConfigUpdateRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EnvConfigResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/env-config/export": { "get": { "tags": [ "环境配置" ], "summary": "Export Env Config", "description": "导出去除敏感值的配置文件(作为文件下载)。", "operationId": "export_env_config_api_env_config_export_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/db/schemas": { "get": { "tags": [ "数据库查看器" ], "summary": "List Schemas", "description": "返回 ETL 数据库中的 Schema 列表。", "operationId": "list_schemas_api_db_schemas_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/SchemaInfo" }, "type": "array", "title": "Response List Schemas Api Db Schemas Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/db/schemas/{name}/tables": { "get": { "tags": [ "数据库查看器" ], "summary": "List Tables", "description": "返回指定 Schema 下所有表的名称和行数统计。", "operationId": "list_tables_api_db_schemas__name__tables_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/TableInfo" }, "title": "Response List Tables Api Db Schemas Name Tables Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/db/tables/{schema}/{table}/columns": { "get": { "tags": [ "数据库查看器" ], "summary": "List Columns", "description": "返回指定表的列定义。", "operationId": "list_columns_api_db_tables__schema___table__columns_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "schema", "in": "path", "required": true, "schema": { "type": "string", "title": "Schema" } }, { "name": "table", "in": "path", "required": true, "schema": { "type": "string", "title": "Table" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ColumnInfo" }, "title": "Response List Columns Api Db Tables Schema Table Columns Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/db/query": { "post": { "tags": [ "数据库查看器" ], "summary": "Execute Query", "description": "只读 SQL 执行。\n\n安全措施:\n1. 拦截写操作关键词(INSERT / UPDATE / DELETE / DROP / TRUNCATE)\n2. 限制返回行数上限 1000 行\n3. 设置查询超时 30 秒", "operationId": "execute_query_api_db_query_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueryRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/etl-status/cursors": { "get": { "tags": [ "ETL 状态" ], "summary": "List Cursors", "description": "返回各 ODS 表的最新数据游标。\n\n查询 ETL 数据库中的 meta.etl_cursor 表。\n如果该表不存在,返回空列表而非报错。", "operationId": "list_cursors_api_etl_status_cursors_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/CursorInfo" }, "type": "array", "title": "Response List Cursors Api Etl Status Cursors Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/etl-status/recent-runs": { "get": { "tags": [ "ETL 状态" ], "summary": "List Recent Runs", "description": "返回最近 50 条任务执行记录。\n\n查询 zqyy_app 数据库中的 task_execution_log 表,\n按 site_id 过滤,按 started_at DESC 排序。", "operationId": "list_recent_runs_api_etl_status_recent_runs_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/RecentRun" }, "type": "array", "title": "Response List Recent Runs Api Etl Status Recent Runs Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/xcx-test": { "get": { "tags": [ "小程序MVP" ], "summary": "Get Xcx Test", "description": "读取 test.\"xcx-test\" 表 ti 列第一行。\n\n用于小程序 MVP 全链路验证:小程序 → API → DB → 返回数据。", "operationId": "get_xcx_test_api_xcx_test_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/wx/callback": { "get": { "tags": [ "微信回调" ], "summary": "Verify", "description": "微信服务器验证接口。\n\n配置消息推送时微信会发 GET 请求,验签通过后原样返回 echostr。", "operationId": "verify_api_wx_callback_get", "parameters": [ { "name": "signature", "in": "query", "required": true, "schema": { "type": "string", "title": "Signature" } }, { "name": "timestamp", "in": "query", "required": true, "schema": { "type": "string", "title": "Timestamp" } }, { "name": "nonce", "in": "query", "required": true, "schema": { "type": "string", "title": "Nonce" } }, { "name": "echostr", "in": "query", "required": true, "schema": { "type": "string", "title": "Echostr" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "微信回调" ], "summary": "Receive Message", "description": "接收微信推送的消息/事件。\n\n当前为明文模式,直接解析 JSON 包体。\n后续切安全模式时需增加 AES 解密逻辑。", "operationId": "receive_message_api_wx_callback_post", "parameters": [ { "name": "signature", "in": "query", "required": false, "schema": { "type": "string", "default": "", "title": "Signature" } }, { "name": "timestamp", "in": "query", "required": false, "schema": { "type": "string", "default": "", "title": "Timestamp" } }, { "name": "nonce", "in": "query", "required": false, "schema": { "type": "string", "default": "", "title": "Nonce" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/retention-clue": { "post": { "tags": [ "维客线索" ], "summary": "Submit Retention Clue", "description": "提交维客线索(INSERT)。\n\n同一会员可有多条不同大类的线索。", "operationId": "submit_retention_clue_api_retention_clue_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RetentionClueSubmit" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/retention-clue/{member_id}": { "get": { "tags": [ "维客线索" ], "summary": "Get Retention Clues", "description": "查询某会员的全部维客线索,按录入时间倒序。", "operationId": "get_retention_clues_api_retention_clue__member_id__get", "parameters": [ { "name": "member_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Member Id" } }, { "name": "site_id", "in": "query", "required": true, "schema": { "type": "integer", "title": "Site Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/RetentionClueOut" }, "title": "Response Get Retention Clues Api Retention Clue Member Id Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/retention-clue/{clue_id}": { "delete": { "tags": [ "维客线索" ], "summary": "Delete Retention Clue", "description": "删除单条维客线索。", "operationId": "delete_retention_clue_api_retention_clue__clue_id__delete", "parameters": [ { "name": "clue_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Clue Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/ops/system": { "get": { "tags": [ "运维面板" ], "summary": "Get System Info", "description": "获取服务器系统资源概况。", "operationId": "get_system_info_api_ops_system_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SystemInfo" } } } } } } }, "/api/ops/services": { "get": { "tags": [ "运维面板" ], "summary": "Get Services Status", "description": "获取所有环境的服务运行状态。", "operationId": "get_services_status_api_ops_services_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/ServiceStatus" }, "type": "array", "title": "Response Get Services Status Api Ops Services Get" } } } } } } }, "/api/ops/services/{env}/start": { "post": { "tags": [ "运维面板" ], "summary": "Start Service", "description": "启动指定环境的后端服务。", "operationId": "start_service_api_ops_services__env__start_post", "parameters": [ { "name": "env", "in": "path", "required": true, "schema": { "type": "string", "title": "Env" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceActionResult" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/ops/services/{env}/stop": { "post": { "tags": [ "运维面板" ], "summary": "Stop Service", "description": "停止指定环境的后端服务。", "operationId": "stop_service_api_ops_services__env__stop_post", "parameters": [ { "name": "env", "in": "path", "required": true, "schema": { "type": "string", "title": "Env" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceActionResult" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/ops/services/{env}/restart": { "post": { "tags": [ "运维面板" ], "summary": "Restart Service", "description": "重启指定环境的后端服务。", "operationId": "restart_service_api_ops_services__env__restart_post", "parameters": [ { "name": "env", "in": "path", "required": true, "schema": { "type": "string", "title": "Env" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceActionResult" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/ops/git": { "get": { "tags": [ "运维面板" ], "summary": "Get Git Info", "description": "获取所有环境的 Git 状态。", "operationId": "get_git_info_api_ops_git_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/GitInfo" }, "type": "array", "title": "Response Get Git Info Api Ops Git Get" } } } } } } }, "/api/ops/git/{env}/pull": { "post": { "tags": [ "运维面板" ], "summary": "Git Pull", "description": "对指定环境执行 git pull。", "operationId": "git_pull_api_ops_git__env__pull_post", "parameters": [ { "name": "env", "in": "path", "required": true, "schema": { "type": "string", "title": "Env" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitPullResult" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/ops/git/{env}/sync-deps": { "post": { "tags": [ "运维面板" ], "summary": "Sync Deps", "description": "对指定环境执行 uv sync --all-packages。", "operationId": "sync_deps_api_ops_git__env__sync_deps_post", "parameters": [ { "name": "env", "in": "path", "required": true, "schema": { "type": "string", "title": "Env" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceActionResult" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/ops/env-file/{env}": { "get": { "tags": [ "运维面板" ], "summary": "Get Env File", "description": "读取指定环境的 .env 文件(敏感值脱敏)。", "operationId": "get_env_file_api_ops_env_file__env__get", "parameters": [ { "name": "env", "in": "path", "required": true, "schema": { "type": "string", "title": "Env" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/login": { "post": { "tags": [ "小程序认证" ], "summary": "Wx Login", "description": "微信登录。\n\n流程:code → code2session(openid) → 查找/创建 auth.users → 签发 JWT。\n- disabled 用户签发受限令牌,由前端状态路由处理\n- 新用户自动创建(status=new),前端引导至申请页\n- approved 用户签发包含 site_id + roles 的完整令牌\n- new/pending/rejected 用户签发受限令牌", "operationId": "wx_login_api_xcx_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WxLoginRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WxLoginResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/apply": { "post": { "tags": [ "小程序认证" ], "summary": "Submit Application", "description": "提交入驻申请。\n\n委托 application service 处理:\n检查重复 pending → site_code 映射 → 创建记录 → 更新 nickname。", "operationId": "submit_application_api_xcx_apply_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApplicationRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApplicationResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/xcx/cancel-application": { "post": { "tags": [ "小程序认证" ], "summary": "Cancel My Application", "description": "用户主动取消当前 pending 申请。\n\n将申请 status 改为 cancelled,用户 status 回退 new。\n返回被取消申请的信息(用于前端预填重新申请表单)。", "operationId": "cancel_my_application_api_xcx_cancel_application_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelApplicationResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/xcx/me": { "get": { "tags": [ "小程序认证" ], "summary": "Get My Status", "description": "查询自身状态 + 所有申请记录。\n\npending / approved / rejected 用户均可访问。", "operationId": "get_my_status_api_xcx_me_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserStatusResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/xcx/me/sites": { "get": { "tags": [ "小程序认证" ], "summary": "Get My Sites", "description": "查询当前用户关联的所有店铺及对应角色。\n\n仅 approved 用户可访问(通过 get_current_user 依赖保证)。", "operationId": "get_my_sites_api_xcx_me_sites_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/SiteInfo" }, "type": "array", "title": "Response Get My Sites Api Xcx Me Sites Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/xcx/switch-site": { "post": { "tags": [ "小程序认证" ], "summary": "Switch Site", "description": "切换当前店铺。\n\n验证用户在目标 site_id 下有角色绑定,然后签发包含新 site_id 的 JWT。", "operationId": "switch_site_api_xcx_switch_site_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SwitchSiteRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WxLoginResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/xcx/refresh": { "post": { "tags": [ "小程序认证" ], "summary": "Refresh Token", "description": "刷新令牌。\n\n解码 refresh_token → 根据用户当前状态签发新的令牌对。\n- 受限 refresh_token(limited=True)→ 签发新的受限令牌对\n- 完整 refresh_token → 签发新的完整令牌对(保持原 site_id)", "operationId": "refresh_token_api_xcx_refresh_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshTokenRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WxLoginResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/dev-login": { "post": { "tags": [ "小程序认证" ], "summary": "Dev Login", "description": "开发模式 mock 登录。\n\n直接根据 openid 查找/创建用户,跳过微信 code2Session。\n- 已有用户:status 参数为空时保留当前状态,非空时覆盖\n- 新用户:status 参数为空时默认 new,非空时使用指定值\n仅在 WX_DEV_MODE=true 时注册。", "operationId": "dev_login_api_xcx_dev_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevLoginRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WxLoginResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/dev-context": { "get": { "tags": [ "小程序认证" ], "summary": "Dev Context", "description": "返回当前用户的完整调试上下文。\n\n包含:用户信息、当前门店、角色、权限、人员绑定、所有关联门店。\n允许受限令牌访问(返回基础信息,门店/角色/权限为空)。", "operationId": "dev_context_api_xcx_dev_context_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevContextResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/xcx/dev-switch-role": { "post": { "tags": [ "小程序认证" ], "summary": "Dev Switch Role", "description": "切换当前用户在当前门店下的角色。\n\n删除旧角色绑定,插入新角色绑定,重签 token。", "operationId": "dev_switch_role_api_xcx_dev_switch_role_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevSwitchRoleRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WxLoginResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/xcx/dev-switch-status": { "post": { "tags": [ "小程序认证" ], "summary": "Dev Switch Status", "description": "切换当前用户状态,重签 token。\n\n允许受限令牌访问(pending 用户也需要能切换状态)。", "operationId": "dev_switch_status_api_xcx_dev_switch_status_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevSwitchStatusRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WxLoginResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/xcx/dev-switch-binding": { "post": { "tags": [ "小程序认证" ], "summary": "Dev Switch Binding", "description": "切换当前用户在当前门店下的人员绑定。\n\n删除旧绑定,插入新绑定。", "operationId": "dev_switch_binding_api_xcx_dev_switch_binding_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevSwitchBindingRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/applications": { "get": { "tags": [ "管理端审核" ], "summary": "List Applications", "description": "查询申请列表,可按 status 过滤。", "operationId": "list_applications_api_admin_applications_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "按状态过滤:pending / approved / rejected", "title": "Status" }, "description": "按状态过滤:pending / approved / rejected" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ApplicationResponse" }, "title": "Response List Applications Api Admin Applications Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/applications/{application_id}": { "get": { "tags": [ "管理端审核" ], "summary": "Get Application Detail", "description": "查询申请详情 + 候选匹配。", "operationId": "get_application_detail_api_admin_applications__application_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "application_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Application Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/applications/{application_id}/approve": { "post": { "tags": [ "管理端审核" ], "summary": "Approve", "description": "批准申请:分配角色 + 可选绑定。", "operationId": "approve_api_admin_applications__application_id__approve_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "application_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Application Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/app__schemas__xcx_auth__ApproveRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApplicationResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/applications/{application_id}/reject": { "post": { "tags": [ "管理端审核" ], "summary": "Reject", "description": "拒绝申请:记录拒绝原因。", "operationId": "reject_api_admin_applications__application_id__reject_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "application_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Application Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/app__schemas__xcx_auth__RejectRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApplicationResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/config/business-day": { "get": { "tags": [ "业务配置" ], "summary": "Get Business Day Config", "description": "返回当前营业日分割点配置。\n\n无需认证(公开配置),前端启动时调用一次缓存。", "operationId": "get_business_day_config_api_config_business_day_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/xcx/tasks": { "get": { "tags": [ "小程序任务" ], "summary": "Get Tasks", "description": "获取任务列表 + 绩效概览。", "operationId": "get_tasks_api_xcx_tasks_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "pattern": "^(pending|completed|abandoned)$", "default": "pending", "title": "Status" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/tasks/{task_id}": { "get": { "tags": [ "小程序任务" ], "summary": "Get Task Detail", "description": "获取任务详情完整版。", "operationId": "get_task_detail_api_xcx_tasks__task_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskDetailResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/tasks/{task_id}/pin": { "post": { "tags": [ "小程序任务" ], "summary": "Pin Task", "description": "置顶任务。", "operationId": "pin_task_api_xcx_tasks__task_id__pin_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/tasks/{task_id}/unpin": { "post": { "tags": [ "小程序任务" ], "summary": "Unpin Task", "description": "取消置顶。", "operationId": "unpin_task_api_xcx_tasks__task_id__unpin_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/tasks/{task_id}/abandon": { "post": { "tags": [ "小程序任务" ], "summary": "Abandon Task", "description": "放弃任务(需填写原因)。", "operationId": "abandon_task_api_xcx_tasks__task_id__abandon_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AbandonRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/tasks/{task_id}/restore": { "post": { "tags": [ "小程序任务" ], "summary": "Restore Task", "description": "取消放弃,恢复为活跃状态。", "operationId": "restore_task_api_xcx_tasks__task_id__restore_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/notes": { "post": { "tags": [ "小程序备注" ], "summary": "Create Note", "description": "创建备注(含星星评分,可选关联任务)。", "operationId": "create_note_api_xcx_notes_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoteCreateRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoteOut" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "tags": [ "小程序备注" ], "summary": "Get Notes", "description": "查询某目标的备注列表(按创建时间倒序)。", "operationId": "get_notes_api_xcx_notes_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "target_type", "in": "query", "required": false, "schema": { "type": "string", "description": "目标类型", "default": "member", "title": "Target Type" }, "description": "目标类型" }, { "name": "target_id", "in": "query", "required": true, "schema": { "type": "integer", "description": "目标 ID", "title": "Target Id" }, "description": "目标 ID" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/notes/{note_id}": { "delete": { "tags": [ "小程序备注" ], "summary": "Delete Note", "description": "删除备注(验证归属后硬删除)。", "operationId": "delete_note_api_xcx_notes__note_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "note_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Note Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/chat/history": { "get": { "tags": [ "小程序 CHAT" ], "summary": "List Chat History", "description": "CHAT-1: 查询当前用户的对话历史列表,按最后消息时间倒序。", "operationId": "list_chat_history_api_xcx_chat_history_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatHistoryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/chat/messages": { "get": { "tags": [ "小程序 CHAT" ], "summary": "Get Chat Messages By Context", "description": "CHAT-2b: 通过上下文类型和 ID 查询消息(自动查找/创建对话)。", "operationId": "get_chat_messages_by_context_api_xcx_chat_messages_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "contextType", "in": "query", "required": true, "schema": { "type": "string", "title": "Contexttype" } }, { "name": "contextId", "in": "query", "required": true, "schema": { "type": "string", "title": "Contextid" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 50, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatMessagesResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/chat/{chat_id}/messages": { "get": { "tags": [ "小程序 CHAT" ], "summary": "Get Chat Messages", "description": "CHAT-2a: 通过 chatId 查询对话消息列表,按 createdAt 正序。", "operationId": "get_chat_messages_api_xcx_chat__chat_id__messages_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "chat_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Chat Id" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 50, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatMessagesResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "小程序 CHAT" ], "summary": "Send Message", "description": "CHAT-3: 发送用户消息并获取同步 AI 回复。\n\nchatId 归属验证:不属于当前用户返回 HTTP 403。\nAI 失败时返回错误提示消息(HTTP 200)。", "operationId": "send_message_api_xcx_chat__chat_id__messages_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "chat_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Chat Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/chat/stream": { "post": { "tags": [ "小程序 CHAT" ], "summary": "Chat Stream", "description": "CHAT-4: SSE 流式对话端点。\n\n接收用户消息,通过百炼 API 流式返回 AI 回复。\nSSE 事件类型:message(逐 token)/ done(完成)/ error(错误)。\n\nchatId 归属验证:不属于当前用户返回 HTTP 403(普通 JSON 错误,非 SSE)。", "operationId": "chat_stream_api_xcx_chat_stream_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatStreamRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/ai/cache/{cache_type}": { "get": { "tags": [ "小程序 AI 缓存" ], "summary": "Get Ai Cache", "description": "查询指定类型的最新 AI 缓存结果。\n\nsite_id 从 JWT 提取,强制过滤,确保门店隔离。", "operationId": "get_ai_cache_api_ai_cache__cache_type__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "cache_type", "in": "path", "required": true, "schema": { "type": "string", "title": "Cache Type" } }, { "name": "target_id", "in": "query", "required": true, "schema": { "type": "string", "description": "目标 ID(member_id / assistant_id_member_id / 时间维度编码)", "title": "Target Id" }, "description": "目标 ID(member_id / assistant_id_member_id / 时间维度编码)" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/performance": { "get": { "tags": [ "小程序绩效" ], "summary": "Get Performance Overview", "description": "绩效概览(PERF-1)。", "operationId": "get_performance_overview_api_xcx_performance_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "year", "in": "query", "required": true, "schema": { "type": "integer", "title": "Year" } }, { "name": "month", "in": "query", "required": true, "schema": { "type": "integer", "maximum": 12, "minimum": 1, "title": "Month" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PerformanceOverviewResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/performance/records": { "get": { "tags": [ "小程序绩效" ], "summary": "Get Performance Records", "description": "绩效明细(PERF-2)。", "operationId": "get_performance_records_api_xcx_performance_records_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "year", "in": "query", "required": true, "schema": { "type": "integer", "title": "Year" } }, { "name": "month", "in": "query", "required": true, "schema": { "type": "integer", "maximum": 12, "minimum": 1, "title": "Month" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PerformanceRecordsResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/customers/{customer_id}": { "get": { "tags": [ "小程序客户" ], "summary": "Get Customer Detail", "description": "客户详情(CUST-1)。", "operationId": "get_customer_detail_api_xcx_customers__customer_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "customer_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Customer Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerDetailResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/customers/{customer_id}/records": { "get": { "tags": [ "小程序客户" ], "summary": "Get Customer Records", "description": "客户服务记录(CUST-2)。", "operationId": "get_customer_records_api_xcx_customers__customer_id__records_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "customer_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Customer Id" } }, { "name": "year", "in": "query", "required": true, "schema": { "type": "integer", "title": "Year" } }, { "name": "month", "in": "query", "required": true, "schema": { "type": "integer", "maximum": 12, "minimum": 1, "title": "Month" } }, { "name": "table", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Table" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerRecordsResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/coaches/{coach_id}": { "get": { "tags": [ "小程序助教" ], "summary": "Get Coach Detail", "description": "助教详情(COACH-1)。", "operationId": "get_coach_detail_api_xcx_coaches__coach_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "coach_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Coach Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CoachDetailResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/board/coaches": { "get": { "tags": [ "xcx-board" ], "summary": "Get Coach Board", "description": "助教看板(BOARD-1)。", "operationId": "get_coach_board_api_xcx_board_coaches_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "sort", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/CoachSortEnum", "default": "perf_desc" } }, { "name": "skill", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/SkillFilterEnum", "default": "ALL" } }, { "name": "time", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/BoardTimeEnum", "default": "month" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CoachBoardResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/board/customers": { "get": { "tags": [ "xcx-board" ], "summary": "Get Customer Board", "description": "客户看板(BOARD-2)。", "operationId": "get_customer_board_api_xcx_board_customers_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "dimension", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/CustomerDimensionEnum", "default": "recall" } }, { "name": "project", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/ProjectFilterEnum", "default": "ALL" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerBoardResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/board/finance": { "get": { "tags": [ "xcx-board" ], "summary": "Get Finance Board", "description": "财务看板(BOARD-3)。", "operationId": "get_finance_board_api_xcx_board_finance_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "time", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/FinanceTimeEnum", "default": "month" } }, { "name": "area", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/AreaFilterEnum", "default": "all" } }, { "name": "compare", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 1, "minimum": 0, "default": 0, "title": "Compare" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FinanceBoardResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/xcx/config/skill-types": { "get": { "tags": [ "xcx-config" ], "summary": "Get Skill Types", "description": "技能类型配置(CONFIG-1)。查询失败降级返回空数组。", "operationId": "get_skill_types_api_xcx_config_skill_types_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/SkillTypeItem" }, "type": "array", "title": "Response Get Skill Types Api Xcx Config Skill Types Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/tenant/auth/login": { "post": { "tags": [ "租户认证" ], "summary": "Tenant Login", "description": "租户管理员登录。\n\n查询 auth.tenant_admins 表验证用户名密码,成功后签发 JWT 令牌对。\n- 用户不存在或密码错误:401(统一消息,不区分)\n- 账号已禁用(is_active=false):403\n- 登录成功:更新 last_login_at", "operationId": "tenant_login_api_tenant_auth_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantLoginRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantTokenResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/auth/refresh": { "post": { "tags": [ "租户认证" ], "summary": "Tenant Refresh", "description": "刷新租户管理员令牌。\n\n验证 refresh_token(aud=tenant-admin, type=refresh),签发新令牌对。", "operationId": "tenant_refresh_api_tenant_auth_refresh_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantRefreshRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantTokenResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/my-sites": { "get": { "tags": [ "租户用户管理" ], "summary": "List My Sites", "description": "返回当前管理员管辖的店铺列表(用于前端筛选下拉)。\n\n通过 get_effective_site_ids 统一获取有效 site_ids:\n- tenant_admin:实时查 biz.sites(覆盖新建店铺)\n- site_admin:使用 JWT 中的 managed_site_ids", "operationId": "list_my_sites_api_tenant_my_sites_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/tenant/roles": { "get": { "tags": [ "租户用户管理" ], "summary": "List Roles", "description": "返回小程序可用角色列表(从 auth.roles 动态读取,排除管理类角色)。", "operationId": "list_roles_api_tenant_roles_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/tenant/site-staff": { "get": { "tags": [ "租户用户管理" ], "summary": "List Site Staff", "description": "根据角色 + site_id 查询对应人员列表。\n\n- role=coach → 查 ETL 库 dwd.dim_assistant(scd2_is_current=1)\n- 其他 role → 查 ETL 库 dwd.dim_staff(scd2_is_current=1)\n\nsite_id 和 site_code 二选一,优先 site_id。\n使用 get_etl_readonly_connection 直连 ETL 库查底层表,\n手动加 site_id 过滤(FDW 视图的 RLS 在跨库场景下不生效)。", "operationId": "list_site_staff_api_tenant_site_staff_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "role", "in": "query", "required": true, "schema": { "type": "string", "description": "角色 code(coach → 查助教表,其他 → 查员工表)", "title": "Role" }, "description": "角色 code(coach → 查助教表,其他 → 查员工表)" }, { "name": "site_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "description": "店铺 site_id(上游 BIGINT)", "title": "Site Id" }, "description": "店铺 site_id(上游 BIGINT)" }, { "name": "site_code", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "店铺编号(与 site_id 二选一)", "title": "Site Code" }, "description": "店铺编号(与 site_id 二选一)" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/applications": { "get": { "tags": [ "租户用户管理" ], "summary": "List Applications", "description": "申请列表,status/site_id 筛选 + 分页。排除 cancelled 申请。\n\n隔离策略:\n- tenant_admin:看到该租户下所有店铺的申请(通过 JOIN biz.sites 按 tenant_id 过滤)\n- site_admin:只看到 managed_site_ids 范围内的申请", "operationId": "list_applications_api_tenant_applications_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "按状态筛选:pending/approved/rejected", "title": "Status" }, "description": "按状态筛选:pending/approved/rejected" }, { "name": "site_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "description": "按店铺筛选(site_id)", "title": "Site Id" }, "description": "按店铺筛选(site_id)" }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "页码", "default": 1, "title": "Page" }, "description": "页码" }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "每页条数", "default": 20, "title": "Page Size" }, "description": "每页条数" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/applications/{application_id}/match-suggestions": { "get": { "tags": [ "租户用户管理" ], "summary": "Get Match Suggestions", "description": "通过 biz.sites 查 site_id,并行匹配助教和员工。", "operationId": "get_match_suggestions_api_tenant_applications__application_id__match_suggestions_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "application_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Application Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/applications/{application_id}/approve": { "post": { "tags": [ "租户用户管理" ], "summary": "Approve Application", "description": "审核通过:事务内多表写入。\n\n1. 更新 users.status='approved'\n2. 写入 user_site_roles\n3. 写入 user_assistant_binding(如提供 assistant_id/staff_id)\n4. 更新 user_applications.status='approved' + 审核人 + 审核时间", "operationId": "approve_application_api_tenant_applications__application_id__approve_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "application_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Application Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/app__schemas__tenant_users__ApproveRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/applications/{application_id}/reject": { "post": { "tags": [ "租户用户管理" ], "summary": "Reject Application", "description": "审核拒绝:更新 user_applications 状态 + 拒绝原因 + 审核时间。\n累加 rejection_count,第三次自动禁用账号。", "operationId": "reject_application_api_tenant_applications__application_id__reject_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "application_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Application Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/app__schemas__tenant_users__RejectRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/users": { "get": { "tags": [ "租户用户管理" ], "summary": "List Users", "description": "已通过审核用户列表,角色筛选 + 关键词搜索 + 分页。", "operationId": "list_users_api_tenant_users_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "role", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "按角色筛选", "title": "Role" }, "description": "按角色筛选" }, { "name": "keyword", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "关键词搜索(姓名/手机号)", "title": "Keyword" }, "description": "关键词搜索(姓名/手机号)" }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "页码", "default": 1, "title": "Page" }, "description": "页码" }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "每页条数", "default": 20, "title": "Page Size" }, "description": "每页条数" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/users/{user_id}": { "patch": { "tags": [ "租户用户管理" ], "summary": "Edit User", "description": "编辑用户角色/门店/状态。site_id 超出管辖范围返回 403。", "operationId": "edit_user_api_tenant_users__user_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "User Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserEditRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "租户用户管理" ], "summary": "Remove User", "description": "从当前租户管辖的店铺中移除用户。\n\nCHANGE 2026-03-23 | 租户\"移除\"替代\"禁用\"\n- 删除 auth.user_site_roles 中该用户在管辖 site 下的记录\n- 若用户不再绑定任何 site,将 auth.users.status 改为 'new'(可重新申请)\n- 不影响用户的微信身份(第一层),只解除店铺关系(第二层)", "operationId": "remove_user_api_tenant_users__user_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "User Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/users/{user_id}/binding": { "put": { "tags": [ "租户用户管理" ], "summary": "Update Binding", "description": "更新 user_assistant_binding。", "operationId": "update_binding_api_tenant_users__user_id__binding_put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "User Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserBindingRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/excel/upload": { "post": { "tags": [ "租户Excel上传" ], "summary": "Upload Excel", "description": "上传 Excel 文件:解析 → 格式校验 → 人员匹配 → 冲突检测。\n\n返回 upload_id + 校验结果 + 冲突 diff。", "operationId": "upload_excel_api_tenant_excel_upload_post", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_excel_api_tenant_excel_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/tenant/excel/confirm": { "post": { "tags": [ "租户Excel上传" ], "summary": "Confirm Upload", "description": "确认写入:单事务写入目标表。\n\n替换行执行 UPDATE,新增行执行 INSERT。\n写入失败回滚整批,log status=failed。", "operationId": "confirm_upload_api_tenant_excel_confirm_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConfirmRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/tenant/excel/logs": { "get": { "tags": [ "租户Excel上传" ], "summary": "List Upload Logs", "description": "上传记录列表,分页,附加 site_id IN 条件。", "operationId": "list_upload_logs_api_tenant_excel_logs_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "页码", "default": 1, "title": "Page" }, "description": "页码" }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "每页条数", "default": 20, "title": "Page Size" }, "description": "每页条数" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/excel/template/{template_type}": { "get": { "tags": [ "租户Excel上传" ], "summary": "Download Template", "description": "返回空白 Excel 模板文件(含表头和格式说明)。", "operationId": "download_template_api_tenant_excel_template__template_type__get", "parameters": [ { "name": "template_type", "in": "path", "required": true, "schema": { "type": "string", "title": "Template Type" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/customers/search": { "get": { "tags": [ "维客线索管理" ], "summary": "Search Customers", "description": "客户搜索:在管辖门店范围内搜索 v_dim_member。\n\nnickname 模糊匹配 OR mobile 精确匹配,scd2_is_current=1。\n手机号脱敏返回。", "operationId": "search_customers_api_tenant_customers_search_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "keyword", "in": "query", "required": true, "schema": { "type": "string", "minLength": 1, "description": "搜索关键词(姓名模糊/手机号精确)", "title": "Keyword" }, "description": "搜索关键词(姓名模糊/手机号精确)" }, { "name": "site_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "description": "指定门店 ID 筛选", "title": "Site Id" }, "description": "指定门店 ID 筛选" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/customers/{member_id}/clues": { "get": { "tags": [ "维客线索管理" ], "summary": "List Customer Clues", "description": "返回该客户在管辖门店范围内的全部线索,支持 source 和 is_hidden 筛选。", "operationId": "list_customer_clues_api_tenant_customers__member_id__clues_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "member_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Member Id" } }, { "name": "source", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "按来源筛选:manual/ai_consumption/ai_note", "title": "Source" }, "description": "按来源筛选:manual/ai_consumption/ai_note" }, { "name": "is_hidden", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "description": "按隐藏状态筛选", "title": "Is Hidden" }, "description": "按隐藏状态筛选" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/clues/{clue_id}": { "patch": { "tags": [ "维客线索管理" ], "summary": "Edit Clue", "description": "编辑线索 category/summary/detail。校验 category 枚举和 summary 长度。", "operationId": "edit_clue_api_tenant_clues__clue_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "clue_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Clue Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClueEditRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "维客线索管理" ], "summary": "Delete Clue", "description": "物理删除线索。线索不存在或不在管辖范围返回 404。", "operationId": "delete_clue_api_tenant_clues__clue_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "clue_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Clue Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/clues/{clue_id}/visibility": { "patch": { "tags": [ "维客线索管理" ], "summary": "Toggle Clue Visibility", "description": "切换线索 is_hidden 状态。", "operationId": "toggle_clue_visibility_api_tenant_clues__clue_id__visibility_patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "clue_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Clue Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClueVisibilityRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/site-admins": { "get": { "tags": [ "租户店铺管理员" ], "summary": "List Site Admins", "description": "列出当前租户下的店铺管理员。", "operationId": "list_site_admins_api_tenant_site_admins_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } }, { "name": "keyword", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "搜索用户名/显示名称", "title": "Keyword" }, "description": "搜索用户名/显示名称" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "租户店铺管理员" ], "summary": "Create Site Admin", "description": "创建店铺管理员。\n\n用户名校验:必须以管辖店铺的 site_code 开头。\nmanaged_site_ids 必须是当前租户管理员管辖范围的子集。", "operationId": "create_site_admin_api_tenant_site_admins_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SiteAdminCreateRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/site-admins/{admin_id}": { "patch": { "tags": [ "租户店铺管理员" ], "summary": "Edit Site Admin", "description": "编辑店铺管理员(显示名称/管辖门店/启用状态)。", "operationId": "edit_site_admin_api_tenant_site_admins__admin_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "admin_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Admin Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SiteAdminEditRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "租户店铺管理员" ], "summary": "Delete Site Admin", "description": "软删除店铺管理员。", "operationId": "delete_site_admin_api_tenant_site_admins__admin_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "admin_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Admin Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/tenant/site-admins/{admin_id}/reset-password": { "post": { "tags": [ "租户店铺管理员" ], "summary": "Reset Site Admin Password", "description": "重置店铺管理员密码。", "operationId": "reset_site_admin_password_api_tenant_site_admins__admin_id__reset_password_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "admin_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Admin Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SiteAdminResetPasswordRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/tenant-admins": { "get": { "tags": [ "管理端租户管理员" ], "summary": "List Tenant Admins", "description": "查询租户管理员列表,支持分页和关键词搜索。\n\n默认只返回 is_active=true 的记录;include_inactive=true 时返回所有记录。\nJOIN biz.tenants 获取 tenant_name。\n\n需求 14.1, A2.7, A2.6", "operationId": "list_tenant_admins_api_admin_tenant_admins_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "页码", "default": 1, "title": "Page" }, "description": "页码" }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "每页条数", "default": 20, "title": "Page Size" }, "description": "每页条数" }, { "name": "keyword", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "关键词搜索(用户名/显示名称)", "title": "Keyword" }, "description": "关键词搜索(用户名/显示名称)" }, { "name": "include_inactive", "in": "query", "required": false, "schema": { "type": "boolean", "description": "是否包含已禁用的管理员", "default": false, "title": "Include Inactive" }, "description": "是否包含已禁用的管理员" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "管理端租户管理员" ], "summary": "Create Tenant Admin", "description": "创建租户管理员。\n\n密码 bcrypt 哈希,username UNIQUE 冲突返回 409,记录 created_by。\n创建时校验 tenant_id 在 biz.tenants 中存在且 is_active=true。\n\n需求 14.2, 14.3, A2.6", "operationId": "create_tenant_admin_api_admin_tenant_admins_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantAdminCreateRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/tenant-admins/{admin_id}": { "patch": { "tags": [ "管理端租户管理员" ], "summary": "Edit Tenant Admin", "description": "编辑租户管理员信息(username / display_name / managed_site_ids / is_active)。\n\n管理员 ID 不存在返回 404。\n修改 username 时校验全局唯一性(排除自身),冲突返回 409。\n\n需求 14.4, 14.6, A2.8", "operationId": "edit_tenant_admin_api_admin_tenant_admins__admin_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "admin_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Admin Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantAdminEditRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "管理端租户管理员" ], "summary": "Delete Tenant Admin", "description": "软删除租户管理员(设置 deleted_at=NOW())。\n\n无论 is_active 状态如何,均可删除。\n管理员不存在或已删除返回 404;重复删除幂等返回 404。\n\n需求 A2.3", "operationId": "delete_tenant_admin_api_admin_tenant_admins__admin_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "admin_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Admin Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/tenant-admins/{admin_id}/reset-password": { "post": { "tags": [ "管理端租户管理员" ], "summary": "Reset Password", "description": "重置租户管理员密码。\n\n新密码 bcrypt 哈希后更新 password_hash。管理员 ID 不存在返回 404。\n需求 14.5", "operationId": "reset_password_api_admin_tenant_admins__admin_id__reset_password_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "admin_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Admin Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResetPasswordRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/tenants": { "get": { "tags": [ "admin-registry" ], "summary": "List Tenants", "description": "所有活跃租户列表(含连接器名称)。\n\nJOIN biz.connectors 获取 connector_name。\n需求 A2.1", "operationId": "list_tenants_api_admin_tenants_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/TenantItem" }, "type": "array", "title": "Response List Tenants Api Admin Tenants Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/tenants/{tenant_id}/sites": { "get": { "tags": [ "admin-registry" ], "summary": "List Tenant Sites", "description": "指定租户下所有活跃店铺。\n\ntenant_id 参数支持两种格式:\n- 上游系统租户 ID(BIGINT,如 2790683160709957)\n- 内部主键(SERIAL,如 1, 2, 3...)\n自动判断:> 10000 视为上游 ID,否则视为内部 PK。\n\n需求 A2.2", "operationId": "list_tenant_sites_api_admin_tenants__tenant_id__sites_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "tenant_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Tenant Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/SiteItem" }, "title": "Response List Tenant Sites Api Admin Tenants Tenant Id Sites Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/sites/{site_id}/site-code": { "put": { "tags": [ "admin-registry" ], "summary": "Update Site Code", "description": "设置/修改店铺简写ID,事务内执行历史记录管理。\n\n校验规则:\n- 格式:6 位,前 3 位字母/数字 + 后 3 位数字,统一大写\n- 全局唯一:biz.sites.site_code + biz.site_code_history.site_code\n\n事务步骤:\na. 旧 code 在 site_code_history 中标记 is_current=false, retired_at=NOW()\nb. 新 code 插入 site_code_history(is_current=true)\nc. 更新 biz.sites.site_code\nd. 检查旧 code 是否有未审核申请引用,无引用则从 history 中删除旧记录\n\n需求 A2.4, A3.1, A3.2, A3.3, A3.4", "operationId": "update_site_code_api_admin_sites__site_id__site_code_put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "site_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Site Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateSiteCodeRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SiteCodeResult" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/sites/{site_id}/site-code-history": { "get": { "tags": [ "admin-registry" ], "summary": "Get Site Code History", "description": "查看简写ID 变更历史。\n\n需求 A2.5", "operationId": "get_site_code_history_api_admin_sites__site_id__site_code_history_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "site_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Site Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/SiteCodeHistoryItem" }, "title": "Response Get Site Code History Api Admin Sites Site Id Site Code History Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/sites/sync": { "post": { "tags": [ "admin-registry" ], "summary": "Sync Sites", "description": "手动触发店铺同步:从 ETL 库 dwd.dim_site 同步到 biz.sites。\n\n返回同步结果(新增数/更新数)。\n\n需求 A5.3", "operationId": "sync_sites_api_admin_sites_sync_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SiteSyncResult" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/sites": { "post": { "tags": [ "admin-registry" ], "summary": "Create Site", "description": "手动创建店铺(测试功能)。\n\n向 biz.sites 插入一条记录,可选指定 site_code。\nsite_id 和 site_code 需全局唯一,冲突返回 409。", "operationId": "create_site_api_admin_sites_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSiteRequest" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/sites/{site_id}": { "delete": { "tags": [ "admin-registry" ], "summary": "Delete Site", "description": "删除店铺(测试功能,硬删除)。\n\n同时清理 site_code_history 中的关联记录。\nsite_id 参数为 biz.sites.id(内部主键)。", "operationId": "delete_site_api_admin_sites__site_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "site_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Site Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/internal/ai/trigger": { "post": { "tags": [ "internal-ai" ], "summary": "Trigger Ai Event", "description": "接收 ETL/内部事件,写 ai_trigger_jobs 后异步执行。\n\n立即返回 trigger_job_id,调用链在后台异步执行。", "operationId": "trigger_ai_event_api_internal_ai_trigger_post", "parameters": [ { "name": "authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/ai/dashboard": { "get": { "tags": [ "admin-ai" ], "summary": "Get Dashboard", "description": "总览统计(支持 site_id 筛选)。", "operationId": "get_dashboard_api_admin_ai_dashboard_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "site_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "description": "门店 ID 筛选", "title": "Site Id" }, "description": "门店 ID 筛选" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DashboardResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/ai/trigger-jobs": { "get": { "tags": [ "admin-ai" ], "summary": "List Trigger Jobs", "description": "调度任务分页列表。", "operationId": "list_trigger_jobs_api_admin_ai_trigger_jobs_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "event_type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Event Type" } }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "site_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Site Id" } }, { "name": "date_from", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "起始日期 YYYY-MM-DD", "title": "Date From" }, "description": "起始日期 YYYY-MM-DD" }, { "name": "date_to", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "截止日期 YYYY-MM-DD", "title": "Date To" }, "description": "截止日期 YYYY-MM-DD" }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerJobListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/ai/trigger-jobs/{job_id}": { "get": { "tags": [ "admin-ai" ], "summary": "Get Trigger Job", "description": "调度任务详情。", "operationId": "get_trigger_job_api_admin_ai_trigger_jobs__job_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "job_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Job Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerJobDetailResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/ai/trigger-jobs/{job_id}/retry": { "post": { "tags": [ "admin-ai" ], "summary": "Retry Trigger Job", "description": "手动重跑:创建新 trigger_job(is_forced=true),异步执行。", "operationId": "retry_trigger_job_api_admin_ai_trigger_jobs__job_id__retry_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "job_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Job Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RetryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/ai/run-logs": { "get": { "tags": [ "admin-ai" ], "summary": "List Run Logs", "description": "调用记录分页列表。", "operationId": "list_run_logs_api_admin_ai_run_logs_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "app_type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "App Type" } }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "trigger_type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Trigger Type" } }, { "name": "site_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Site Id" } }, { "name": "date_from", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "起始日期 YYYY-MM-DD", "title": "Date From" }, "description": "起始日期 YYYY-MM-DD" }, { "name": "date_to", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "截止日期 YYYY-MM-DD", "title": "Date To" }, "description": "截止日期 YYYY-MM-DD" }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunLogListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/ai/run-logs/{log_id}": { "get": { "tags": [ "admin-ai" ], "summary": "Get Run Log", "description": "调用记录详情(含完整 prompt/response/error,不脱敏)。", "operationId": "get_run_log_api_admin_ai_run_logs__log_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "log_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Log Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunLogDetailResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/ai/cache/invalidate": { "post": { "tags": [ "admin-ai" ], "summary": "Invalidate Cache", "description": "批量缓存失效:将匹配条件的 ai_cache.status 设为 invalidated。", "operationId": "invalidate_cache_api_admin_ai_cache_invalidate_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CacheInvalidateRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CacheInvalidateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/ai/budget": { "get": { "tags": [ "admin-ai" ], "summary": "Get Budget", "description": "Token 预算使用情况:日/月已用量、上限、百分比。", "operationId": "get_budget_api_admin_ai_budget_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BudgetResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/ai/batch-run": { "post": { "tags": [ "admin-ai" ], "summary": "Create Batch Run", "description": "创建批量执行请求,返回预估(不立即执行)。", "operationId": "create_batch_run_api_admin_ai_batch_run_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchRunRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchRunEstimate" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/ai/batch-run/confirm": { "post": { "tags": [ "admin-ai" ], "summary": "Confirm Batch Run", "description": "确认批量执行,后台异步执行。", "operationId": "confirm_batch_run_api_admin_ai_batch_run_confirm_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchRunConfirm" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchRunConfirmResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/ai/alerts": { "get": { "tags": [ "admin-ai" ], "summary": "List Alerts", "description": "告警列表(ai_run_logs WHERE status IN ('failed','timeout','circuit_open'))。", "operationId": "list_alerts_api_admin_ai_alerts_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "alert_status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "pending / acknowledged / ignored", "title": "Alert Status" }, "description": "pending / acknowledged / ignored" }, { "name": "site_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Site Id" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AlertListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/ai/alerts/{log_id}/ack": { "post": { "tags": [ "admin-ai" ], "summary": "Ack Alert", "description": "确认告警:alert_status → acknowledged。", "operationId": "ack_alert_api_admin_ai_alerts__log_id__ack_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "log_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Log Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AlertActionResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/ai/alerts/{log_id}/ignore": { "post": { "tags": [ "admin-ai" ], "summary": "Ignore Alert", "description": "忽略告警:alert_status → ignored。", "operationId": "ignore_alert_api_admin_ai_alerts__log_id__ignore_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "log_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Log Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AlertActionResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/dev-trace/dates": { "get": { "tags": [ "开发调试日志" ], "summary": "List Dates", "description": "返回有日志数据的日期列表(降序排列)。", "operationId": "list_dates_api_admin_dev_trace_dates_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": { "items": { "type": "string" }, "type": "array" }, "type": "object", "title": "Response List Dates Api Admin Dev Trace Dates Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/dev-trace/requests": { "get": { "tags": [ "开发调试日志" ], "summary": "List Requests", "description": "按条件分页查询指定日期的请求列表。", "operationId": "list_requests_api_admin_dev_trace_requests_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "date", "in": "query", "required": true, "schema": { "type": "string", "description": "日期,格式 YYYY-MM-DD", "title": "Date" }, "description": "日期,格式 YYYY-MM-DD" }, { "name": "start_time", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "起始时间 HH:MM:SS", "title": "Start Time" }, "description": "起始时间 HH:MM:SS" }, { "name": "end_time", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "结束时间 HH:MM:SS", "title": "End Time" }, "description": "结束时间 HH:MM:SS" }, { "name": "trace_type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "trace 类型:http/sse/ws/job", "title": "Trace Type" }, "description": "trace 类型:http/sse/ws/job" }, { "name": "method", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "HTTP 方法:GET/POST/PUT/DELETE", "title": "Method" }, "description": "HTTP 方法:GET/POST/PUT/DELETE" }, { "name": "path_contains", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "路径关键词", "title": "Path Contains" }, "description": "路径关键词" }, { "name": "status_code", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "description": "HTTP 状态码", "title": "Status Code" }, "description": "HTTP 状态码" }, { "name": "min_duration", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "description": "最小耗时(ms)", "title": "Min Duration" }, "description": "最小耗时(ms)" }, { "name": "has_error", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "description": "是否有错误", "title": "Has Error" }, "description": "是否有错误" }, { "name": "span_type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "包含的 span 类型", "title": "Span Type" }, "description": "包含的 span 类型" }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "页码", "default": 1, "title": "Page" }, "description": "页码" }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "description": "每页条数", "default": 50, "title": "Page Size" }, "description": "每页条数" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response List Requests Api Admin Dev Trace Requests Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/dev-trace/request/{request_id}": { "get": { "tags": [ "开发调试日志" ], "summary": "Get Request Detail", "description": "返回指定 request_id 的完整 trace 记录(含所有 spans)。", "operationId": "get_request_detail_api_admin_dev_trace_request__request_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Request Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Get Request Detail Api Admin Dev Trace Request Request Id Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/admin/dev-trace/cleanup": { "post": { "tags": [ "开发调试日志" ], "summary": "Cleanup Logs", "description": "按日期范围手动清理日志目录。", "operationId": "cleanup_logs_api_admin_dev_trace_cleanup_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CleanupRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Cleanup Logs Api Admin Dev Trace Cleanup Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/dev-trace/settings": { "get": { "tags": [ "开发调试日志" ], "summary": "Get Settings", "description": "返回当前 trace 运行时设置。", "operationId": "get_settings_api_admin_dev_trace_settings_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Get Settings Api Admin Dev Trace Settings Get" } } } } }, "security": [ { "HTTPBearer": [] } ] }, "put": { "tags": [ "开发调试日志" ], "summary": "Update Settings", "description": "更新 trace 运行时设置(不需重启,重启后回退到 .env 值)。", "operationId": "update_settings_api_admin_dev_trace_settings_put", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SettingsUpdate" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Update Settings Api Admin Dev Trace Settings Put" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/dev-trace/coverage": { "get": { "tags": [ "开发调试日志" ], "summary": "Get Coverage", "description": "返回最近一次覆盖率扫描结果(缓存)。", "operationId": "get_coverage_api_admin_dev_trace_coverage_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Get Coverage Api Admin Dev Trace Coverage Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/admin/dev-trace/coverage/scan": { "post": { "tags": [ "开发调试日志" ], "summary": "Trigger Coverage Scan", "description": "手动触发覆盖率扫描,返回最新结果。", "operationId": "trigger_coverage_scan_api_admin_dev_trace_coverage_scan_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Trigger Coverage Scan Api Admin Dev Trace Coverage Scan Post" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/health": { "get": { "tags": [ "系统" ], "summary": "Health Check", "description": "健康检查端点,用于探活和监控。", "operationId": "health_check_health_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/debug/config-paths": { "get": { "tags": [ "系统" ], "summary": "Debug Config Paths", "description": "返回当前后端实例的关键路径配置(仅开发环境使用)。", "operationId": "debug_config_paths_debug_config_paths_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } } }, "components": { "schemas": { "AbandonRequest": { "properties": { "reason": { "type": "string", "minLength": 1, "title": "Reason", "description": "放弃原因(必填)" } }, "type": "object", "required": [ "reason" ], "title": "AbandonRequest", "description": "放弃任务请求(reason 必填)。" }, "AbandonedTask": { "properties": { "customerName": { "type": "string", "title": "Customername" }, "reason": { "type": "string", "title": "Reason" } }, "type": "object", "required": [ "customerName", "reason" ], "title": "AbandonedTask" }, "AiAnalysis": { "properties": { "summary": { "type": "string", "title": "Summary" }, "suggestions": { "items": { "type": "string" }, "type": "array", "title": "Suggestions" } }, "type": "object", "required": [ "summary", "suggestions" ], "title": "AiAnalysis", "description": "AI 分析结果。" }, "AiInsight": { "properties": { "summary": { "type": "string", "title": "Summary", "default": "" }, "strategies": { "items": { "$ref": "#/components/schemas/AiStrategy" }, "type": "array", "title": "Strategies", "default": [] } }, "type": "object", "title": "AiInsight" }, "AiStrategy": { "properties": { "color": { "type": "string", "title": "Color" }, "text": { "type": "string", "title": "Text" } }, "type": "object", "required": [ "color", "text" ], "title": "AiStrategy" }, "AlertActionResponse": { "properties": { "id": { "type": "integer", "title": "Id" }, "alert_status": { "type": "string", "title": "Alert Status" } }, "type": "object", "required": [ "id", "alert_status" ], "title": "AlertActionResponse", "description": "告警操作(确认/忽略)响应。" }, "AlertItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "app_type": { "type": "string", "title": "App Type" }, "status": { "type": "string", "title": "Status" }, "alert_status": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Alert Status" }, "error_message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error Message" }, "created_at": { "type": "string", "title": "Created At" } }, "type": "object", "required": [ "id", "app_type", "status", "alert_status", "error_message", "created_at" ], "title": "AlertItem", "description": "告警事件项(失败/超时/熔断)。" }, "AlertListResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/AlertItem" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "page": { "type": "integer", "title": "Page" }, "page_size": { "type": "integer", "title": "Page Size" } }, "type": "object", "required": [ "items", "total", "page", "page_size" ], "title": "AlertListResponse", "description": "告警分页列表响应。" }, "AppDistItem": { "properties": { "app_type": { "type": "string", "title": "App Type" }, "count": { "type": "integer", "title": "Count" }, "percentage": { "type": "number", "title": "Percentage" } }, "type": "object", "required": [ "app_type", "count", "percentage" ], "title": "AppDistItem", "description": "各 App 调用占比分布项。" }, "AppHealthItem": { "properties": { "app_type": { "type": "string", "title": "App Type" }, "last_status": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Last Status" }, "last_call_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Last Call At" } }, "type": "object", "required": [ "app_type", "last_status", "last_call_at" ], "title": "AppHealthItem", "description": "各 App 最近一次调用状态。" }, "ApplicationRequest": { "properties": { "siteCode": { "type": "string", "pattern": "^[A-Za-z0-9]{6}$", "title": "Sitecode", "description": "球房ID(6位字母/数字)" }, "appliedRoleText": { "type": "string", "maxLength": 100, "minLength": 1, "title": "Appliedroletext", "description": "申请身份" }, "phone": { "type": "string", "pattern": "^\\d{11}$", "title": "Phone", "description": "手机号" }, "employeeNumber": { "anyOf": [ { "type": "string", "maxLength": 50 }, { "type": "null" } ], "title": "Employeenumber", "description": "员工编号" }, "nickname": { "anyOf": [ { "type": "string", "maxLength": 50 }, { "type": "null" } ], "title": "Nickname", "description": "昵称" } }, "type": "object", "required": [ "siteCode", "appliedRoleText", "phone" ], "title": "ApplicationRequest", "description": "用户申请提交请求。" }, "ApplicationResponse": { "properties": { "id": { "type": "integer", "title": "Id" }, "siteCode": { "type": "string", "title": "Sitecode" }, "appliedRoleText": { "type": "string", "title": "Appliedroletext" }, "status": { "type": "string", "title": "Status" }, "reviewNote": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reviewnote" }, "createdAt": { "type": "string", "title": "Createdat" }, "reviewedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reviewedat" } }, "type": "object", "required": [ "id", "siteCode", "appliedRoleText", "status", "createdAt" ], "title": "ApplicationResponse", "description": "申请记录响应。" }, "AreaFilterEnum": { "type": "string", "enum": [ "all", "hall", "hallA", "hallB", "hallC", "mahjong", "teamBuilding" ], "title": "AreaFilterEnum", "description": "BOARD-3 区域筛选。" }, "BatchRunConfirm": { "properties": { "batch_id": { "type": "string", "title": "Batch Id" } }, "type": "object", "required": [ "batch_id" ], "title": "BatchRunConfirm", "description": "批量执行确认请求。" }, "BatchRunConfirmResponse": { "properties": { "status": { "type": "string", "title": "Status" } }, "type": "object", "required": [ "status" ], "title": "BatchRunConfirmResponse", "description": "批量执行确认响应。" }, "BatchRunEstimate": { "properties": { "batch_id": { "type": "string", "title": "Batch Id" }, "estimated_calls": { "type": "integer", "title": "Estimated Calls" }, "estimated_tokens": { "type": "integer", "title": "Estimated Tokens" } }, "type": "object", "required": [ "batch_id", "estimated_calls", "estimated_tokens" ], "title": "BatchRunEstimate", "description": "批量执行预估响应(不立即执行)。" }, "BatchRunRequest": { "properties": { "app_types": { "items": { "type": "string" }, "type": "array", "title": "App Types" }, "member_ids": { "items": { "type": "integer" }, "type": "array", "title": "Member Ids" }, "site_id": { "type": "integer", "title": "Site Id" } }, "type": "object", "required": [ "app_types", "member_ids", "site_id" ], "title": "BatchRunRequest", "description": "批量执行请求。" }, "BoardTimeEnum": { "type": "string", "enum": [ "month", "quarter", "last_month", "last_3m", "last_quarter", "last_6m" ], "title": "BoardTimeEnum", "description": "BOARD-1 时间范围。" }, "Body_upload_excel_api_tenant_excel_upload_post": { "properties": { "file": { "type": "string", "format": "binary", "title": "File" }, "upload_type": { "type": "string", "title": "Upload Type" }, "site_id": { "type": "integer", "title": "Site Id" } }, "type": "object", "required": [ "file", "upload_type", "site_id" ], "title": "Body_upload_excel_api_tenant_excel_upload_post" }, "BudgetInfo": { "properties": { "daily_used": { "type": "integer", "title": "Daily Used" }, "daily_limit": { "type": "integer", "title": "Daily Limit" }, "daily_pct": { "type": "number", "title": "Daily Pct" }, "monthly_used": { "type": "integer", "title": "Monthly Used" }, "monthly_limit": { "type": "integer", "title": "Monthly Limit" }, "monthly_pct": { "type": "number", "title": "Monthly Pct" } }, "type": "object", "required": [ "daily_used", "daily_limit", "daily_pct", "monthly_used", "monthly_limit", "monthly_pct" ], "title": "BudgetInfo", "description": "日/月 Token 预算进度。" }, "BudgetResponse": { "properties": { "daily_used": { "type": "integer", "title": "Daily Used" }, "daily_limit": { "type": "integer", "title": "Daily Limit" }, "daily_pct": { "type": "number", "title": "Daily Pct" }, "monthly_used": { "type": "integer", "title": "Monthly Used" }, "monthly_limit": { "type": "integer", "title": "Monthly Limit" }, "monthly_pct": { "type": "number", "title": "Monthly Pct" } }, "type": "object", "required": [ "daily_used", "daily_limit", "daily_pct", "monthly_used", "monthly_limit", "monthly_pct" ], "title": "BudgetResponse", "description": "Token 预算使用情况响应。" }, "CacheInvalidateRequest": { "properties": { "site_id": { "type": "integer", "title": "Site Id" }, "app_type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "App Type" }, "member_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Member Id" } }, "type": "object", "required": [ "site_id" ], "title": "CacheInvalidateRequest", "description": "缓存失效请求(site_id 必填)。" }, "CacheInvalidateResponse": { "properties": { "affected_count": { "type": "integer", "title": "Affected Count" } }, "type": "object", "required": [ "affected_count" ], "title": "CacheInvalidateResponse", "description": "缓存失效响应。" }, "CancelApplicationResponse": { "properties": { "id": { "type": "integer", "title": "Id" }, "siteCode": { "type": "string", "title": "Sitecode" }, "appliedRoleText": { "type": "string", "title": "Appliedroletext" }, "phone": { "type": "string", "title": "Phone" }, "employeeNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Employeenumber" }, "status": { "type": "string", "title": "Status" }, "createdAt": { "type": "string", "title": "Createdat" } }, "type": "object", "required": [ "id", "siteCode", "appliedRoleText", "phone", "status", "createdAt" ], "title": "CancelApplicationResponse", "description": "取消申请响应(返回被取消申请的信息,用于预填重新申请表单)。" }, "CashflowItem": { "properties": { "label": { "type": "string", "title": "Label" }, "amount": { "type": "number", "title": "Amount" } }, "type": "object", "required": [ "label", "amount" ], "title": "CashflowItem" }, "CashflowPanel": { "properties": { "consumeItems": { "items": { "$ref": "#/components/schemas/CashflowItem" }, "type": "array", "title": "Consumeitems" }, "rechargeItems": { "items": { "$ref": "#/components/schemas/CashflowItem" }, "type": "array", "title": "Rechargeitems" }, "total": { "type": "number", "title": "Total" } }, "type": "object", "required": [ "consumeItems", "rechargeItems", "total" ], "title": "CashflowPanel" }, "ChannelItem": { "properties": { "label": { "type": "string", "title": "Label" }, "amount": { "type": "number", "title": "Amount" } }, "type": "object", "required": [ "label", "amount" ], "title": "ChannelItem" }, "ChatHistoryItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "title": { "type": "string", "title": "Title" }, "customerName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Customername" }, "lastMessage": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Lastmessage" }, "timestamp": { "type": "string", "title": "Timestamp" }, "unreadCount": { "type": "integer", "title": "Unreadcount", "default": 0 } }, "type": "object", "required": [ "id", "title", "timestamp" ], "title": "ChatHistoryItem", "description": "对话历史列表项。" }, "ChatHistoryResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/ChatHistoryItem" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "page": { "type": "integer", "title": "Page" }, "pageSize": { "type": "integer", "title": "Pagesize" } }, "type": "object", "required": [ "items", "total", "page", "pageSize" ], "title": "ChatHistoryResponse", "description": "CHAT-1 对话历史列表响应。" }, "ChatMessageItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "role": { "type": "string", "title": "Role" }, "content": { "type": "string", "title": "Content" }, "createdAt": { "type": "string", "title": "Createdat" }, "referenceCard": { "anyOf": [ { "$ref": "#/components/schemas/ReferenceCard" }, { "type": "null" } ] } }, "type": "object", "required": [ "id", "role", "content", "createdAt" ], "title": "ChatMessageItem", "description": "对话消息项。" }, "ChatMessagesResponse": { "properties": { "chatId": { "type": "integer", "title": "Chatid" }, "items": { "items": { "$ref": "#/components/schemas/ChatMessageItem" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "page": { "type": "integer", "title": "Page" }, "pageSize": { "type": "integer", "title": "Pagesize" } }, "type": "object", "required": [ "chatId", "items", "total", "page", "pageSize" ], "title": "ChatMessagesResponse", "description": "CHAT-2 对话消息列表响应。" }, "ChatStreamRequest": { "properties": { "chatId": { "type": "integer", "title": "Chatid" }, "content": { "type": "string", "title": "Content" }, "sourcePage": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Sourcepage" }, "pageContext": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Pagecontext" } }, "type": "object", "required": [ "chatId", "content" ], "title": "ChatStreamRequest", "description": "CHAT-4 SSE 流式请求体。" }, "CleanupRequest": { "properties": { "start_date": { "type": "string", "title": "Start Date" }, "end_date": { "type": "string", "title": "End Date" } }, "type": "object", "required": [ "start_date", "end_date" ], "title": "CleanupRequest", "description": "手动清理请求体。" }, "ClueCategory-Output": { "type": "string", "enum": [ "客户基础信息", "消费习惯", "玩法偏好", "促销偏好", "社交关系", "重要反馈" ], "title": "ClueCategory", "description": "维客线索大类枚举" }, "ClueEditRequest": { "properties": { "category": { "$ref": "#/components/schemas/app__schemas__tenant_clues__ClueCategory", "description": "线索大类(6 值枚举)" }, "summary": { "type": "string", "maxLength": 200, "minLength": 1, "title": "Summary", "description": "摘要(非空,≤200 字符)" }, "detail": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Detail", "description": "详情(可选)" } }, "type": "object", "required": [ "category", "summary" ], "title": "ClueEditRequest", "description": "线索编辑请求。" }, "ClueSource": { "type": "string", "enum": [ "manual", "ai_consumption", "ai_note" ], "title": "ClueSource", "description": "维客线索来源枚举" }, "ClueVisibilityRequest": { "properties": { "isHidden": { "type": "boolean", "title": "Ishidden", "description": "是否隐藏" } }, "type": "object", "required": [ "isHidden" ], "title": "ClueVisibilityRequest", "description": "线索隐藏/显示请求。" }, "CoachAnalysisPanel": { "properties": { "basic": { "$ref": "#/components/schemas/CoachAnalysisTable" }, "incentive": { "$ref": "#/components/schemas/CoachAnalysisTable" } }, "type": "object", "required": [ "basic", "incentive" ], "title": "CoachAnalysisPanel" }, "CoachAnalysisRow": { "properties": { "level": { "type": "string", "title": "Level" }, "pay": { "type": "number", "title": "Pay" }, "share": { "type": "number", "title": "Share" }, "hourly": { "type": "number", "title": "Hourly" }, "payCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Paycompare" }, "payDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Paydown" }, "shareCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Sharecompare" }, "shareDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Sharedown" }, "hourlyCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Hourlycompare" }, "hourlyFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Hourlyflat" } }, "type": "object", "required": [ "level", "pay", "share", "hourly" ], "title": "CoachAnalysisRow" }, "CoachAnalysisTable": { "properties": { "totalPay": { "type": "number", "title": "Totalpay" }, "totalShare": { "type": "number", "title": "Totalshare" }, "avgHourly": { "type": "number", "title": "Avghourly" }, "totalPayCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Totalpaycompare" }, "totalPayDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Totalpaydown" }, "totalShareCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Totalsharecompare" }, "totalShareDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Totalsharedown" }, "avgHourlyCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Avghourlycompare" }, "avgHourlyFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Avghourlyflat" }, "rows": { "items": { "$ref": "#/components/schemas/CoachAnalysisRow" }, "type": "array", "title": "Rows" } }, "type": "object", "required": [ "totalPay", "totalShare", "avgHourly", "rows" ], "title": "CoachAnalysisTable" }, "CoachBoardItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "initial": { "type": "string", "title": "Initial" }, "avatarGradient": { "type": "string", "title": "Avatargradient" }, "level": { "type": "string", "title": "Level" }, "skills": { "items": { "$ref": "#/components/schemas/CoachSkillItem" }, "type": "array", "title": "Skills" }, "topCustomers": { "items": { "type": "string" }, "type": "array", "title": "Topcustomers" }, "perfHours": { "type": "number", "title": "Perfhours", "default": 0.0 }, "perfHoursBefore": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Perfhoursbefore" }, "perfGap": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Perfgap" }, "perfReached": { "type": "boolean", "title": "Perfreached", "default": false }, "salary": { "type": "number", "title": "Salary", "default": 0.0 }, "salaryPerfHours": { "type": "number", "title": "Salaryperfhours", "default": 0.0 }, "salaryPerfBefore": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Salaryperfbefore" }, "svAmount": { "type": "number", "title": "Svamount", "default": 0.0 }, "svCustomerCount": { "type": "integer", "title": "Svcustomercount", "default": 0 }, "svConsume": { "type": "number", "title": "Svconsume", "default": 0.0 }, "taskRecall": { "type": "integer", "title": "Taskrecall", "default": 0 }, "taskCallback": { "type": "integer", "title": "Taskcallback", "default": 0 } }, "type": "object", "required": [ "id", "name", "initial", "avatarGradient", "level", "skills", "topCustomers" ], "title": "CoachBoardItem", "description": "助教看板单条记录(扁平结构,包含所有维度字段)。" }, "CoachBoardResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/CoachBoardItem" }, "type": "array", "title": "Items" }, "dimType": { "type": "string", "title": "Dimtype" } }, "type": "object", "required": [ "items", "dimType" ], "title": "CoachBoardResponse" }, "CoachDetailResponse": { "properties": { "id": { "type": "integer", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "avatar": { "type": "string", "title": "Avatar" }, "level": { "type": "string", "title": "Level" }, "skills": { "items": { "type": "string" }, "type": "array", "title": "Skills", "default": [] }, "workYears": { "type": "number", "title": "Workyears", "default": 0 }, "customerCount": { "type": "integer", "title": "Customercount", "default": 0 }, "hireDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Hiredate" }, "performance": { "$ref": "#/components/schemas/PerformanceMetrics" }, "income": { "$ref": "#/components/schemas/IncomeSection" }, "tierNodes": { "items": { "type": "number" }, "type": "array", "title": "Tiernodes", "default": [] }, "visibleTasks": { "items": { "$ref": "#/components/schemas/CoachTaskItem" }, "type": "array", "title": "Visibletasks", "default": [] }, "hiddenTasks": { "items": { "$ref": "#/components/schemas/CoachTaskItem" }, "type": "array", "title": "Hiddentasks", "default": [] }, "abandonedTasks": { "items": { "$ref": "#/components/schemas/AbandonedTask" }, "type": "array", "title": "Abandonedtasks", "default": [] }, "topCustomers": { "items": { "$ref": "#/components/schemas/TopCustomer" }, "type": "array", "title": "Topcustomers", "default": [] }, "serviceRecords": { "items": { "$ref": "#/components/schemas/CoachServiceRecord" }, "type": "array", "title": "Servicerecords", "default": [] }, "historyMonths": { "items": { "$ref": "#/components/schemas/HistoryMonth" }, "type": "array", "title": "Historymonths", "default": [] }, "notes": { "items": { "$ref": "#/components/schemas/CoachNoteItem" }, "type": "array", "title": "Notes", "default": [] } }, "type": "object", "required": [ "id", "name", "avatar", "level", "performance", "income" ], "title": "CoachDetailResponse", "description": "COACH-1 响应。" }, "CoachNoteItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "content": { "type": "string", "title": "Content" }, "timestamp": { "type": "string", "title": "Timestamp" }, "score": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Score" }, "customerName": { "type": "string", "title": "Customername" }, "tagLabel": { "type": "string", "title": "Taglabel" }, "createdAt": { "type": "string", "title": "Createdat" } }, "type": "object", "required": [ "id", "content", "timestamp", "customerName", "tagLabel", "createdAt" ], "title": "CoachNoteItem" }, "CoachServiceItem": { "properties": { "name": { "type": "string", "title": "Name" }, "level": { "type": "string", "title": "Level" }, "levelColor": { "type": "string", "title": "Levelcolor" }, "courseType": { "type": "string", "title": "Coursetype" }, "hours": { "type": "number", "title": "Hours" }, "perfHours": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Perfhours" }, "fee": { "type": "number", "title": "Fee" } }, "type": "object", "required": [ "name", "level", "levelColor", "courseType", "hours", "fee" ], "title": "CoachServiceItem" }, "CoachServiceRecord": { "properties": { "customerId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Customerid" }, "customerName": { "type": "string", "title": "Customername" }, "initial": { "type": "string", "title": "Initial" }, "avatarGradient": { "type": "string", "title": "Avatargradient" }, "type": { "type": "string", "title": "Type" }, "typeClass": { "type": "string", "title": "Typeclass" }, "table": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Table" }, "duration": { "type": "string", "title": "Duration" }, "income": { "type": "string", "title": "Income" }, "date": { "type": "string", "title": "Date" }, "perfHours": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Perfhours" } }, "type": "object", "required": [ "customerName", "initial", "avatarGradient", "type", "typeClass", "duration", "income", "date" ], "title": "CoachServiceRecord" }, "CoachSkillItem": { "properties": { "text": { "type": "string", "title": "Text" }, "cls": { "type": "string", "title": "Cls" } }, "type": "object", "required": [ "text", "cls" ], "title": "CoachSkillItem" }, "CoachSortEnum": { "type": "string", "enum": [ "perf_desc", "perf_asc", "salary_desc", "salary_asc", "sv_desc", "task_desc" ], "title": "CoachSortEnum", "description": "BOARD-1 排序维度。" }, "CoachTask": { "properties": { "name": { "type": "string", "title": "Name" }, "level": { "type": "string", "title": "Level" }, "levelColor": { "type": "string", "title": "Levelcolor" }, "taskType": { "type": "string", "title": "Tasktype" }, "taskColor": { "type": "string", "title": "Taskcolor" }, "bgClass": { "type": "string", "title": "Bgclass" }, "status": { "type": "string", "title": "Status" }, "lastService": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Lastservice" }, "metrics": { "items": { "$ref": "#/components/schemas/MetricItem" }, "type": "array", "title": "Metrics", "default": [] } }, "type": "object", "required": [ "name", "level", "levelColor", "taskType", "taskColor", "bgClass", "status" ], "title": "CoachTask" }, "CoachTaskItem": { "properties": { "typeLabel": { "type": "string", "title": "Typelabel" }, "typeClass": { "type": "string", "title": "Typeclass" }, "customerName": { "type": "string", "title": "Customername" }, "customerId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Customerid" }, "noteCount": { "type": "integer", "title": "Notecount", "default": 0 }, "pinned": { "type": "boolean", "title": "Pinned", "default": false }, "notes": { "anyOf": [ { "items": { "additionalProperties": true, "type": "object" }, "type": "array" }, { "type": "null" } ], "title": "Notes" } }, "type": "object", "required": [ "typeLabel", "typeClass", "customerName" ], "title": "CoachTaskItem" }, "ColumnInfo": { "properties": { "name": { "type": "string", "title": "Name" }, "data_type": { "type": "string", "title": "Data Type" }, "is_nullable": { "type": "boolean", "title": "Is Nullable" }, "column_default": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Column Default" } }, "type": "object", "required": [ "name", "data_type", "is_nullable" ], "title": "ColumnInfo", "description": "列定义。" }, "ConfirmRequest": { "properties": { "uploadId": { "type": "integer", "title": "Uploadid", "description": "上传批次 ID" }, "resolutions": { "items": { "$ref": "#/components/schemas/Resolution" }, "type": "array", "title": "Resolutions", "description": "冲突解决方案列表" } }, "type": "object", "required": [ "uploadId" ], "title": "ConfirmRequest", "description": "确认写入请求。" }, "ConsumptionRecord": { "properties": { "id": { "type": "string", "title": "Id" }, "type": { "type": "string", "title": "Type" }, "date": { "type": "string", "title": "Date" }, "tableName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Tablename" }, "startTime": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Starttime" }, "endTime": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Endtime" }, "duration": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Duration" }, "tableFee": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Tablefee" }, "tableOrigPrice": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Tableorigprice" }, "coaches": { "items": { "$ref": "#/components/schemas/CoachServiceItem" }, "type": "array", "title": "Coaches", "default": [] }, "foodAmount": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Foodamount" }, "foodOrigPrice": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Foodorigprice" }, "totalAmount": { "type": "number", "title": "Totalamount" }, "totalOrigPrice": { "type": "number", "title": "Totalorigprice" }, "payMethod": { "type": "string", "title": "Paymethod" }, "rechargeAmount": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Rechargeamount" } }, "type": "object", "required": [ "id", "type", "date", "totalAmount", "totalOrigPrice", "payMethod" ], "title": "ConsumptionRecord" }, "CreateScheduleRequest": { "properties": { "name": { "type": "string", "title": "Name" }, "task_codes": { "items": { "type": "string" }, "type": "array", "title": "Task Codes" }, "task_config": { "additionalProperties": true, "type": "object", "title": "Task Config" }, "schedule_config": { "$ref": "#/components/schemas/ScheduleConfigSchema" }, "run_immediately": { "type": "boolean", "title": "Run Immediately", "default": false }, "min_run_interval_value": { "type": "integer", "title": "Min Run Interval Value", "default": 0 }, "min_run_interval_unit": { "type": "string", "enum": [ "minutes", "hours", "days" ], "title": "Min Run Interval Unit", "default": "minutes" } }, "type": "object", "required": [ "name", "task_codes", "task_config", "schedule_config" ], "title": "CreateScheduleRequest", "description": "创建调度任务请求" }, "CreateSiteRequest": { "properties": { "tenantId": { "type": "integer", "title": "Tenantid" }, "siteId": { "type": "integer", "title": "Siteid" }, "siteName": { "type": "string", "title": "Sitename" }, "siteCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Sitecode" } }, "type": "object", "required": [ "tenantId", "siteId", "siteName" ], "title": "CreateSiteRequest", "description": "手动创建店铺请求(测试功能)。" }, "CursorInfo": { "properties": { "task_code": { "type": "string", "title": "Task Code" }, "last_fetch_time": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Last Fetch Time" }, "record_count": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Record Count" } }, "type": "object", "required": [ "task_code" ], "title": "CursorInfo", "description": "ETL 游标信息(单条任务的最后抓取状态)。" }, "CustomerBoardResponse": { "properties": { "items": { "items": { "additionalProperties": true, "type": "object" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "page": { "type": "integer", "title": "Page" }, "pageSize": { "type": "integer", "title": "Pagesize" } }, "type": "object", "required": [ "items", "total", "page", "pageSize" ], "title": "CustomerBoardResponse" }, "CustomerDetailResponse": { "properties": { "id": { "type": "integer", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "phone": { "type": "string", "title": "Phone" }, "phoneFull": { "type": "string", "title": "Phonefull" }, "avatar": { "type": "string", "title": "Avatar" }, "memberLevel": { "type": "string", "title": "Memberlevel" }, "relationIndex": { "type": "string", "title": "Relationindex" }, "tags": { "items": { "type": "string" }, "type": "array", "title": "Tags", "default": [] }, "balance": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Balance" }, "consumption60D": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Consumption60D" }, "idealInterval": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Idealinterval" }, "daysSinceVisit": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Dayssincevisit" }, "aiInsight": { "$ref": "#/components/schemas/AiInsight", "default": { "summary": "", "strategies": [] } }, "coachTasks": { "items": { "$ref": "#/components/schemas/CoachTask" }, "type": "array", "title": "Coachtasks", "default": [] }, "favoriteCoaches": { "items": { "$ref": "#/components/schemas/FavoriteCoach" }, "type": "array", "title": "Favoritecoaches", "default": [] }, "retentionClues": { "items": { "$ref": "#/components/schemas/app__schemas__xcx_customers__RetentionClue" }, "type": "array", "title": "Retentionclues", "default": [] }, "consumptionRecords": { "items": { "$ref": "#/components/schemas/ConsumptionRecord" }, "type": "array", "title": "Consumptionrecords", "default": [] }, "notes": { "items": { "$ref": "#/components/schemas/CustomerNote" }, "type": "array", "title": "Notes", "default": [] } }, "type": "object", "required": [ "id", "name", "phone", "phoneFull", "avatar", "memberLevel", "relationIndex" ], "title": "CustomerDetailResponse", "description": "CUST-1 响应。" }, "CustomerDimensionEnum": { "type": "string", "enum": [ "recall", "potential", "balance", "recharge", "recent", "spend60", "freq60", "loyal" ], "title": "CustomerDimensionEnum", "description": "BOARD-2 客户维度。" }, "CustomerNote": { "properties": { "id": { "type": "integer", "title": "Id" }, "tagLabel": { "type": "string", "title": "Taglabel" }, "createdAt": { "type": "string", "title": "Createdat" }, "content": { "type": "string", "title": "Content" } }, "type": "object", "required": [ "id", "tagLabel", "createdAt", "content" ], "title": "CustomerNote" }, "CustomerRecordsResponse": { "properties": { "customerName": { "type": "string", "title": "Customername" }, "customerPhone": { "type": "string", "title": "Customerphone" }, "customerPhoneFull": { "type": "string", "title": "Customerphonefull" }, "relationIndex": { "type": "string", "title": "Relationindex" }, "tables": { "items": { "additionalProperties": true, "type": "object" }, "type": "array", "title": "Tables", "default": [] }, "totalServiceCount": { "type": "integer", "title": "Totalservicecount" }, "monthCount": { "type": "integer", "title": "Monthcount" }, "monthHours": { "type": "number", "title": "Monthhours" }, "records": { "items": { "$ref": "#/components/schemas/ServiceRecordItem" }, "type": "array", "title": "Records", "default": [] }, "hasMore": { "type": "boolean", "title": "Hasmore", "default": false } }, "type": "object", "required": [ "customerName", "customerPhone", "customerPhoneFull", "relationIndex", "totalServiceCount", "monthCount", "monthHours" ], "title": "CustomerRecordsResponse", "description": "CUST-2 响应。" }, "DailyTrend": { "properties": { "date": { "type": "string", "title": "Date" }, "calls": { "type": "integer", "title": "Calls" }, "success_rate": { "type": "number", "title": "Success Rate" } }, "type": "object", "required": [ "date", "calls", "success_rate" ], "title": "DailyTrend", "description": "近 7 天按日聚合趋势项。" }, "DashboardResponse": { "properties": { "today_calls": { "type": "integer", "title": "Today Calls" }, "today_success_rate": { "type": "number", "title": "Today Success Rate" }, "today_tokens": { "type": "integer", "title": "Today Tokens" }, "today_avg_latency_ms": { "type": "number", "title": "Today Avg Latency Ms" }, "trend_7d": { "items": { "$ref": "#/components/schemas/DailyTrend" }, "type": "array", "title": "Trend 7D" }, "app_distribution": { "items": { "$ref": "#/components/schemas/AppDistItem" }, "type": "array", "title": "App Distribution" }, "budget": { "$ref": "#/components/schemas/BudgetInfo" }, "recent_alerts": { "items": { "$ref": "#/components/schemas/AlertItem" }, "type": "array", "title": "Recent Alerts" }, "app_health": { "items": { "$ref": "#/components/schemas/AppHealthItem" }, "type": "array", "title": "App Health" } }, "type": "object", "required": [ "today_calls", "today_success_rate", "today_tokens", "today_avg_latency_ms", "trend_7d", "app_distribution", "budget", "recent_alerts", "app_health" ], "title": "DashboardResponse", "description": "Dashboard 总览统计响应。" }, "DateGroup": { "properties": { "date": { "type": "string", "title": "Date" }, "totalHours": { "type": "string", "title": "Totalhours" }, "totalIncome": { "type": "string", "title": "Totalincome" }, "records": { "items": { "$ref": "#/components/schemas/DateGroupRecord" }, "type": "array", "title": "Records" } }, "type": "object", "required": [ "date", "totalHours", "totalIncome", "records" ], "title": "DateGroup", "description": "按日期分组的服务记录组。" }, "DateGroupRecord": { "properties": { "customerName": { "type": "string", "title": "Customername" }, "avatarChar": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Avatarchar" }, "avatarColor": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Avatarcolor" }, "timeRange": { "type": "string", "title": "Timerange" }, "hours": { "type": "string", "title": "Hours" }, "courseType": { "type": "string", "title": "Coursetype" }, "courseTypeClass": { "type": "string", "title": "Coursetypeclass" }, "location": { "type": "string", "title": "Location" }, "income": { "type": "string", "title": "Income" } }, "type": "object", "required": [ "customerName", "timeRange", "hours", "courseType", "courseTypeClass", "location", "income" ], "title": "DateGroupRecord", "description": "按日期分组的单条服务记录。" }, "DevContextResponse": { "properties": { "userId": { "type": "integer", "title": "Userid" }, "openid": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Openid" }, "status": { "type": "string", "title": "Status" }, "nickname": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Nickname" }, "siteId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Siteid" }, "siteName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Sitename" }, "roles": { "items": { "type": "string" }, "type": "array", "title": "Roles", "default": [] }, "permissions": { "items": { "type": "string" }, "type": "array", "title": "Permissions", "default": [] }, "binding": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Binding" }, "allSites": { "items": { "additionalProperties": true, "type": "object" }, "type": "array", "title": "Allsites", "default": [] } }, "type": "object", "required": [ "userId", "status" ], "title": "DevContextResponse", "description": "开发调试上下文信息。" }, "DevLoginRequest": { "properties": { "openid": { "type": "string", "minLength": 1, "title": "Openid", "description": "模拟的微信 openid" }, "status": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status", "description": "模拟的用户状态;为空时保留已有用户的当前状态,新用户默认 new" } }, "type": "object", "required": [ "openid" ], "title": "DevLoginRequest", "description": "开发模式 mock 登录请求(仅 WX_DEV_MODE=true 时可用)。" }, "DevSwitchBindingRequest": { "properties": { "bindingType": { "type": "string", "title": "Bindingtype", "description": "绑定类型(assistant/staff/manager)" }, "assistantId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Assistantid", "description": "助教 ID(binding_type=assistant 时必填)" }, "staffId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Staffid", "description": "员工 ID(binding_type=staff/manager 时必填)" } }, "type": "object", "required": [ "bindingType" ], "title": "DevSwitchBindingRequest", "description": "切换人员绑定请求。" }, "DevSwitchRoleRequest": { "properties": { "roleCode": { "type": "string", "title": "Rolecode", "description": "目标角色 code(coach/staff/site_admin/tenant_admin)" } }, "type": "object", "required": [ "roleCode" ], "title": "DevSwitchRoleRequest", "description": "切换角色请求。替换当前用户在当前门店下的所有角色为指定角色。" }, "DevSwitchStatusRequest": { "properties": { "status": { "type": "string", "title": "Status", "description": "目标状态(new/pending/approved/rejected/disabled)" } }, "type": "object", "required": [ "status" ], "title": "DevSwitchStatusRequest", "description": "切换用户状态请求。" }, "DwdTableItem": { "properties": { "table_name": { "type": "string", "title": "Table Name" }, "display_name": { "type": "string", "title": "Display Name" }, "domain": { "type": "string", "title": "Domain" }, "ods_source": { "type": "string", "title": "Ods Source" }, "is_dimension": { "type": "boolean", "title": "Is Dimension" } }, "type": "object", "required": [ "table_name", "display_name", "domain", "ods_source", "is_dimension" ], "title": "DwdTableItem" }, "DwdTablesResponse": { "properties": { "groups": { "additionalProperties": { "items": { "$ref": "#/components/schemas/DwdTableItem" }, "type": "array" }, "type": "object", "title": "Groups" } }, "type": "object", "required": [ "groups" ], "title": "DwdTablesResponse", "description": "按业务域分组的 DWD 表定义" }, "EnvConfigResponse": { "properties": { "entries": { "items": { "$ref": "#/components/schemas/EnvEntry" }, "type": "array", "title": "Entries" } }, "type": "object", "required": [ "entries" ], "title": "EnvConfigResponse", "description": "GET 响应:键值对列表。" }, "EnvConfigUpdateRequest": { "properties": { "entries": { "items": { "$ref": "#/components/schemas/EnvEntry" }, "type": "array", "title": "Entries" } }, "type": "object", "required": [ "entries" ], "title": "EnvConfigUpdateRequest", "description": "PUT 请求体:键值对列表。" }, "EnvEntry": { "properties": { "key": { "type": "string", "title": "Key" }, "value": { "type": "string", "title": "Value" } }, "type": "object", "required": [ "key", "value" ], "title": "EnvEntry", "description": "单条环境变量键值对。" }, "ExecutionHistoryItem": { "properties": { "id": { "type": "string", "title": "Id" }, "site_id": { "type": "integer", "title": "Site Id" }, "task_codes": { "items": { "type": "string" }, "type": "array", "title": "Task Codes" }, "status": { "type": "string", "title": "Status" }, "started_at": { "type": "string", "format": "date-time", "title": "Started At" }, "finished_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Finished At" }, "exit_code": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Exit Code" }, "duration_ms": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Duration Ms" }, "command": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Command" }, "summary": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Summary" }, "schedule_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Schedule Id" } }, "type": "object", "required": [ "id", "site_id", "task_codes", "status", "started_at" ], "title": "ExecutionHistoryItem", "description": "执行历史记录" }, "ExecutionLogsResponse": { "properties": { "execution_id": { "type": "string", "title": "Execution Id" }, "output_log": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Output Log" }, "error_log": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error Log" } }, "type": "object", "required": [ "execution_id" ], "title": "ExecutionLogsResponse", "description": "执行日志响应" }, "ExecutionRunResponse": { "properties": { "execution_id": { "type": "string", "title": "Execution Id" }, "message": { "type": "string", "title": "Message" } }, "type": "object", "required": [ "execution_id", "message" ], "title": "ExecutionRunResponse", "description": "直接执行任务的响应" }, "ExpenseItem": { "properties": { "label": { "type": "string", "title": "Label" }, "amount": { "type": "number", "title": "Amount" }, "compare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Compare" }, "down": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Down" }, "flat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Flat" } }, "type": "object", "required": [ "label", "amount" ], "title": "ExpenseItem" }, "ExpensePanel": { "properties": { "operationItems": { "items": { "$ref": "#/components/schemas/ExpenseItem" }, "type": "array", "title": "Operationitems" }, "fixedItems": { "items": { "$ref": "#/components/schemas/ExpenseItem" }, "type": "array", "title": "Fixeditems" }, "coachItems": { "items": { "$ref": "#/components/schemas/ExpenseItem" }, "type": "array", "title": "Coachitems" }, "platformItems": { "items": { "$ref": "#/components/schemas/ExpenseItem" }, "type": "array", "title": "Platformitems" }, "total": { "type": "number", "title": "Total" }, "totalCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Totalcompare" }, "totalDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Totaldown" }, "totalFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Totalflat" } }, "type": "object", "required": [ "operationItems", "fixedItems", "coachItems", "platformItems", "total" ], "title": "ExpensePanel" }, "FavoriteCoach": { "properties": { "emoji": { "type": "string", "title": "Emoji" }, "name": { "type": "string", "title": "Name" }, "relationIndex": { "type": "string", "title": "Relationindex" }, "indexColor": { "type": "string", "title": "Indexcolor" }, "bgClass": { "type": "string", "title": "Bgclass" }, "stats": { "items": { "$ref": "#/components/schemas/MetricItem" }, "type": "array", "title": "Stats", "default": [] } }, "type": "object", "required": [ "emoji", "name", "relationIndex", "indexColor", "bgClass" ], "title": "FavoriteCoach" }, "FinanceBoardResponse": { "properties": { "overview": { "$ref": "#/components/schemas/OverviewPanel" }, "recharge": { "anyOf": [ { "$ref": "#/components/schemas/RechargePanel" }, { "type": "null" } ] }, "revenue": { "$ref": "#/components/schemas/RevenuePanel" }, "cashflow": { "$ref": "#/components/schemas/CashflowPanel" }, "expense": { "$ref": "#/components/schemas/ExpensePanel" }, "coachAnalysis": { "$ref": "#/components/schemas/CoachAnalysisPanel" } }, "type": "object", "required": [ "overview", "recharge", "revenue", "cashflow", "expense", "coachAnalysis" ], "title": "FinanceBoardResponse" }, "FinanceTimeEnum": { "type": "string", "enum": [ "month", "lastMonth", "week", "lastWeek", "quarter3", "quarter", "lastQuarter", "half6" ], "title": "FinanceTimeEnum", "description": "BOARD-3 时间范围。" }, "FlowDefinition": { "properties": { "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "layers": { "items": { "type": "string" }, "type": "array", "title": "Layers" } }, "type": "object", "required": [ "id", "name", "layers" ], "title": "FlowDefinition", "description": "执行流程(Flow)定义" }, "FlowsResponse": { "properties": { "flows": { "items": { "$ref": "#/components/schemas/FlowDefinition" }, "type": "array", "title": "Flows" }, "processing_modes": { "items": { "$ref": "#/components/schemas/ProcessingModeDefinition" }, "type": "array", "title": "Processing Modes" } }, "type": "object", "required": [ "flows", "processing_modes" ], "title": "FlowsResponse", "description": "Flow 定义 + 处理模式定义" }, "GiftCell": { "properties": { "value": { "type": "number", "title": "Value" }, "compare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Compare" }, "down": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Down" }, "flat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Flat" } }, "type": "object", "required": [ "value" ], "title": "GiftCell" }, "GiftRow": { "properties": { "label": { "type": "string", "title": "Label" }, "total": { "$ref": "#/components/schemas/GiftCell" }, "liquor": { "$ref": "#/components/schemas/GiftCell" }, "tableFee": { "$ref": "#/components/schemas/GiftCell" }, "voucher": { "$ref": "#/components/schemas/GiftCell" } }, "type": "object", "required": [ "label", "total", "liquor", "tableFee", "voucher" ], "title": "GiftRow", "description": "赠送卡矩阵一行:合计 / 酒水卡 / 台费卡 / 抵用券。" }, "GitInfo": { "properties": { "env": { "type": "string", "title": "Env" }, "branch": { "type": "string", "title": "Branch" }, "last_commit_hash": { "type": "string", "title": "Last Commit Hash" }, "last_commit_message": { "type": "string", "title": "Last Commit Message" }, "last_commit_time": { "type": "string", "title": "Last Commit Time" }, "has_local_changes": { "type": "boolean", "title": "Has Local Changes" } }, "type": "object", "required": [ "env", "branch", "last_commit_hash", "last_commit_message", "last_commit_time", "has_local_changes" ], "title": "GitInfo" }, "GitPullResult": { "properties": { "env": { "type": "string", "title": "Env" }, "success": { "type": "boolean", "title": "Success" }, "output": { "type": "string", "title": "Output" } }, "type": "object", "required": [ "env", "success", "output" ], "title": "GitPullResult" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "HistoryMonth": { "properties": { "month": { "type": "string", "title": "Month" }, "estimated": { "type": "boolean", "title": "Estimated" }, "customers": { "type": "string", "title": "Customers" }, "hours": { "type": "string", "title": "Hours" }, "salary": { "type": "string", "title": "Salary" }, "callbackDone": { "type": "integer", "title": "Callbackdone" }, "recallDone": { "type": "integer", "title": "Recalldone" } }, "type": "object", "required": [ "month", "estimated", "customers", "hours", "salary", "callbackDone", "recallDone" ], "title": "HistoryMonth" }, "IncomeSection": { "properties": { "thisMonth": { "items": { "$ref": "#/components/schemas/app__schemas__xcx_coaches__IncomeItem" }, "type": "array", "title": "Thismonth", "default": [] }, "lastMonth": { "items": { "$ref": "#/components/schemas/app__schemas__xcx_coaches__IncomeItem" }, "type": "array", "title": "Lastmonth", "default": [] } }, "type": "object", "title": "IncomeSection" }, "LatestApplicationDetail": { "properties": { "id": { "type": "integer", "title": "Id" }, "siteCode": { "type": "string", "title": "Sitecode" }, "appliedRoleText": { "type": "string", "title": "Appliedroletext" }, "phone": { "type": "string", "title": "Phone" }, "employeeNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Employeenumber" }, "status": { "type": "string", "title": "Status" }, "reviewNote": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reviewnote" }, "createdAt": { "type": "string", "title": "Createdat" }, "reviewedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reviewedat" } }, "type": "object", "required": [ "id", "siteCode", "appliedRoleText", "phone", "status", "createdAt" ], "title": "LatestApplicationDetail", "description": "最新申请详情(含 phone/employee_number,用于前端展示和预填)。" }, "LoginRequest": { "properties": { "username": { "type": "string", "maxLength": 64, "minLength": 1, "title": "Username", "description": "用户名" }, "password": { "type": "string", "minLength": 1, "title": "Password", "description": "密码" } }, "type": "object", "required": [ "username", "password" ], "title": "LoginRequest", "description": "登录请求。" }, "MessageBrief": { "properties": { "id": { "type": "integer", "title": "Id" }, "content": { "type": "string", "title": "Content" }, "createdAt": { "type": "string", "title": "Createdat" } }, "type": "object", "required": [ "id", "content", "createdAt" ], "title": "MessageBrief", "description": "消息摘要(用于发送消息响应)。" }, "MetricItem": { "properties": { "label": { "type": "string", "title": "Label" }, "value": { "type": "string", "title": "Value" }, "color": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Color" } }, "type": "object", "required": [ "label", "value" ], "title": "MetricItem" }, "NewCustomer": { "properties": { "name": { "type": "string", "title": "Name" }, "avatarChar": { "type": "string", "title": "Avatarchar" }, "avatarColor": { "type": "string", "title": "Avatarcolor" }, "lastService": { "type": "string", "title": "Lastservice" }, "count": { "type": "integer", "title": "Count" } }, "type": "object", "required": [ "name", "avatarChar", "avatarColor", "lastService", "count" ], "title": "NewCustomer", "description": "新客户。" }, "NoteCreateRequest": { "properties": { "targetType": { "type": "string", "title": "Targettype", "default": "member" }, "targetId": { "type": "integer", "title": "Targetid" }, "content": { "type": "string", "minLength": 1, "title": "Content" }, "taskId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Taskid" }, "ratingServiceWillingness": { "anyOf": [ { "type": "integer", "maximum": 5.0, "minimum": 1.0 }, { "type": "null" } ], "title": "Ratingservicewillingness", "description": "再次服务意愿(1-5)" }, "ratingRevisitLikelihood": { "anyOf": [ { "type": "integer", "maximum": 5.0, "minimum": 1.0 }, { "type": "null" } ], "title": "Ratingrevisitlikelihood", "description": "再来店可能性(1-5)" }, "score": { "anyOf": [ { "type": "integer", "maximum": 5.0, "minimum": 1.0 }, { "type": "null" } ], "title": "Score", "description": "备注星星评分(1-5)" } }, "type": "object", "required": [ "targetId", "content" ], "title": "NoteCreateRequest", "description": "创建备注请求(含手动评分:再次服务意愿 + 再来店可能性,各 1-5;备注星星评分 1-5)。" }, "NoteItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "content": { "type": "string", "title": "Content" }, "tagType": { "type": "string", "title": "Tagtype" }, "tagLabel": { "type": "string", "title": "Taglabel" }, "createdAt": { "type": "string", "title": "Createdat" }, "score": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Score" } }, "type": "object", "required": [ "id", "content", "tagType", "tagLabel", "createdAt" ], "title": "NoteItem", "description": "备注项。" }, "NoteOut": { "properties": { "id": { "type": "integer", "title": "Id" }, "type": { "type": "string", "title": "Type" }, "content": { "type": "string", "title": "Content" }, "ratingServiceWillingness": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Ratingservicewillingness" }, "ratingRevisitLikelihood": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Ratingrevisitlikelihood" }, "score": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Score" }, "aiScore": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Aiscore" }, "aiAnalysis": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Aianalysis" }, "taskId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Taskid" }, "createdAt": { "type": "string", "title": "Createdat" }, "updatedAt": { "type": "string", "title": "Updatedat" } }, "type": "object", "required": [ "id", "type", "content", "ratingServiceWillingness", "ratingRevisitLikelihood", "score", "aiScore", "aiAnalysis", "taskId", "createdAt", "updatedAt" ], "title": "NoteOut", "description": "备注输出模型(含评分 + AI 评分)。" }, "OverviewPanel": { "properties": { "occurrence": { "type": "number", "title": "Occurrence" }, "discount": { "type": "number", "title": "Discount" }, "discountRate": { "type": "number", "title": "Discountrate" }, "confirmedRevenue": { "type": "number", "title": "Confirmedrevenue" }, "cashIn": { "type": "number", "title": "Cashin" }, "cashOut": { "type": "number", "title": "Cashout" }, "cashBalance": { "type": "number", "title": "Cashbalance" }, "balanceRate": { "type": "number", "title": "Balancerate" }, "occurrenceCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Occurrencecompare" }, "occurrenceDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Occurrencedown" }, "occurrenceFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Occurrenceflat" }, "discountCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Discountcompare" }, "discountDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Discountdown" }, "discountFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Discountflat" }, "discountRateCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Discountratecompare" }, "discountRateDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Discountratedown" }, "discountRateFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Discountrateflat" }, "confirmedRevenueCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Confirmedrevenuecompare" }, "confirmedRevenueDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Confirmedrevenuedown" }, "confirmedRevenueFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Confirmedrevenueflat" }, "cashInCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cashincompare" }, "cashInDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Cashindown" }, "cashInFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Cashinflat" }, "cashOutCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cashoutcompare" }, "cashOutDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Cashoutdown" }, "cashOutFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Cashoutflat" }, "cashBalanceCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cashbalancecompare" }, "cashBalanceDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Cashbalancedown" }, "cashBalanceFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Cashbalanceflat" }, "balanceRateCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Balanceratecompare" }, "balanceRateDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Balanceratedown" }, "balanceRateFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Balancerateflat" } }, "type": "object", "required": [ "occurrence", "discount", "discountRate", "confirmedRevenue", "cashIn", "cashOut", "cashBalance", "balanceRate" ], "title": "OverviewPanel", "description": "经营一览:8 项核心指标 + 各 3 个环比字段(Optional,compare=0 时为 None)。" }, "PerformanceMetrics": { "properties": { "monthlyHours": { "type": "number", "title": "Monthlyhours" }, "monthlySalary": { "type": "number", "title": "Monthlysalary" }, "customerBalance": { "type": "number", "title": "Customerbalance" }, "tasksCompleted": { "type": "integer", "title": "Taskscompleted" }, "perfCurrent": { "type": "number", "title": "Perfcurrent" }, "perfTarget": { "type": "number", "title": "Perftarget" } }, "type": "object", "required": [ "monthlyHours", "monthlySalary", "customerBalance", "tasksCompleted", "perfCurrent", "perfTarget" ], "title": "PerformanceMetrics" }, "PerformanceOverviewResponse": { "properties": { "coachName": { "type": "string", "title": "Coachname" }, "coachRole": { "type": "string", "title": "Coachrole" }, "storeName": { "type": "string", "title": "Storename" }, "monthlyIncome": { "type": "string", "title": "Monthlyincome" }, "lastMonthIncome": { "type": "string", "title": "Lastmonthincome" }, "currentTier": { "$ref": "#/components/schemas/TierInfo" }, "nextTier": { "$ref": "#/components/schemas/TierInfo" }, "upgradeHoursNeeded": { "type": "number", "title": "Upgradehoursneeded" }, "upgradeBonus": { "type": "number", "title": "Upgradebonus" }, "incomeItems": { "items": { "$ref": "#/components/schemas/app__schemas__xcx_performance__IncomeItem" }, "type": "array", "title": "Incomeitems" }, "monthlyTotal": { "type": "string", "title": "Monthlytotal" }, "thisMonthRecords": { "items": { "$ref": "#/components/schemas/DateGroup" }, "type": "array", "title": "Thismonthrecords" }, "newCustomers": { "items": { "$ref": "#/components/schemas/NewCustomer" }, "type": "array", "title": "Newcustomers" }, "regularCustomers": { "items": { "$ref": "#/components/schemas/RegularCustomer" }, "type": "array", "title": "Regularcustomers" } }, "type": "object", "required": [ "coachName", "coachRole", "storeName", "monthlyIncome", "lastMonthIncome", "currentTier", "nextTier", "upgradeHoursNeeded", "upgradeBonus", "incomeItems", "monthlyTotal", "thisMonthRecords", "newCustomers", "regularCustomers" ], "title": "PerformanceOverviewResponse", "description": "PERF-1 响应。" }, "PerformanceRecordsResponse": { "properties": { "summary": { "$ref": "#/components/schemas/RecordsSummary" }, "dateGroups": { "items": { "$ref": "#/components/schemas/DateGroup" }, "type": "array", "title": "Dategroups" }, "hasMore": { "type": "boolean", "title": "Hasmore" } }, "type": "object", "required": [ "summary", "dateGroups", "hasMore" ], "title": "PerformanceRecordsResponse", "description": "PERF-2 响应。" }, "PerformanceSummary": { "properties": { "totalHours": { "type": "number", "title": "Totalhours" }, "totalIncome": { "type": "number", "title": "Totalincome" }, "totalCustomers": { "type": "integer", "title": "Totalcustomers" }, "monthLabel": { "type": "string", "title": "Monthlabel" }, "tierNodes": { "items": { "type": "number" }, "type": "array", "title": "Tiernodes" }, "basicHours": { "type": "number", "title": "Basichours" }, "bonusHours": { "type": "number", "title": "Bonushours" }, "currentTier": { "type": "integer", "title": "Currenttier" }, "nextTierHours": { "type": "number", "title": "Nexttierhours" }, "tierCompleted": { "type": "boolean", "title": "Tiercompleted" }, "bonusMoney": { "type": "number", "title": "Bonusmoney" }, "incomeTrend": { "type": "string", "title": "Incometrend" }, "incomeTrendDir": { "type": "string", "title": "Incometrenddir" }, "prevMonth": { "type": "string", "title": "Prevmonth" }, "currentTierLabel": { "type": "string", "title": "Currenttierlabel" } }, "type": "object", "required": [ "totalHours", "totalIncome", "totalCustomers", "monthLabel", "tierNodes", "basicHours", "bonusHours", "currentTier", "nextTierHours", "tierCompleted", "bonusMoney", "incomeTrend", "incomeTrendDir", "prevMonth", "currentTierLabel" ], "title": "PerformanceSummary", "description": "绩效概览(附带在任务列表响应中)。" }, "ProcessingModeDefinition": { "properties": { "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "description": { "type": "string", "title": "Description" } }, "type": "object", "required": [ "id", "name", "description" ], "title": "ProcessingModeDefinition", "description": "处理模式定义" }, "ProjectFilterEnum": { "type": "string", "enum": [ "ALL", "BILLIARD", "SNOOKER", "MAHJONG", "KTV" ], "title": "ProjectFilterEnum", "description": "BOARD-2 项目筛选(值与 dws.cfg_area_category.category_code 一致)。" }, "QueryRequest": { "properties": { "sql": { "type": "string", "title": "Sql" } }, "type": "object", "required": [ "sql" ], "title": "QueryRequest", "description": "SQL 查询请求。" }, "QueryResponse": { "properties": { "columns": { "items": { "type": "string" }, "type": "array", "title": "Columns" }, "rows": { "items": { "items": {}, "type": "array" }, "type": "array", "title": "Rows" }, "row_count": { "type": "integer", "title": "Row Count" } }, "type": "object", "required": [ "columns", "rows", "row_count" ], "title": "QueryResponse", "description": "SQL 查询响应。" }, "QueueTaskResponse": { "properties": { "id": { "type": "string", "title": "Id" }, "site_id": { "type": "integer", "title": "Site Id" }, "config": { "additionalProperties": true, "type": "object", "title": "Config" }, "status": { "type": "string", "title": "Status" }, "position": { "type": "integer", "title": "Position" }, "created_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Created At" }, "started_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Started At" }, "finished_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Finished At" }, "exit_code": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Exit Code" }, "error_message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error Message" } }, "type": "object", "required": [ "id", "site_id", "config", "status", "position" ], "title": "QueueTaskResponse", "description": "队列任务响应" }, "RecentRun": { "properties": { "id": { "type": "string", "title": "Id" }, "task_codes": { "items": { "type": "string" }, "type": "array", "title": "Task Codes" }, "status": { "type": "string", "title": "Status" }, "started_at": { "type": "string", "title": "Started At" }, "finished_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Finished At" }, "duration_ms": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Duration Ms" }, "exit_code": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Exit Code" } }, "type": "object", "required": [ "id", "task_codes", "status", "started_at" ], "title": "RecentRun", "description": "最近执行记录。" }, "RechargePanel": { "properties": { "actualIncome": { "type": "number", "title": "Actualincome" }, "firstCharge": { "type": "number", "title": "Firstcharge" }, "renewCharge": { "type": "number", "title": "Renewcharge" }, "consumed": { "type": "number", "title": "Consumed" }, "cardBalance": { "type": "number", "title": "Cardbalance" }, "giftRows": { "items": { "$ref": "#/components/schemas/GiftRow" }, "type": "array", "title": "Giftrows" }, "allCardBalance": { "type": "number", "title": "Allcardbalance" }, "actualIncomeCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Actualincomecompare" }, "actualIncomeDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Actualincomedown" }, "actualIncomeFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Actualincomeflat" }, "firstChargeCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Firstchargecompare" }, "firstChargeDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Firstchargedown" }, "firstChargeFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Firstchargeflat" }, "renewChargeCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Renewchargecompare" }, "renewChargeDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Renewchargedown" }, "renewChargeFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Renewchargeflat" }, "consumedCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Consumedcompare" }, "consumedDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Consumeddown" }, "consumedFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Consumedflat" }, "cardBalanceCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cardbalancecompare" }, "cardBalanceDown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Cardbalancedown" }, "cardBalanceFlat": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Cardbalanceflat" } }, "type": "object", "required": [ "actualIncome", "firstCharge", "renewCharge", "consumed", "cardBalance", "giftRows", "allCardBalance" ], "title": "RechargePanel", "description": "预收资产板块:储值卡 5 指标 + 赠送卡 3×4 矩阵 + 全卡余额。" }, "RecordsSummary": { "properties": { "totalCount": { "type": "integer", "title": "Totalcount" }, "totalHours": { "type": "number", "title": "Totalhours" }, "totalHoursRaw": { "type": "number", "title": "Totalhoursraw" }, "totalIncome": { "type": "number", "title": "Totalincome" } }, "type": "object", "required": [ "totalCount", "totalHours", "totalHoursRaw", "totalIncome" ], "title": "RecordsSummary", "description": "月度汇总。" }, "ReferenceCard": { "properties": { "type": { "type": "string", "title": "Type" }, "title": { "type": "string", "title": "Title" }, "summary": { "type": "string", "title": "Summary" }, "data": { "additionalProperties": { "type": "string" }, "type": "object", "title": "Data" } }, "type": "object", "required": [ "type", "title", "summary", "data" ], "title": "ReferenceCard", "description": "引用卡片,附加在 AI 回复消息中的结构化上下文数据。" }, "RefreshRequest": { "properties": { "refresh_token": { "type": "string", "minLength": 1, "title": "Refresh Token", "description": "刷新令牌" } }, "type": "object", "required": [ "refresh_token" ], "title": "RefreshRequest", "description": "刷新令牌请求。" }, "RefreshTokenRequest": { "properties": { "refreshToken": { "type": "string", "minLength": 1, "title": "Refreshtoken", "description": "刷新令牌" } }, "type": "object", "required": [ "refreshToken" ], "title": "RefreshTokenRequest", "description": "刷新令牌请求。" }, "RegularCustomer": { "properties": { "name": { "type": "string", "title": "Name" }, "avatarChar": { "type": "string", "title": "Avatarchar" }, "avatarColor": { "type": "string", "title": "Avatarcolor" }, "hours": { "type": "number", "title": "Hours" }, "income": { "type": "string", "title": "Income" }, "count": { "type": "integer", "title": "Count" } }, "type": "object", "required": [ "name", "avatarChar", "avatarColor", "hours", "income", "count" ], "title": "RegularCustomer", "description": "常客。" }, "ReorderRequest": { "properties": { "task_id": { "type": "string", "title": "Task Id" }, "new_position": { "type": "integer", "title": "New Position" } }, "type": "object", "required": [ "task_id", "new_position" ], "title": "ReorderRequest", "description": "队列重排请求" }, "ResetPasswordRequest": { "properties": { "newPassword": { "type": "string", "minLength": 1, "title": "Newpassword", "description": "新密码" } }, "type": "object", "required": [ "newPassword" ], "title": "ResetPasswordRequest", "description": "重置密码请求。" }, "Resolution": { "properties": { "rowIndex": { "type": "integer", "title": "Rowindex", "description": "行号" }, "action": { "type": "string", "enum": [ "replace", "keep" ], "title": "Action", "description": "操作:replace=替换/keep=保留" } }, "type": "object", "required": [ "rowIndex", "action" ], "title": "Resolution", "description": "单行冲突解决方案。" }, "RetentionClueOut": { "properties": { "id": { "type": "integer", "title": "Id" }, "member_id": { "type": "integer", "title": "Member Id" }, "category": { "$ref": "#/components/schemas/ClueCategory-Output" }, "summary": { "type": "string", "title": "Summary" }, "detail": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Detail" }, "recorded_by_assistant_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Recorded By Assistant Id" }, "recorded_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Recorded By Name" }, "recorded_at": { "type": "string", "format": "date-time", "title": "Recorded At" }, "site_id": { "type": "integer", "title": "Site Id" }, "source": { "$ref": "#/components/schemas/ClueSource", "default": "manual" } }, "type": "object", "required": [ "id", "member_id", "category", "summary", "detail", "recorded_by_assistant_id", "recorded_by_name", "recorded_at", "site_id" ], "title": "RetentionClueOut", "description": "维客线索返回模型。" }, "RetentionClueSubmit": { "properties": { "member_id": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Member Id", "description": "会员 ID" }, "category": { "$ref": "#/components/schemas/app__schemas__member_retention_clue__ClueCategory", "description": "线索大类" }, "summary": { "type": "string", "maxLength": 200, "minLength": 1, "title": "Summary", "description": "摘要:重点信息" }, "detail": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ], "title": "Detail", "description": "详情:分析及扩展说明,可为空" }, "recorded_by_assistant_id": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Recorded By Assistant Id", "description": "记录助教 ID" }, "recorded_by_name": { "type": "string", "maxLength": 50, "minLength": 1, "title": "Recorded By Name", "description": "记录助教姓名" }, "site_id": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Site Id", "description": "门店 ID" }, "source": { "$ref": "#/components/schemas/ClueSource", "description": "线索来源", "default": "manual" } }, "type": "object", "required": [ "member_id", "category", "summary", "recorded_by_assistant_id", "recorded_by_name", "site_id" ], "title": "RetentionClueSubmit", "description": "提交维客线索请求。" }, "RetryResponse": { "properties": { "trigger_job_id": { "type": "integer", "title": "Trigger Job Id" }, "status": { "type": "string", "title": "Status" } }, "type": "object", "required": [ "trigger_job_id", "status" ], "title": "RetryResponse", "description": "手动重跑响应。" }, "RevenueItem": { "properties": { "label": { "type": "string", "title": "Label" }, "amount": { "type": "number", "title": "Amount" } }, "type": "object", "required": [ "label", "amount" ], "title": "RevenueItem" }, "RevenuePanel": { "properties": { "structureRows": { "items": { "$ref": "#/components/schemas/RevenueStructureRow" }, "type": "array", "title": "Structurerows" }, "priceItems": { "items": { "$ref": "#/components/schemas/RevenueItem" }, "type": "array", "title": "Priceitems" }, "totalOccurrence": { "type": "number", "title": "Totaloccurrence" }, "discountItems": { "items": { "$ref": "#/components/schemas/RevenueItem" }, "type": "array", "title": "Discountitems" }, "confirmedTotal": { "type": "number", "title": "Confirmedtotal" }, "channelItems": { "items": { "$ref": "#/components/schemas/ChannelItem" }, "type": "array", "title": "Channelitems" } }, "type": "object", "required": [ "structureRows", "priceItems", "totalOccurrence", "discountItems", "confirmedTotal", "channelItems" ], "title": "RevenuePanel" }, "RevenueStructureRow": { "properties": { "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "desc": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Desc" }, "isSub": { "type": "boolean", "title": "Issub", "default": false }, "amount": { "type": "number", "title": "Amount" }, "discount": { "type": "number", "title": "Discount" }, "booked": { "type": "number", "title": "Booked" }, "bookedCompare": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Bookedcompare" } }, "type": "object", "required": [ "id", "name", "amount", "discount", "booked" ], "title": "RevenueStructureRow" }, "RunLogDetailResponse": { "properties": { "id": { "type": "integer", "title": "Id" }, "app_type": { "type": "string", "title": "App Type" }, "trigger_type": { "type": "string", "title": "Trigger Type" }, "member_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Member Id" }, "tokens_used": { "type": "integer", "title": "Tokens Used" }, "latency_ms": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Latency Ms" }, "status": { "type": "string", "title": "Status" }, "site_id": { "type": "integer", "title": "Site Id" }, "created_at": { "type": "string", "title": "Created At" }, "request_prompt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Request Prompt" }, "response_text": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Response Text" }, "error_message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error Message" }, "session_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" }, "finished_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Finished At" } }, "type": "object", "required": [ "id", "app_type", "trigger_type", "member_id", "tokens_used", "latency_ms", "status", "site_id", "created_at", "request_prompt", "response_text", "error_message", "session_id", "finished_at" ], "title": "RunLogDetailResponse", "description": "调用记录详情响应(含完整 prompt/response,不脱敏)。" }, "RunLogItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "app_type": { "type": "string", "title": "App Type" }, "trigger_type": { "type": "string", "title": "Trigger Type" }, "member_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Member Id" }, "tokens_used": { "type": "integer", "title": "Tokens Used" }, "latency_ms": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Latency Ms" }, "status": { "type": "string", "title": "Status" }, "site_id": { "type": "integer", "title": "Site Id" }, "created_at": { "type": "string", "title": "Created At" } }, "type": "object", "required": [ "id", "app_type", "trigger_type", "member_id", "tokens_used", "latency_ms", "status", "site_id", "created_at" ], "title": "RunLogItem", "description": "调用记录列表项。" }, "RunLogListResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/RunLogItem" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "page": { "type": "integer", "title": "Page" }, "page_size": { "type": "integer", "title": "Page Size" } }, "type": "object", "required": [ "items", "total", "page", "page_size" ], "title": "RunLogListResponse", "description": "调用记录分页列表响应。" }, "ScheduleConfigSchema": { "properties": { "schedule_type": { "type": "string", "enum": [ "once", "interval", "daily", "weekly", "cron" ], "title": "Schedule Type" }, "interval_value": { "type": "integer", "title": "Interval Value", "default": 1 }, "interval_unit": { "type": "string", "enum": [ "minutes", "hours", "days" ], "title": "Interval Unit", "default": "hours" }, "daily_time": { "type": "string", "title": "Daily Time", "default": "04:00" }, "weekly_days": { "items": { "type": "integer" }, "type": "array", "title": "Weekly Days", "default": [ 1 ] }, "weekly_time": { "type": "string", "title": "Weekly Time", "default": "04:00" }, "cron_expression": { "type": "string", "title": "Cron Expression", "default": "0 4 * * *" }, "enabled": { "type": "boolean", "title": "Enabled", "default": true }, "start_date": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Start Date" }, "end_date": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "End Date" } }, "type": "object", "required": [ "schedule_type" ], "title": "ScheduleConfigSchema", "description": "调度配置 — 支持 5 种调度类型" }, "ScheduleResponse": { "properties": { "id": { "type": "string", "title": "Id" }, "site_id": { "type": "integer", "title": "Site Id" }, "name": { "type": "string", "title": "Name" }, "task_codes": { "items": { "type": "string" }, "type": "array", "title": "Task Codes" }, "task_config": { "additionalProperties": true, "type": "object", "title": "Task Config" }, "schedule_config": { "additionalProperties": true, "type": "object", "title": "Schedule Config" }, "enabled": { "type": "boolean", "title": "Enabled" }, "last_run_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Last Run At" }, "next_run_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Next Run At" }, "run_count": { "type": "integer", "title": "Run Count" }, "last_status": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Last Status" }, "min_run_interval_value": { "type": "integer", "title": "Min Run Interval Value", "default": 0 }, "min_run_interval_unit": { "type": "string", "title": "Min Run Interval Unit", "default": "minutes" }, "last_success_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Last Success At" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" }, "updated_at": { "type": "string", "format": "date-time", "title": "Updated At" } }, "type": "object", "required": [ "id", "site_id", "name", "task_codes", "task_config", "schedule_config", "enabled", "run_count", "created_at", "updated_at" ], "title": "ScheduleResponse", "description": "调度任务响应" }, "SchemaInfo": { "properties": { "name": { "type": "string", "title": "Name" } }, "type": "object", "required": [ "name" ], "title": "SchemaInfo", "description": "Schema 信息。" }, "SendMessageRequest": { "properties": { "content": { "type": "string", "title": "Content" } }, "type": "object", "required": [ "content" ], "title": "SendMessageRequest", "description": "CHAT-3 发送消息请求体。" }, "SendMessageResponse": { "properties": { "userMessage": { "$ref": "#/components/schemas/MessageBrief" }, "aiReply": { "$ref": "#/components/schemas/MessageBrief" } }, "type": "object", "required": [ "userMessage", "aiReply" ], "title": "SendMessageResponse", "description": "CHAT-3 发送消息响应(含用户消息和 AI 回复)。" }, "ServiceActionResult": { "properties": { "env": { "type": "string", "title": "Env" }, "action": { "type": "string", "title": "Action" }, "success": { "type": "boolean", "title": "Success" }, "message": { "type": "string", "title": "Message" } }, "type": "object", "required": [ "env", "action", "success", "message" ], "title": "ServiceActionResult" }, "ServiceRecord": { "properties": { "table": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Table" }, "type": { "type": "string", "title": "Type" }, "typeClass": { "type": "string", "title": "Typeclass" }, "recordType": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Recordtype" }, "duration": { "type": "number", "title": "Duration" }, "durationRaw": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Durationraw" }, "income": { "type": "number", "title": "Income" }, "isEstimate": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Isestimate" }, "drinks": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Drinks" }, "date": { "type": "string", "title": "Date" } }, "type": "object", "required": [ "type", "typeClass", "duration", "income", "date" ], "title": "ServiceRecord", "description": "服务记录。" }, "ServiceRecordItem": { "properties": { "id": { "type": "string", "title": "Id" }, "date": { "type": "string", "title": "Date" }, "timeRange": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Timerange" }, "table": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Table" }, "type": { "type": "string", "title": "Type" }, "typeClass": { "type": "string", "title": "Typeclass" }, "recordType": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Recordtype" }, "duration": { "type": "number", "title": "Duration" }, "durationRaw": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Durationraw" }, "income": { "type": "number", "title": "Income" }, "isEstimate": { "type": "boolean", "title": "Isestimate", "default": false }, "drinks": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Drinks" } }, "type": "object", "required": [ "id", "date", "type", "typeClass", "duration", "income" ], "title": "ServiceRecordItem" }, "ServiceStatus": { "properties": { "env": { "type": "string", "title": "Env" }, "label": { "type": "string", "title": "Label" }, "running": { "type": "boolean", "title": "Running" }, "pid": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Pid" }, "port": { "type": "integer", "title": "Port" }, "uptime_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Uptime Seconds" }, "memory_mb": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Memory Mb" }, "cpu_percent": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Cpu Percent" } }, "type": "object", "required": [ "env", "label", "running", "port" ], "title": "ServiceStatus" }, "ServiceSummary": { "properties": { "totalHours": { "type": "number", "title": "Totalhours" }, "totalIncome": { "type": "number", "title": "Totalincome" }, "avgIncome": { "type": "number", "title": "Avgincome" } }, "type": "object", "required": [ "totalHours", "totalIncome", "avgIncome" ], "title": "ServiceSummary", "description": "服务记录摘要。" }, "SettingsUpdate": { "properties": { "enabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Enabled" }, "retention_days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Retention Days" }, "log_sql": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Log Sql" }, "log_params": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Log Params" } }, "type": "object", "title": "SettingsUpdate", "description": "运行时设置更新请求体(所有字段可选)。" }, "SiteAdminCreateRequest": { "properties": { "username": { "type": "string", "maxLength": 56, "title": "Username", "description": "用户名(site_code 前缀 + 最长 50 字符)" }, "password": { "type": "string", "minLength": 6, "title": "Password", "description": "初始密码" }, "displayName": { "anyOf": [ { "type": "string", "maxLength": 100 }, { "type": "null" } ], "title": "Displayname", "description": "显示名称" }, "managedSiteIds": { "items": { "type": "integer" }, "type": "array", "minItems": 1, "title": "Managedsiteids", "description": "管辖门店 ID 列表" } }, "type": "object", "required": [ "username", "password", "managedSiteIds" ], "title": "SiteAdminCreateRequest", "description": "创建店铺管理员请求。" }, "SiteAdminEditRequest": { "properties": { "displayName": { "anyOf": [ { "type": "string", "maxLength": 100 }, { "type": "null" } ], "title": "Displayname" }, "managedSiteIds": { "anyOf": [ { "items": { "type": "integer" }, "type": "array", "minItems": 1 }, { "type": "null" } ], "title": "Managedsiteids" }, "isActive": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Isactive" } }, "type": "object", "title": "SiteAdminEditRequest", "description": "编辑店铺管理员请求。" }, "SiteAdminResetPasswordRequest": { "properties": { "newPassword": { "type": "string", "minLength": 6, "title": "Newpassword" } }, "type": "object", "required": [ "newPassword" ], "title": "SiteAdminResetPasswordRequest", "description": "重置密码请求。" }, "SiteCodeHistoryItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "siteCode": { "type": "string", "title": "Sitecode" }, "isCurrent": { "type": "boolean", "title": "Iscurrent" }, "createdAt": { "type": "string", "format": "date-time", "title": "Createdat" }, "retiredAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Retiredat" } }, "type": "object", "required": [ "id", "siteCode", "isCurrent", "createdAt" ], "title": "SiteCodeHistoryItem", "description": "简写ID 变更历史条目。" }, "SiteCodeResult": { "properties": { "siteId": { "type": "integer", "title": "Siteid" }, "oldCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Oldcode" }, "newCode": { "type": "string", "title": "Newcode" }, "historyCleaned": { "type": "boolean", "title": "Historycleaned" } }, "type": "object", "required": [ "siteId", "newCode", "historyCleaned" ], "title": "SiteCodeResult", "description": "简写ID 修改结果。" }, "SiteInfo": { "properties": { "siteId": { "type": "integer", "title": "Siteid" }, "siteName": { "type": "string", "title": "Sitename" }, "roles": { "items": { "additionalProperties": true, "type": "object" }, "type": "array", "title": "Roles", "default": [] } }, "type": "object", "required": [ "siteId", "siteName" ], "title": "SiteInfo", "description": "店铺信息。" }, "SiteItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "siteId": { "type": "integer", "title": "Siteid" }, "siteName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Sitename" }, "siteCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Sitecode" }, "siteLabel": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Sitelabel" }, "isActive": { "type": "boolean", "title": "Isactive" } }, "type": "object", "required": [ "id", "siteId", "isActive" ], "title": "SiteItem", "description": "店铺列表项。" }, "SiteSyncResult": { "properties": { "inserted": { "type": "integer", "title": "Inserted" }, "updated": { "type": "integer", "title": "Updated" } }, "type": "object", "required": [ "inserted", "updated" ], "title": "SiteSyncResult", "description": "店铺同步结果。" }, "SkillFilterEnum": { "type": "string", "enum": [ "ALL", "BILLIARD", "SNOOKER", "MAHJONG", "KTV" ], "title": "SkillFilterEnum", "description": "BOARD-1 技能筛选(值与 dws.cfg_area_category.category_code 一致)。" }, "SkillTypeItem": { "properties": { "key": { "type": "string", "title": "Key" }, "label": { "type": "string", "title": "Label" }, "emoji": { "type": "string", "title": "Emoji" }, "cls": { "type": "string", "title": "Cls" } }, "type": "object", "required": [ "key", "label", "emoji", "cls" ], "title": "SkillTypeItem", "description": "项目类型筛选器选项。\n\nkey 值与 dws.cfg_area_category.category_code 一致\n(BILLIARD/SNOOKER/MAHJONG/KTV),\"不限\"选项 key=\"ALL\"。" }, "SwitchSiteRequest": { "properties": { "siteId": { "type": "integer", "title": "Siteid" } }, "type": "object", "required": [ "siteId" ], "title": "SwitchSiteRequest", "description": "切换店铺请求。" }, "SyncCheckResponse": { "properties": { "in_sync": { "type": "boolean", "title": "In Sync" }, "backend_only": { "items": { "type": "string" }, "type": "array", "title": "Backend Only" }, "etl_only": { "items": { "type": "string" }, "type": "array", "title": "Etl Only" }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } }, "type": "object", "required": [ "in_sync", "backend_only", "etl_only" ], "title": "SyncCheckResponse", "description": "同步检查结果" }, "SystemInfo": { "properties": { "cpu_percent": { "type": "number", "title": "Cpu Percent" }, "memory_total_gb": { "type": "number", "title": "Memory Total Gb" }, "memory_used_gb": { "type": "number", "title": "Memory Used Gb" }, "memory_percent": { "type": "number", "title": "Memory Percent" }, "disk_total_gb": { "type": "number", "title": "Disk Total Gb" }, "disk_used_gb": { "type": "number", "title": "Disk Used Gb" }, "disk_percent": { "type": "number", "title": "Disk Percent" }, "boot_time": { "type": "string", "title": "Boot Time" } }, "type": "object", "required": [ "cpu_percent", "memory_total_gb", "memory_used_gb", "memory_percent", "disk_total_gb", "disk_used_gb", "disk_percent", "boot_time" ], "title": "SystemInfo" }, "TableInfo": { "properties": { "name": { "type": "string", "title": "Name" }, "row_count": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Row Count" } }, "type": "object", "required": [ "name" ], "title": "TableInfo", "description": "表信息(含行数统计)。" }, "TaskConfigSchema": { "properties": { "tasks": { "items": { "type": "string" }, "type": "array", "title": "Tasks" }, "flow": { "type": "string", "title": "Flow", "default": "api_ods_dwd" }, "processing_mode": { "type": "string", "title": "Processing Mode", "default": "increment_only" }, "dry_run": { "type": "boolean", "title": "Dry Run", "default": false }, "window_mode": { "type": "string", "title": "Window Mode", "default": "lookback" }, "window_start": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Window Start" }, "window_end": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Window End" }, "window_split": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Window Split" }, "window_split_days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Window Split Days" }, "lookback_hours": { "type": "integer", "title": "Lookback Hours", "default": 24 }, "overlap_seconds": { "type": "integer", "title": "Overlap Seconds", "default": 600 }, "fetch_before_verify": { "type": "boolean", "title": "Fetch Before Verify", "default": false }, "skip_ods_when_fetch_before_verify": { "type": "boolean", "title": "Skip Ods When Fetch Before Verify", "default": false }, "ods_use_local_json": { "type": "boolean", "title": "Ods Use Local Json", "default": false }, "store_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Store Id" }, "dwd_only_tables": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Dwd Only Tables" }, "force_full": { "type": "boolean", "title": "Force Full", "default": false }, "pipeline_workers": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Pipeline Workers" }, "pipeline_batch_size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Pipeline Batch Size" }, "pipeline_rate_min": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Pipeline Rate Min" }, "pipeline_rate_max": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Pipeline Rate Max" }, "extra_args": { "additionalProperties": true, "type": "object", "title": "Extra Args", "default": {} } }, "type": "object", "required": [ "tasks" ], "title": "TaskConfigSchema", "description": "任务配置 — 前后端传输格式\n\n字段与 CLI 参数的映射关系:\n- flow → --flow(Flow ID,7 种之一)\n- processing_mode → --processing-mode(4 种处理模式)\n- tasks → --tasks(逗号分隔)\n- dry_run → --dry-run(布尔标志)\n- window_mode → 决定使用 lookback 还是 custom 时间窗口(仅前端逻辑,不直接映射 CLI 参数)\n- window_start → --window-start\n- window_end → --window-end\n- window_split → --window-split\n- window_split_days → --window-split-days\n- lookback_hours → --lookback-hours\n- overlap_seconds → --overlap-seconds\n- fetch_before_verify → --fetch-before-verify(布尔标志)\n- store_id → --store-id(由后端从 JWT 注入,前端不传)\n- dwd_only_tables → 传入 extra_args 或未来扩展" }, "TaskDetailResponse": { "properties": { "id": { "type": "integer", "title": "Id" }, "customerName": { "type": "string", "title": "Customername" }, "customerAvatar": { "type": "string", "title": "Customeravatar" }, "taskType": { "type": "string", "title": "Tasktype" }, "taskTypeLabel": { "type": "string", "title": "Tasktypelabel" }, "deadline": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Deadline" }, "heartScore": { "type": "number", "title": "Heartscore" }, "hobbies": { "items": { "type": "string" }, "type": "array", "title": "Hobbies" }, "isPinned": { "type": "boolean", "title": "Ispinned" }, "hasNote": { "type": "boolean", "title": "Hasnote" }, "status": { "type": "string", "title": "Status" }, "customerId": { "type": "integer", "title": "Customerid" }, "retentionClues": { "items": { "$ref": "#/components/schemas/app__schemas__xcx_tasks__RetentionClue" }, "type": "array", "title": "Retentionclues" }, "talkingPoints": { "items": { "type": "string" }, "type": "array", "title": "Talkingpoints" }, "serviceSummary": { "$ref": "#/components/schemas/ServiceSummary" }, "serviceRecords": { "items": { "$ref": "#/components/schemas/ServiceRecord" }, "type": "array", "title": "Servicerecords" }, "aiAnalysis": { "$ref": "#/components/schemas/AiAnalysis" }, "notes": { "items": { "$ref": "#/components/schemas/NoteItem" }, "type": "array", "title": "Notes" } }, "type": "object", "required": [ "id", "customerName", "customerAvatar", "taskType", "taskTypeLabel", "deadline", "heartScore", "hobbies", "isPinned", "hasNote", "status", "customerId", "retentionClues", "talkingPoints", "serviceSummary", "serviceRecords", "aiAnalysis", "notes" ], "title": "TaskDetailResponse", "description": "TASK-2 响应。" }, "TaskListResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/app__schemas__xcx_tasks__TaskItem" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "page": { "type": "integer", "title": "Page" }, "pageSize": { "type": "integer", "title": "Pagesize" }, "performance": { "$ref": "#/components/schemas/PerformanceSummary" } }, "type": "object", "required": [ "items", "total", "page", "pageSize", "performance" ], "title": "TaskListResponse", "description": "TASK-1 响应。" }, "TaskRegistryResponse": { "properties": { "groups": { "additionalProperties": { "items": { "$ref": "#/components/schemas/app__routers__tasks__TaskItem" }, "type": "array" }, "type": "object", "title": "Groups" } }, "type": "object", "required": [ "groups" ], "title": "TaskRegistryResponse", "description": "按业务域分组的任务列表" }, "TenantAdminCreateRequest": { "properties": { "username": { "type": "string", "maxLength": 100, "minLength": 1, "title": "Username", "description": "用户名" }, "password": { "type": "string", "minLength": 1, "title": "Password", "description": "初始密码" }, "displayName": { "anyOf": [ { "type": "string", "maxLength": 100 }, { "type": "null" } ], "title": "Displayname", "description": "显示名称" }, "tenantId": { "type": "integer", "title": "Tenantid", "description": "所属租户 ID(来源: biz.tenants)" }, "managedSiteIds": { "items": { "type": "integer" }, "type": "array", "minItems": 1, "title": "Managedsiteids", "description": "管辖门店 ID 列表" } }, "type": "object", "required": [ "username", "password", "tenantId", "managedSiteIds" ], "title": "TenantAdminCreateRequest", "description": "创建租户管理员请求。" }, "TenantAdminEditRequest": { "properties": { "username": { "anyOf": [ { "type": "string", "maxLength": 100, "minLength": 1 }, { "type": "null" } ], "title": "Username", "description": "用户名(需全局唯一)" }, "displayName": { "anyOf": [ { "type": "string", "maxLength": 100 }, { "type": "null" } ], "title": "Displayname", "description": "显示名称" }, "managedSiteIds": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "title": "Managedsiteids", "description": "管辖门店 ID 列表" }, "isActive": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Isactive", "description": "账号状态" } }, "type": "object", "title": "TenantAdminEditRequest", "description": "编辑租户管理员请求(所有字段可选)。" }, "TenantItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "tenantId": { "type": "integer", "title": "Tenantid" }, "tenantName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Tenantname" }, "connectorName": { "type": "string", "title": "Connectorname" }, "isActive": { "type": "boolean", "title": "Isactive" } }, "type": "object", "required": [ "id", "tenantId", "connectorName", "isActive" ], "title": "TenantItem", "description": "租户列表项(含连接器名称)。" }, "TenantLoginRequest": { "properties": { "username": { "type": "string", "maxLength": 100, "minLength": 1, "title": "Username", "description": "用户名" }, "password": { "type": "string", "minLength": 1, "title": "Password", "description": "密码" } }, "type": "object", "required": [ "username", "password" ], "title": "TenantLoginRequest", "description": "租户管理员登录请求。" }, "TenantRefreshRequest": { "properties": { "refresh_token": { "type": "string", "minLength": 1, "title": "Refresh Token", "description": "刷新令牌" } }, "type": "object", "required": [ "refresh_token" ], "title": "TenantRefreshRequest", "description": "刷新令牌请求。" }, "TenantTokenResponse": { "properties": { "access_token": { "type": "string", "title": "Access Token" }, "refresh_token": { "type": "string", "title": "Refresh Token" }, "token_type": { "type": "string", "title": "Token Type", "default": "bearer" } }, "type": "object", "required": [ "access_token", "refresh_token" ], "title": "TenantTokenResponse", "description": "令牌响应。" }, "TierInfo": { "properties": { "basicRate": { "type": "number", "title": "Basicrate" }, "incentiveRate": { "type": "number", "title": "Incentiverate" } }, "type": "object", "required": [ "basicRate", "incentiveRate" ], "title": "TierInfo", "description": "档位信息(含基础/激励费率)。" }, "TokenResponse": { "properties": { "access_token": { "type": "string", "title": "Access Token" }, "refresh_token": { "type": "string", "title": "Refresh Token" }, "token_type": { "type": "string", "title": "Token Type", "default": "bearer" } }, "type": "object", "required": [ "access_token", "refresh_token" ], "title": "TokenResponse", "description": "令牌响应。" }, "TopCustomer": { "properties": { "id": { "type": "integer", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "initial": { "type": "string", "title": "Initial" }, "avatarGradient": { "type": "string", "title": "Avatargradient" }, "heartEmoji": { "type": "string", "title": "Heartemoji" }, "score": { "type": "string", "title": "Score" }, "scoreColor": { "type": "string", "title": "Scorecolor" }, "serviceCount": { "type": "integer", "title": "Servicecount" }, "balance": { "type": "string", "title": "Balance" }, "consume": { "type": "string", "title": "Consume" } }, "type": "object", "required": [ "id", "name", "initial", "avatarGradient", "heartEmoji", "score", "scoreColor", "serviceCount", "balance", "consume" ], "title": "TopCustomer" }, "TriggerJobDetailResponse": { "properties": { "id": { "type": "integer", "title": "Id" }, "event_type": { "type": "string", "title": "Event Type" }, "member_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Member Id" }, "status": { "type": "string", "title": "Status" }, "app_chain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "App Chain" }, "is_forced": { "type": "boolean", "title": "Is Forced" }, "site_id": { "type": "integer", "title": "Site Id" }, "started_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Started At" }, "finished_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Finished At" }, "created_at": { "type": "string", "title": "Created At" }, "payload": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Payload" }, "error_message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error Message" }, "connector_type": { "type": "string", "title": "Connector Type" } }, "type": "object", "required": [ "id", "event_type", "member_id", "status", "app_chain", "is_forced", "site_id", "started_at", "finished_at", "created_at", "payload", "error_message", "connector_type" ], "title": "TriggerJobDetailResponse", "description": "调度任务详情响应(含 payload、error_message)。" }, "TriggerJobItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "event_type": { "type": "string", "title": "Event Type" }, "member_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Member Id" }, "status": { "type": "string", "title": "Status" }, "app_chain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "App Chain" }, "is_forced": { "type": "boolean", "title": "Is Forced" }, "site_id": { "type": "integer", "title": "Site Id" }, "started_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Started At" }, "finished_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Finished At" }, "created_at": { "type": "string", "title": "Created At" } }, "type": "object", "required": [ "id", "event_type", "member_id", "status", "app_chain", "is_forced", "site_id", "started_at", "finished_at", "created_at" ], "title": "TriggerJobItem", "description": "调度任务列表项。" }, "TriggerJobListResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/TriggerJobItem" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "page": { "type": "integer", "title": "Page" }, "page_size": { "type": "integer", "title": "Page Size" }, "today_skipped_duplicates": { "type": "integer", "title": "Today Skipped Duplicates" } }, "type": "object", "required": [ "items", "total", "page", "page_size", "today_skipped_duplicates" ], "title": "TriggerJobListResponse", "description": "调度任务分页列表响应。" }, "TriggerRequest": { "properties": { "event_type": { "type": "string", "title": "Event Type", "description": "事件类型: consumption / dws_completed / note_created / task_assigned" }, "connector_type": { "type": "string", "title": "Connector Type", "description": "连接器类型", "default": "feiqiu" }, "site_id": { "type": "integer", "title": "Site Id", "description": "门店 ID" }, "member_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Member Id", "description": "会员 ID(可选)" }, "payload": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Payload", "description": "附加数据" }, "is_forced": { "type": "boolean", "title": "Is Forced", "description": "是否强制执行(跳过去重)", "default": false } }, "type": "object", "required": [ "event_type", "site_id" ], "title": "TriggerRequest", "description": "内部触发请求体。" }, "TriggerResponse": { "properties": { "trigger_job_id": { "type": "integer", "title": "Trigger Job Id" }, "status": { "type": "string", "title": "Status", "default": "pending" } }, "type": "object", "required": [ "trigger_job_id" ], "title": "TriggerResponse", "description": "触发响应。" }, "UpdateScheduleRequest": { "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "task_codes": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Task Codes" }, "task_config": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Task Config" }, "schedule_config": { "anyOf": [ { "$ref": "#/components/schemas/ScheduleConfigSchema" }, { "type": "null" } ] }, "min_run_interval_value": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Min Run Interval Value" }, "min_run_interval_unit": { "anyOf": [ { "type": "string", "enum": [ "minutes", "hours", "days" ] }, { "type": "null" } ], "title": "Min Run Interval Unit" } }, "type": "object", "title": "UpdateScheduleRequest", "description": "更新调度任务请求(所有字段可选)" }, "UpdateSiteCodeRequest": { "properties": { "newCode": { "type": "string", "title": "Newcode" } }, "type": "object", "required": [ "newCode" ], "title": "UpdateSiteCodeRequest", "description": "设置/修改店铺简写ID 请求。" }, "UserBindingRequest": { "properties": { "assistantId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Assistantid", "description": "关联助教 ID" }, "staffId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Staffid", "description": "关联员工 ID" } }, "type": "object", "title": "UserBindingRequest", "description": "用户绑定修改请求。" }, "UserEditRequest": { "properties": { "role": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Role", "description": "新角色" }, "siteId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Siteid", "description": "新门店 ID" } }, "type": "object", "title": "UserEditRequest", "description": "用户编辑请求。" }, "UserStatusResponse": { "properties": { "userId": { "type": "integer", "title": "Userid" }, "status": { "type": "string", "title": "Status" }, "nickname": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Nickname" }, "role": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Role" }, "applications": { "items": { "$ref": "#/components/schemas/ApplicationResponse" }, "type": "array", "title": "Applications", "default": [] }, "latestApplication": { "anyOf": [ { "$ref": "#/components/schemas/LatestApplicationDetail" }, { "type": "null" } ] } }, "type": "object", "required": [ "userId", "status" ], "title": "UserStatusResponse", "description": "用户状态查询响应。" }, "ValidateRequest": { "properties": { "config": { "$ref": "#/components/schemas/TaskConfigSchema" } }, "type": "object", "required": [ "config" ], "title": "ValidateRequest", "description": "验证请求体 — 复用 TaskConfigSchema,但 store_id 由后端注入" }, "ValidateResponse": { "properties": { "valid": { "type": "boolean", "title": "Valid" }, "command": { "type": "string", "title": "Command" }, "command_args": { "items": { "type": "string" }, "type": "array", "title": "Command Args" }, "errors": { "items": { "type": "string" }, "type": "array", "title": "Errors" } }, "type": "object", "required": [ "valid", "command", "command_args", "errors" ], "title": "ValidateResponse", "description": "验证结果 + CLI 命令预览" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" }, "input": { "title": "Input" }, "ctx": { "type": "object", "title": "Context" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" }, "WxLoginRequest": { "properties": { "code": { "type": "string", "minLength": 1, "title": "Code", "description": "微信临时登录凭证" } }, "type": "object", "required": [ "code" ], "title": "WxLoginRequest", "description": "微信登录请求。" }, "WxLoginResponse": { "properties": { "accessToken": { "type": "string", "title": "Accesstoken" }, "refreshToken": { "type": "string", "title": "Refreshtoken" }, "tokenType": { "type": "string", "title": "Tokentype", "default": "bearer" }, "userStatus": { "type": "string", "title": "Userstatus" }, "userId": { "type": "integer", "title": "Userid" }, "role": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Role" } }, "type": "object", "required": [ "accessToken", "refreshToken", "userStatus", "userId" ], "title": "WxLoginResponse", "description": "微信登录响应。" }, "app__routers__tasks__TaskItem": { "properties": { "code": { "type": "string", "title": "Code" }, "name": { "type": "string", "title": "Name" }, "description": { "type": "string", "title": "Description" }, "domain": { "type": "string", "title": "Domain" }, "layer": { "type": "string", "title": "Layer" }, "requires_window": { "type": "boolean", "title": "Requires Window" }, "is_ods": { "type": "boolean", "title": "Is Ods" }, "is_dimension": { "type": "boolean", "title": "Is Dimension" }, "default_enabled": { "type": "boolean", "title": "Default Enabled" }, "is_common": { "type": "boolean", "title": "Is Common" } }, "type": "object", "required": [ "code", "name", "description", "domain", "layer", "requires_window", "is_ods", "is_dimension", "default_enabled", "is_common" ], "title": "TaskItem" }, "app__schemas__member_retention_clue__ClueCategory": { "type": "string", "enum": [ "客户基础信息", "消费习惯", "玩法偏好", "促销偏好", "社交关系", "重要反馈" ], "title": "ClueCategory", "description": "维客线索大类枚举" }, "app__schemas__tenant_clues__ClueCategory": { "type": "string", "enum": [ "客户基础", "消费习惯", "玩法偏好", "促销偏好", "社交关系", "重要反馈" ], "title": "ClueCategory", "description": "线索大类枚举(6 值)。" }, "app__schemas__tenant_users__ApproveRequest": { "properties": { "role": { "type": "string", "minLength": 1, "title": "Role", "description": "分配角色(coach/staff/head_coach/manager)" }, "assistantId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Assistantid", "description": "关联助教 ID" }, "staffId": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Staffid", "description": "关联员工 ID" } }, "type": "object", "required": [ "role" ], "title": "ApproveRequest", "description": "审核通过请求。" }, "app__schemas__tenant_users__RejectRequest": { "properties": { "reason": { "type": "string", "minLength": 1, "title": "Reason", "description": "拒绝原因" } }, "type": "object", "required": [ "reason" ], "title": "RejectRequest", "description": "审核拒绝请求。" }, "app__schemas__xcx_auth__ApproveRequest": { "properties": { "roleId": { "type": "integer", "title": "Roleid" }, "binding": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Binding" }, "reviewNote": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reviewnote" } }, "type": "object", "required": [ "roleId" ], "title": "ApproveRequest", "description": "批准申请请求。" }, "app__schemas__xcx_auth__RejectRequest": { "properties": { "reviewNote": { "type": "string", "minLength": 1, "title": "Reviewnote", "description": "拒绝原因" } }, "type": "object", "required": [ "reviewNote" ], "title": "RejectRequest", "description": "拒绝申请请求。" }, "app__schemas__xcx_coaches__IncomeItem": { "properties": { "label": { "type": "string", "title": "Label" }, "amount": { "type": "string", "title": "Amount" }, "color": { "type": "string", "title": "Color" } }, "type": "object", "required": [ "label", "amount", "color" ], "title": "IncomeItem" }, "app__schemas__xcx_customers__RetentionClue": { "properties": { "type": { "type": "string", "title": "Type" }, "text": { "type": "string", "title": "Text" } }, "type": "object", "required": [ "type", "text" ], "title": "RetentionClue" }, "app__schemas__xcx_performance__IncomeItem": { "properties": { "icon": { "type": "string", "title": "Icon" }, "label": { "type": "string", "title": "Label" }, "desc": { "type": "string", "title": "Desc" }, "value": { "type": "string", "title": "Value" } }, "type": "object", "required": [ "icon", "label", "desc", "value" ], "title": "IncomeItem", "description": "收入明细项。" }, "app__schemas__xcx_tasks__RetentionClue": { "properties": { "tag": { "type": "string", "title": "Tag" }, "tagColor": { "type": "string", "title": "Tagcolor" }, "emoji": { "type": "string", "title": "Emoji" }, "text": { "type": "string", "title": "Text" }, "source": { "type": "string", "title": "Source" }, "desc": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Desc" } }, "type": "object", "required": [ "tag", "tagColor", "emoji", "text", "source" ], "title": "RetentionClue", "description": "维客线索。" }, "app__schemas__xcx_tasks__TaskItem": { "properties": { "id": { "type": "integer", "title": "Id" }, "customerName": { "type": "string", "title": "Customername" }, "customerAvatar": { "type": "string", "title": "Customeravatar" }, "taskType": { "type": "string", "title": "Tasktype" }, "taskTypeLabel": { "type": "string", "title": "Tasktypelabel" }, "deadline": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Deadline" }, "heartScore": { "type": "number", "title": "Heartscore" }, "hobbies": { "items": { "type": "string" }, "type": "array", "title": "Hobbies" }, "isPinned": { "type": "boolean", "title": "Ispinned" }, "hasNote": { "type": "boolean", "title": "Hasnote" }, "status": { "type": "string", "title": "Status" }, "lastVisitDays": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Lastvisitdays" }, "balance": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Balance" }, "aiSuggestion": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Aisuggestion" } }, "type": "object", "required": [ "id", "customerName", "customerAvatar", "taskType", "taskTypeLabel", "deadline", "heartScore", "hobbies", "isPinned", "hasNote", "status" ], "title": "TaskItem", "description": "任务列表项(扩展版)。" } }, "securitySchemes": { "HTTPBearer": { "type": "http", "scheme": "bearer" } } } }