补充Mock命中模式后端实施与验证记录

This commit is contained in:
wkc
2026-03-22 16:18:53 +08:00
parent 6bfe7f83f2
commit 26ec386394
3 changed files with 90 additions and 3 deletions

View File

@@ -22,15 +22,20 @@ pip install -r requirements.txt
### 2. 启动服务
```bash
python main.py
python main.py --rule-hit-mode subset
python main.py --rule-hit-mode all
```
或使用 uvicorn支持热重载
热重载启动请使用项目脚本入口
```bash
uvicorn main:app --reload --host 0.0.0.0 --port 8000
python dev.py --reload --rule-hit-mode subset
python dev.py --reload --rule-hit-mode all
```
- `subset`:默认模式,按 `logId` 稳定随机命中部分规则
- `all`:全部兼容规则命中模式,会命中当前可共存的全部规则
### 3. 访问 API 文档
- **Swagger UI**: http://localhost:8000/docs
@@ -135,6 +140,7 @@ PORT=8000
# 模拟配置
PARSE_DELAY_SECONDS=4
MAX_FILE_SIZE=10485760
RULE_HIT_MODE=subset
```
### 响应模板