- 后端: 新增 appeal_reason_type, appeal_evidence_urls 字段 - 后端: 新建 upload_routes.py 图片上传接口 - 前端: history 页面添加快捷理由选择器 + 截图上传 - 前端: admin-review 页面展示证据图片 + 点击预览 - 新增 SQL 更新脚本 update_appeal_fields.sql Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
from flask import Flask
|
|
|
|
from app.config import Config
|
|
from app.extensions import cors, db, jwt
|
|
from app.routes.admin_routes import admin_bp
|
|
from app.routes.auth_routes import auth_bp
|
|
from app.routes.content_routes import content_bp
|
|
from app.routes.spam_routes import spam_bp
|
|
from app.routes.upload_routes import upload_bp
|
|
from app.routes.user_routes import user_bp
|
|
|
|
|
|
def create_app() -> Flask:
|
|
app = Flask(__name__)
|
|
app.config.from_object(Config)
|
|
|
|
db.init_app(app)
|
|
jwt.init_app(app)
|
|
cors.init_app(app, supports_credentials=True)
|
|
|
|
app.register_blueprint(auth_bp, url_prefix="/api/auth")
|
|
app.register_blueprint(user_bp, url_prefix="/api/user")
|
|
app.register_blueprint(spam_bp, url_prefix="/api/spam")
|
|
app.register_blueprint(content_bp, url_prefix="/api/content")
|
|
app.register_blueprint(admin_bp, url_prefix="/api/admin")
|
|
app.register_blueprint(upload_bp, url_prefix="/api/upload")
|
|
|
|
@app.get("/api/health")
|
|
def health_check():
|
|
return {
|
|
"code": 0,
|
|
"message": "ok",
|
|
"data": {
|
|
"service": "spam-detect-backend",
|
|
"version": "2.1.0",
|
|
},
|
|
}
|
|
|
|
return app
|