feat: 修复接口参数并改为form-data格式

- 添加缺失的认证参数:appId, appSecretCode, role
- 修复 analysisType 和 departmentCode 参数
- 将所有接口改为使用 Form 参数(form-data 格式)
- 更新服务层支持字典参数
- 更新所有测试代码
- 所有测试通过(7/7)
This commit is contained in:
wkc
2026-03-03 13:40:56 +08:00
parent a1f062d09d
commit 626f7d566b
21 changed files with 2527 additions and 52 deletions

View File

@@ -22,7 +22,7 @@ def test_health_check(client):
def test_get_token_success(client, sample_token_request):
"""测试获取 Token - 成功场景"""
response = client.post("/account/common/getToken", json=sample_token_request)
response = client.post("/account/common/getToken", data=sample_token_request)
assert response.status_code == 200
data = response.json()
assert data["code"] == "200"
@@ -37,9 +37,13 @@ def test_get_token_error_40101(client):
"entityName": "测试企业",
"userId": "902001",
"userName": "902001",
"appId": "remote_app",
"appSecretCode": "test_secret_code_12345",
"role": "VIEWER",
"orgCode": "902000",
"departmentCode": "902000",
}
response = client.post("/account/common/getToken", json=request_data)
response = client.post("/account/common/getToken", data=request_data)
assert response.status_code == 200
data = response.json()
assert data["code"] == "40101"