新增小区第三方均价接口(ApiCode:3004)及测试脚本
- AverageStatistics 新增 xingfuliEsfPrice、maitianEsfPrice 字段 - AverageStatisticsService 新增 findRecentMonths 方法(查询最近N个月数据) - PropertyController 新增 thirdPartyPriceAction(/property/thirdPartyPrice) - 返回幸福里、安居客、房天下、链家、城市房产、吉屋、淘房365、麦田均价 - 仅取二手房价格,最多回溯3个月补全空值 - 新增 opentest 测试脚本:数据提取 + 多线程接口测试 - 更新 claude 技能文档:修正本地端口、seaweed集合字段说明、Groovy static 限制 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -479,7 +479,7 @@ mav.setModel(BasicModel.buildOKModel().setResult(result));
|
||||
```bash
|
||||
cd deliverables/fangjiaopen
|
||||
mvn tomcat7:run
|
||||
# 访问: http://localhost:8032/{controller}/{action}?param=value&token=xxx
|
||||
# 访问: http://localhost:9180/{controller}/{action}?param=value&token=xxx
|
||||
```
|
||||
|
||||
### Q5: 如何构建部署?
|
||||
|
||||
@@ -476,6 +476,16 @@ groovy -cp "target/classes;target/classes/lib/*" \
|
||||
5. ❌ 异常时终止整个测试
|
||||
6. ❌ 手动管理线程池(除非有特殊需求,否则用工具类)
|
||||
7. ❌ 忘记处理线程安全问题(使用工具类可避免)
|
||||
8. ❌ 脚本顶层使用 `static` 修饰符 — **Groovy 脚本不支持顶层 `static`**,会报编译错误。应改为 `final`:
|
||||
```groovy
|
||||
// ❌ 错误
|
||||
static final String TOKEN = "xxx"
|
||||
static final String HOST = "http://..."
|
||||
|
||||
// ✅ 正确
|
||||
final String TOKEN = "xxx"
|
||||
final String HOST = "http://..."
|
||||
```
|
||||
|
||||
## 测试完成后的分析
|
||||
|
||||
|
||||
@@ -308,9 +308,14 @@ MongoCollection<Document> coll = Mongo3Utils.getDbCollection(
|
||||
| `city` | String | 城市 |
|
||||
| `region` | String | 区域 |
|
||||
| `name` | String | 小区/建筑名称 |
|
||||
| `cat` | String | 分类(district=小区, office=写字楼) |
|
||||
| `cat` | String | 分类(district=小区, office=写字楼)⚠️ 注意:字段名是 `cat`,不是 `category` |
|
||||
| `status` | Integer | 状态(0=正常,其他=已删除/无效) |
|
||||
| `estate_type2` | String | 物业类型 |
|
||||
|
||||
**⚠️ 注意事项**:
|
||||
- 分类字段名是 `cat`,**不是** `category`
|
||||
- 查询时必须加 `status: 0` 过滤无效数据,否则会包含已删除的记录
|
||||
|
||||
**访问方式**:
|
||||
|
||||
**业务项目** - 通过 Service 层查询:
|
||||
@@ -335,11 +340,24 @@ MongoCollection<Document> coll = Mongo3Utils.getDbCollection(
|
||||
"fangjia",
|
||||
"seaweed"
|
||||
)
|
||||
|
||||
// ⚠️ 典型查询:注意用 cat 不是 category,必须加 status=0
|
||||
Document query = new Document("city", "福州")
|
||||
.append("cat", "district") // ⚠️ 字段名是 cat,不是 category
|
||||
.append("status", 0) // ⚠️ 必须加,过滤已删除/无效数据
|
||||
Document projection = new Document("_id", 1).append("city", 1)
|
||||
.append("region", 1).append("name", 1)
|
||||
|
||||
MongoCursor<Document> cursor = coll.find(query)
|
||||
.projection(projection)
|
||||
.limit(1000)
|
||||
.iterator()
|
||||
```
|
||||
|
||||
**使用场景**:
|
||||
- 根据ID查询小区权威信息
|
||||
- 获取小区的城市、区域、名称用于后续查询
|
||||
- 提取测试数据(测试脚本中批量获取小区列表)
|
||||
- 验证POI信息的准确性
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user