feat(handler): 暴露公开查询 HTTP API(T-210)

This commit is contained in:
ila
2026-07-09 21:24:09 +08:00
parent 1903fa476b
commit 816a992f00
8 changed files with 662 additions and 158 deletions
+62 -1
View File
@@ -17,7 +17,7 @@ go run . -mode server -addr 127.0.0.1:9000 # 指定地址
凭据从 `config.yaml`(嵌套 `osi:` 段)读取;服务经 SOCKS5 代理访问内网 OSI 主机。
⚠ **默认仅绑 `127.0.0.1`**:所有端点回写真实居民档案/体检(含身份证等 PII)。**切勿绑 `0.0.0.0` 或反代到公网**;确需对外必须自行加鉴权。
⚠ **默认仅绑 `127.0.0.1`**:所有端点回写真实居民档案/体检或平台主数据。后续内网部署可用 `-addr <内网IP>:<端口>` 监听内网地址,但本服务当前不内置鉴权;上线前必须通过内网访问控制/API 网关补鉴权、日志脱敏和限流。
---
@@ -108,6 +108,63 @@ GET /api/health-check/list
- 上游:`JKTJLIST00002` `/auto/jktjlist/query`
- 返回:`data` 为**数组**(人员名单 + `checkType` 状态,**非体检明细**,见 docs/04 §11.4)
### 6. 查询网格地址
```
GET /api/dictionaries/grid-addresses
```
| 参数 | 必填 | 说明 |
| --- | --- | --- |
| `parentCode` | 否 | 上级区划/网格编码 |
| `pageNo` | 否 | 页码,整数 |
| `operateUser` | 否 | 平台操作人编码 |
- 上游:`WGDZ00001` `/auto/wgdzcx/query`
- 返回:`data` 为**数组**(网格地址主数据,含 `regionCode`、`regionName`、`isFamily` 等)
### 7. 查询责任医生
```
GET /api/dictionaries/doctors
```
| 参数 | 必填 | 说明 |
| --- | --- | --- |
| `manaUnitId` | 否 | 9 位管理机构码 |
| `operateUser` | 否 | 平台操作人编码 |
- 上游:`ZRYS00001` `/auto/zryscx/query`
- 返回:`data` 为**数组**(责任医生主数据,含 `personId`、`personName` 等)
### 8. 查询药品目录
```
GET /api/dictionaries/drugs
```
| 参数 | 必填 | 说明 |
| --- | --- | --- |
| `ypmc` | 否 | 药品名称关键字 |
| `pym` | 否 | 拼音码 |
| `pageNo` | 否 | 页码,整数 |
- 上游:`YPML00001` `/auto/ypmlcx/query`
- 返回:`data` 为**数组**(药品目录主数据,含 `ypmc`、`ypdw`、`ypgg`、`jldw` 等)
### 9. 查询机构
```
GET /api/dictionaries/orgs
```
| 参数 | 必填 | 说明 |
| --- | --- | --- |
| `organizCode` | 否 | 机构编码 |
| `parentId` | 否 | 上级机构 ID/编码 |
- 上游:`CXJG00002` `/auto/cxjg/query`
- 返回:`data` 为**数组**(机构主数据,含 `organizCode`、`organizName`、`organizType`、`parentId` 等)
---
## 调用示例
@@ -118,6 +175,10 @@ curl "http://127.0.0.1:8080/api/health-record/crowd?idCard=<身份证>"
curl "http://127.0.0.1:8080/api/health-check/last?idCard=<身份证>"
curl "http://127.0.0.1:8080/api/health-check/all?idCard=<身份证>"
curl "http://127.0.0.1:8080/api/health-check/list?checkYear=2025&idCard=<身份证>"
curl "http://127.0.0.1:8080/api/dictionaries/grid-addresses?parentCode=<区划码>"
curl "http://127.0.0.1:8080/api/dictionaries/doctors?manaUnitId=<机构码>"
curl "http://127.0.0.1:8080/api/dictionaries/drugs?ypmc=<药品名>"
curl "http://127.0.0.1:8080/api/dictionaries/orgs?parentId=<上级机构ID>"
```
---