Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
466 commits
Select commit Hold shift + click to select a range
1dba5bf
Make report output more decision-oriented and harden Chinese-text san…
it-cast Apr 7, 2026
c04e5bc
Merge branch 'main' into codex/investigar-geracao-incorreta-de-pdf-9m…
it-cast Apr 7, 2026
13b93c6
Merge pull request #12 from it-cast/codex/investigar-geracao-incorret…
it-cast Apr 7, 2026
6d503b3
Add CEO-style report blocks: executive briefing, rounds summary, and …
it-cast Apr 7, 2026
b5a172a
Add CEO-style report blocks: executive briefing, rounds summary, and …
it-cast Apr 7, 2026
6ffe34b
Merge branch 'main' into codex/investigar-geracao-incorreta-de-pdf-se…
it-cast Apr 7, 2026
c543ec2
Merge pull request #14 from it-cast/codex/investigar-geracao-incorret…
it-cast Apr 7, 2026
af597b4
Merge pull request #13 from it-cast/codex/investigar-geracao-incorret…
it-cast Apr 7, 2026
26989d9
fix: address AUGUR wizard review feedback
it-cast Apr 7, 2026
0291a31
Merge branch 'main' into codex/replace-newsimulationview.vue-with-wiz…
it-cast Apr 7, 2026
09e552f
Merge pull request #15 from it-cast/codex/replace-newsimulationview.v…
it-cast Apr 7, 2026
2b82654
feat: strengthen decision-ready wizard experience
it-cast Apr 7, 2026
d2b8c1a
Merge branch 'main' into codex/replace-newsimulationview.vue-with-wiz…
it-cast Apr 7, 2026
737de25
Merge pull request #16 from it-cast/codex/replace-newsimulationview.v…
it-cast Apr 7, 2026
197c2b3
feat: add executive launch comparison and recommendation panel
it-cast Apr 7, 2026
7b31455
Merge branch 'main' into codex/replace-newsimulationview.vue-with-wiz…
it-cast Apr 7, 2026
bc9e6b2
Merge pull request #17 from it-cast/codex/replace-newsimulationview.v…
it-cast Apr 7, 2026
6fcd5e2
feat: push wizard toward 10/10 decision workflow
it-cast Apr 8, 2026
eaf02b2
Merge branch 'main' into codex/replace-newsimulationview.vue-with-wiz…
it-cast Apr 8, 2026
1014cb4
Merge pull request #18 from it-cast/codex/replace-newsimulationview.v…
it-cast Apr 8, 2026
f632e19
feat: add calibration, board exports, and benchmark history
it-cast Apr 8, 2026
53168a6
Merge branch 'main' into codex/replace-newsimulationview.vue-with-wiz…
it-cast Apr 8, 2026
ea6d37e
Merge pull request #19 from it-cast/codex/replace-newsimulationview.v…
it-cast Apr 8, 2026
22c0e5c
fix: upgrade report quality, pdf export, and language sanitization
it-cast Apr 8, 2026
e6c8f1f
Merge branch 'main' into codex/replace-newsimulationview.vue-with-wiz…
it-cast Apr 8, 2026
c07aae9
Merge pull request #20 from it-cast/codex/replace-newsimulationview.v…
it-cast Apr 8, 2026
a41284b
feat: redesign report view to match mirofish executive level
it-cast Apr 8, 2026
86e2cdb
Merge branch 'main' into codex/replace-newsimulationview.vue-with-wiz…
it-cast Apr 8, 2026
54fcf78
Merge pull request #21 from it-cast/codex/replace-newsimulationview.v…
it-cast Apr 8, 2026
d12fea8
fix: enforce pt locale and reliable report loading
it-cast Apr 8, 2026
da95154
Merge branch 'main' into codex/replace-newsimulationview.vue-with-wiz…
it-cast Apr 8, 2026
268ee44
Merge pull request #22 from it-cast/codex/replace-newsimulationview.v…
it-cast Apr 8, 2026
026ed5e
Update config.py
it-cast Apr 8, 2026
9645fec
Update oasis_profile_generator.py
it-cast Apr 8, 2026
8b3d7e9
Update graph_builder.py
it-cast Apr 8, 2026
69f5399
Update simulation_config_generator.py
it-cast Apr 8, 2026
d84e93a
Update ontology_generator.py
it-cast Apr 8, 2026
4a6dab7
Update zep_tools.py
it-cast Apr 8, 2026
8b28c7f
Update config.py
it-cast Apr 8, 2026
5ec07f6
Update report_agent.py
it-cast Apr 8, 2026
fa81f4e
Update zep_tools.py
it-cast Apr 8, 2026
1025c76
Update ontology_generator.py
it-cast Apr 8, 2026
d33f7ad
Update simulation_config_generator.py
it-cast Apr 8, 2026
0302cf5
Update graph_builder.py
it-cast Apr 8, 2026
e5b151a
Update oasis_profile_generator.py
it-cast Apr 8, 2026
528e6b8
Update report_agent.py
it-cast Apr 8, 2026
dac6714
Update report_agent.py
it-cast Apr 8, 2026
250b77a
Update ReportView.vue
it-cast Apr 8, 2026
9aea41e
Update zep_tools.py
it-cast Apr 8, 2026
e232c84
Update ReportView.vue
it-cast Apr 8, 2026
9e74756
Update locale.py
it-cast Apr 8, 2026
a258f1c
Update ReportView.vue
it-cast Apr 8, 2026
66b785a
Update report_agent.py
it-cast Apr 8, 2026
7320ba0
Update locale.py
it-cast Apr 8, 2026
8e14836
Update ReportView.vue
it-cast Apr 8, 2026
9a4b215
Update report_agent.py
it-cast Apr 8, 2026
e9f8ef4
Update ReportView.vue
it-cast Apr 8, 2026
7fa32c4
Create pdf_generator.py
it-cast Apr 8, 2026
9e2e5f1
Create auth.py
it-cast Apr 8, 2026
a15a970
Update __init__.py
it-cast Apr 8, 2026
e5cd549
Update report.py
it-cast Apr 8, 2026
7aca828
Update report_agent.py
it-cast Apr 8, 2026
9f3d838
Update ReportView.vue
it-cast Apr 8, 2026
4182103
Update SimulationView.vue
it-cast Apr 8, 2026
7a8d6d5
Create DemoReportView.vue
it-cast Apr 8, 2026
77c3925
Update DashboardView.vue
it-cast Apr 8, 2026
d3399af
Update index.js
it-cast Apr 8, 2026
11f9649
Update pdf_generator.py
it-cast Apr 8, 2026
8bda4db
Update auth.py
it-cast Apr 8, 2026
bfed9ef
Update __init__.py
it-cast Apr 8, 2026
f64f6a1
Update report.py
it-cast Apr 8, 2026
d947823
Update report_agent.py
it-cast Apr 8, 2026
f2c3238
Update ReportView.vue
it-cast Apr 8, 2026
84c76d6
Update locale.py
it-cast Apr 8, 2026
855b5b5
Update config.py
it-cast Apr 8, 2026
a271198
Update ontology_generator.py
it-cast Apr 8, 2026
2c64f4c
Update simulation_config_generator.py
it-cast Apr 8, 2026
aa0c9ee
Update graph_builder.py
it-cast Apr 8, 2026
5959530
Update oasis_profile_generator.py
it-cast Apr 8, 2026
1402978
Update zep_tools.py
it-cast Apr 8, 2026
97f0b0c
Update index.js
it-cast Apr 9, 2026
39d523f
Update ReportView.vue
it-cast Apr 9, 2026
9b6b794
Update ReportView.vue
it-cast Apr 9, 2026
e457f48
Update analytics.py
it-cast Apr 9, 2026
ef2e376
Update pdf_generator.py
it-cast Apr 9, 2026
2e2ce14
Update SimulationView.vue
it-cast Apr 9, 2026
bf98991
Update ReportView.vue
it-cast Apr 9, 2026
a30979c
Update analytics.py
it-cast Apr 9, 2026
53e0d34
Update pdf_generator.py
it-cast Apr 9, 2026
05b30c6
Update pdf_generator.py
it-cast Apr 9, 2026
122baee
Update analytics.py
it-cast Apr 9, 2026
e5753c3
Update ReportView.vue
it-cast Apr 9, 2026
bd14676
Update SimulationView.vue
it-cast Apr 9, 2026
b8712ef
Update SimulationView.vue
it-cast Apr 9, 2026
1716ec4
Update SimulationView.vue
it-cast Apr 9, 2026
43baf18
Create AgentLibraryView.vue
it-cast Apr 9, 2026
bce0599
Update AppSidebar.vue
it-cast Apr 9, 2026
c4f4b0b
Update SimulationView.vue
it-cast Apr 9, 2026
85ae758
Update index.js
it-cast Apr 9, 2026
0d2b756
Update index.js
it-cast Apr 9, 2026
cf5a0a3
Update SimulationView.vue
it-cast Apr 9, 2026
23f6026
fix: bind mount backend/app permanente
Apr 10, 2026
1677c98
Update ReportView.vue
it-cast Apr 10, 2026
c880627
Update SimulationView.vue
it-cast Apr 10, 2026
bb3fd94
Update SimulationRunView.vue
it-cast Apr 10, 2026
d7c5855
Update ReportView.vue
it-cast Apr 10, 2026
93510e3
Update SimulationView.vue
it-cast Apr 10, 2026
c31be11
Update SimulationRunView.vue
it-cast Apr 10, 2026
a2c55fd
Update AgentLibraryView.vue
it-cast Apr 10, 2026
b86794b
Update ontology_generator.py
it-cast Apr 10, 2026
1fa18aa
Update ReportView.vue
it-cast Apr 10, 2026
4c459ba
Update SimulationView.vue
it-cast Apr 10, 2026
e0a6ceb
Update SimulationRunView.vue
it-cast Apr 10, 2026
208af15
Update AgentLibraryView.vue
it-cast Apr 10, 2026
c1213bd
Update InteractionView.vue
it-cast Apr 10, 2026
9041314
Update SimulationView.vue
it-cast Apr 10, 2026
33c1c08
Update ontology_generator.py
it-cast Apr 10, 2026
087f583
Update __init__.py
it-cast Apr 10, 2026
a085173
Update ReportView.vue
it-cast Apr 10, 2026
f979e32
Update SimulationRunView.vue
it-cast Apr 10, 2026
4402144
Update InteractionView.vue
it-cast Apr 10, 2026
44dd2ef
Update AgentLibraryView.vue
it-cast Apr 10, 2026
a8aa8e5
Update docker-compose.yml
it-cast Apr 10, 2026
a53f54d
Update Dockerfile
it-cast Apr 10, 2026
05da848
Update pyproject.toml
it-cast Apr 10, 2026
57fab8f
Update llm_client.py
it-cast Apr 10, 2026
48ceda6
Update ontology_generator.py
it-cast Apr 10, 2026
2151754
Update report_agent.py
it-cast Apr 10, 2026
82b8217
Update zep_tools.py
it-cast Apr 10, 2026
d5204bb
Update zep_tools.py
it-cast Apr 10, 2026
7ea6a8d
Update report_agent.py
it-cast Apr 10, 2026
ace8bc8
Update ontology_generator.py
it-cast Apr 10, 2026
8915991
Update llm_client.py
it-cast Apr 10, 2026
77133f1
fix: max_tokens -> max_completion_tokens for gpt-5.4-mini
Apr 10, 2026
53c90c0
Update ReportView.vue
it-cast Apr 10, 2026
367759f
Update InteractionView.vue
it-cast Apr 10, 2026
08652cf
Update SimulationRunView.vue
it-cast Apr 10, 2026
37f018a
Update SimulationRunView.vue
it-cast Apr 10, 2026
e513848
Update InteractionView.vue
it-cast Apr 10, 2026
cf66cfb
Update ReportView.vue
it-cast Apr 10, 2026
0754871
Update report_agent.py
it-cast Apr 10, 2026
99bf0a5
Update zep_tools.py
it-cast Apr 10, 2026
37e6990
Update pyproject.toml
it-cast Apr 10, 2026
6315555
Update ReportView.vue
it-cast Apr 10, 2026
b244364
Update InteractionView.vue
it-cast Apr 10, 2026
124922b
Update SimulationRunView.vue
it-cast Apr 10, 2026
905d659
Update PublicReportView.vue
it-cast Apr 10, 2026
598509a
Update index.js
it-cast Apr 10, 2026
165ceac
Update __init__.py
it-cast Apr 10, 2026
09ee9e3
Create share.py
it-cast Apr 10, 2026
7f0f0ad
Update __init__.py
it-cast Apr 10, 2026
218a515
Update DashboardView.vue
it-cast Apr 10, 2026
a7b0388
Update ReportView.vue
it-cast Apr 10, 2026
177b4ac
Update ReportView.vue
it-cast Apr 10, 2026
5515e39
Update ReportView.vue
it-cast Apr 10, 2026
a2bc5fb
Update ReportView.vue
it-cast Apr 10, 2026
07a0486
Update ReportView.vue
it-cast Apr 10, 2026
e029b3d
Update ReportView.vue
it-cast Apr 10, 2026
9574273
Update simulation.py
it-cast Apr 10, 2026
fe3edd8
Update simulation.py
it-cast Apr 10, 2026
a2aaa3e
Update simulation.py
it-cast Apr 10, 2026
38d21ed
Update ReportView.vue
it-cast Apr 10, 2026
1007d86
Update DashboardView.vue
it-cast Apr 11, 2026
5594640
Update SimulationRunView.vue
it-cast Apr 11, 2026
99e30f6
Update InteractionView.vue
it-cast Apr 11, 2026
465142b
Update ProjetoView.vue
it-cast Apr 11, 2026
0050209
Update NovoProjetoView.vue
it-cast Apr 11, 2026
7c7ea05
Update SimulationView.vue
it-cast Apr 11, 2026
86df9ef
Update SimulationView.vue
it-cast Apr 11, 2026
4863609
Update AgentLibraryView.vue
it-cast Apr 11, 2026
9b604a4
Update AgentesView.vue
it-cast Apr 11, 2026
b643363
Update CompararView.vue
it-cast Apr 11, 2026
8da156a
Update InfluentesView.vue
it-cast Apr 11, 2026
5e6a34f
Update PostsTimelineView.vue
it-cast Apr 11, 2026
3766eb1
Update PostsTimelineView.vue
it-cast Apr 11, 2026
db17c60
Update AgentProfileView.vue
it-cast Apr 11, 2026
09c417f
Update DemoReportView.vue
it-cast Apr 11, 2026
01f99c8
Update GraphView.vue
it-cast Apr 11, 2026
d44a9ad
Update NewSimulationView.vue
it-cast Apr 11, 2026
e476d7a
Update AppShell.vue
it-cast Apr 11, 2026
e0a9ed2
Update AppSidebar.vue
it-cast Apr 11, 2026
a36e7e2
Update AppSidebar.vue
it-cast Apr 11, 2026
2ce47f1
Update ReportView.vue
it-cast Apr 11, 2026
07f5911
Update DashboardView.vue
it-cast Apr 11, 2026
c5b8022
Update ReportView.vue
it-cast Apr 11, 2026
9f841fd
Update docker-compose.yml
it-cast Apr 11, 2026
eea187f
Update docker-compose.yml
it-cast Apr 11, 2026
444b74b
Update pdf_generator.py
it-cast Apr 11, 2026
0835fbe
Update pdf_generator.py
it-cast Apr 11, 2026
3f8b956
Update pdf_generator.py
it-cast Apr 11, 2026
ea17f0c
Update ReportView.vue
it-cast Apr 11, 2026
3602e36
Update pdf_generator.py
it-cast Apr 11, 2026
dfd5d98
Update pdf_generator.py
it-cast Apr 11, 2026
bb77dd6
Update pdf_generator.py
it-cast Apr 11, 2026
d1138a4
Update pdf_generator.py
it-cast Apr 11, 2026
29ea735
Update pdf_generator.py
it-cast Apr 11, 2026
4f2beff
Update pdf_generator.py
it-cast Apr 11, 2026
8d7e291
Update pdf_generator.py
it-cast Apr 11, 2026
1b470e6
Create report_schema.py
it-cast Apr 11, 2026
7c9775c
Create __init__.py
it-cast Apr 11, 2026
86ace8f
Create report_prompts_v2.py
it-cast Apr 11, 2026
a140454
Update report_schema.py
it-cast Apr 11, 2026
9d1fc9f
Update report_schema.py
it-cast Apr 11, 2026
e58e053
Create ontology_prompts_v2.py
it-cast Apr 11, 2026
9878d3d
Update report_prompts_v2.py
it-cast Apr 11, 2026
6c1ff86
Update pdf_generator.py
it-cast Apr 11, 2026
27965cd
Update ontology_prompts_v2.py
it-cast Apr 11, 2026
9682045
Update report_prompts_v2.py
it-cast Apr 11, 2026
0efcdc4
Update report_schema.py
it-cast Apr 11, 2026
cc406b6
Update ontology_prompts_v2.py
it-cast Apr 11, 2026
7830ba8
Update report_schema.py
it-cast Apr 11, 2026
ee246f1
Update ontology_prompts_v2.py
it-cast Apr 11, 2026
1545a33
Update report_prompts_v2.py
it-cast Apr 11, 2026
daed503
Update pdf_generator.py
it-cast Apr 11, 2026
d96f05d
Update ontology_generator.py
it-cast Apr 11, 2026
4122d47
Update report_agent.py
it-cast Apr 11, 2026
e247845
Update pdf_generator.py
it-cast Apr 11, 2026
5877762
Update report.py
it-cast Apr 11, 2026
92d498d
Create market_research.py
it-cast Apr 11, 2026
09a3c42
Update report_schema.py
it-cast Apr 11, 2026
bc44426
Update graph.py
it-cast Apr 11, 2026
42086d3
Update config.py
it-cast Apr 11, 2026
66184a6
Update DemoReportView.vue
it-cast Apr 11, 2026
063fb99
Update AgentesView.vue
it-cast Apr 12, 2026
532efcb
Update DemoReportView.vue
it-cast Apr 12, 2026
d1e9328
Create agent_preview_endpoints.py
it-cast Apr 12, 2026
342fd8b
Update simulation.py
it-cast Apr 12, 2026
cd9314f
Update SimulationView.vue
it-cast Apr 12, 2026
40de963
Create AgentPreview.vue
it-cast Apr 12, 2026
e43dd19
Update SimulationView.vue
it-cast Apr 12, 2026
b086ac6
Update NovoProjetoView.vue
it-cast Apr 12, 2026
a466290
Update SimulationRunView.vue
it-cast Apr 12, 2026
7157885
Update ProjetoView.vue
it-cast Apr 12, 2026
e6f9ee2
Update SimulationRunView.vue
it-cast Apr 12, 2026
c428b0d
Update SimulationRunView.vue
it-cast Apr 12, 2026
776909d
Update pdf_generator.py
it-cast Apr 12, 2026
9080f51
Update report_prompts_v2.py
it-cast Apr 12, 2026
72593c0
Update ontology_prompts_v2.py
it-cast Apr 12, 2026
a08d192
Update pdf_generator.py
it-cast Apr 12, 2026
00d74fa
Update report_prompts_v2.py
it-cast Apr 12, 2026
8df65fd
Update ontology_prompts_v2.py
it-cast Apr 12, 2026
c5caa48
Update pdf_generator.py
it-cast Apr 12, 2026
886137f
Update report_prompts_v2.py
it-cast Apr 12, 2026
8b85bb0
Update report_prompts_v2.py
it-cast Apr 12, 2026
edc62e1
Update pdf_generator.py
it-cast Apr 12, 2026
f607e8e
Update pdf_generator.py
it-cast Apr 12, 2026
971b9e6
Update ontology_prompts_v2.py
it-cast Apr 12, 2026
8852da0
Update ReportView.vue
it-cast Apr 12, 2026
c8f25ce
Update report.py
it-cast Apr 12, 2026
945ba49
Update ReportView.vue
it-cast Apr 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy AUGUR
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_KEY }}
port: ${{ secrets.VPS_PORT }}
script: |
cd /opt/mirofish
git fetch origin
git reset --hard origin/main
docker compose restart mirofish
echo "✅ Deploy AUGUR concluído: $(date)"
19 changes: 12 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
FROM python:3.11

# 安装 Node.js (满足 >=18)及必要工具
# Instalar Node.js e ferramentas necessarias
RUN apt-get update \
&& apt-get install -y --no-install-recommends nodejs npm \
&& rm -rf /var/lib/apt/lists/*

# uv 官方镜像复制 uv
# uv para gerenciar deps Python
COPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /uvx /bin/

WORKDIR /app

# 先复制依赖描述文件以利用缓存
# Deps Node (cache layer)
COPY package.json package-lock.json ./
COPY frontend/package.json frontend/package-lock.json ./frontend/

# Deps Python (cache layer)
COPY backend/pyproject.toml backend/uv.lock ./backend/

# 安装依赖(Node + Python)
# Instalar todas as dependencias
RUN npm ci \
&& npm ci --prefix frontend \
&& cd backend && uv sync --frozen

# 复制项目源码
# Instalar extras que nao estao no uv.lock ainda
RUN pip install fpdf2 flask-jwt-extended --break-system-packages --quiet 2>/dev/null || true

# Copiar codigo fonte
COPY . .

EXPOSE 3000 5001

# 同时启动前后端(开发模式)
CMD ["npm", "run", "dev"]
# Iniciar frontend + backend
CMD ["npm", "run", "dev"]
63 changes: 41 additions & 22 deletions backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""
MiroFish Backend - Flask应用工厂
AUGUR Backend - Flask
"""

import os
import warnings

# 抑制 multiprocessing resource_tracker 的警告(来自第三方库如 transformers)
# 需要在所有其他导入之前设置
warnings.filterwarnings("ignore", message=".*resource_tracker.*")

from flask import Flask, request
Expand All @@ -17,64 +15,85 @@


def create_app(config_class=Config):
"""Flask应用工厂函数"""
"""Flask app factory"""
app = Flask(__name__)
app.config.from_object(config_class)

# 设置JSON编码:确保中文直接显示(而不是 \uXXXX 格式)
# Flask >= 2.3 使用 app.json.ensure_ascii,旧版本使用 JSON_AS_ASCII 配置
if hasattr(app, 'json') and hasattr(app.json, 'ensure_ascii'):
app.json.ensure_ascii = False

# 设置日志
logger = setup_logger('mirofish')

# 只在 reloader 子进程中打印启动信息(避免 debug 模式下打印两次)
is_reloader_process = os.environ.get('WERKZEUG_RUN_MAIN') == 'true'
debug_mode = app.config.get('DEBUG', False)
should_log_startup = not debug_mode or is_reloader_process

if should_log_startup:
logger.info("=" * 50)
logger.info("MiroFish Backend 启动中...")
logger.info("MiroFish Backend ...")
logger.info("=" * 50)

# 启用CORS
CORS(app, resources={r"/api/*": {"origins": "*"}})
# CORS
cors_origins = os.environ.get('CORS_ORIGINS', '*').split(',')
CORS(app, resources={r"/api/*": {"origins": cors_origins}})

# 注册模拟进程清理函数(确保服务器关闭时终止所有模拟进程)
# JWT Auth (opcional)
try:
from .auth import init_jwt, auth_bp
jwt = init_jwt(app)
app.register_blueprint(auth_bp)
if should_log_startup:
if jwt:
logger.info("JWT Auth configurado")
else:
logger.info("JWT Auth nao disponivel (flask-jwt-extended nao instalado)")
except Exception as e:
if should_log_startup:
logger.warning(f"Auth nao carregado: {e}")

# Simulation Runner
from .services.simulation_runner import SimulationRunner
SimulationRunner.register_cleanup()
if should_log_startup:
logger.info("已注册模拟进程清理函数")
logger.info("Simulacao")

# 请求日志中间件
@app.before_request
def log_request():
logger = get_logger('mirofish.request')
logger.debug(f"请求: {request.method} {request.path}")
logger.debug(f": {request.method} {request.path}")
if request.content_type and 'json' in request.content_type:
logger.debug(f"请求体: {request.get_json(silent=True)}")
logger.debug(f": {request.get_json(silent=True)}")

@app.after_request
def log_response(response):
logger = get_logger('mirofish.request')
logger.debug(f"响应: {response.status_code}")
logger.debug(f": {response.status_code}")
return response

# 注册蓝图
from .api import graph_bp, simulation_bp, report_bp
# Blueprints principais
from .api import graph_bp, simulation_bp, report_bp, analytics_bp
from .api.public import public_bp
app.register_blueprint(graph_bp, url_prefix='/api/graph')
app.register_blueprint(simulation_bp, url_prefix='/api/simulation')
app.register_blueprint(report_bp, url_prefix='/api/report')
app.register_blueprint(analytics_bp, url_prefix='/api/analytics')
app.register_blueprint(public_bp, url_prefix='/api/public')

# Share API (opcional)
try:
from .api.share import share_bp
app.register_blueprint(share_bp)
if should_log_startup:
logger.info("Share API disponivel")
except Exception as e:
if should_log_startup:
logger.warning(f"Share API nao disponivel: {e}")

# 健康检查
@app.route('/health')
def health():
return {'status': 'ok', 'service': 'MiroFish Backend'}

if should_log_startup:
logger.info("MiroFish Backend 启动完成")
logger.info("MiroFish Backend pronto")

return app

13 changes: 7 additions & 6 deletions backend/app/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"""
API路由模块
API
"""

from flask import Blueprint

graph_bp = Blueprint('graph', __name__)
graph_bp = Blueprint('graph', __name__)
simulation_bp = Blueprint('simulation', __name__)
report_bp = Blueprint('report', __name__)
report_bp = Blueprint('report', __name__)
analytics_bp = Blueprint('analytics', __name__)

from . import graph # noqa: E402, F401
from . import graph # noqa: E402, F401
from . import simulation # noqa: E402, F401
from . import report # noqa: E402, F401

from . import report # noqa: E402, F401
from . import analytics # noqa: E402, F401
Loading