feat(handler): server 模式健康档案查询端点(T-208)

- GET /api/health-record/find 按 idCard/phrid/personName/empiId 查询
- 回写平台完整响应(Result.Raw),未建模字段不丢失
- 抽 buildOSIClient 共用构造,verify 与 server 复用
- 默认仅绑 127.0.0.1(端点返回真实档案 PII,避免暴露局域网)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ila
2026-07-08 00:05:22 +08:00
co-authored by Claude Opus 4.8
parent 55289e0746
commit 47eaf1051e
6 changed files with 175 additions and 15 deletions
+1 -15
View File
@@ -3,7 +3,6 @@ package main
import (
"context"
"fmt"
"time"
"chis_osi/config"
"chis_osi/osi"
@@ -20,23 +19,10 @@ func runJKDAFindCheck(ctx context.Context, cfg config.Config, idCard string) (jk
return jkdaFindCheckResult{}, fmt.Errorf("id card is required")
}
transport, err := osi.NewTransport(osi.TransportConfig{
Timeout: time.Duration(cfg.OSI.TimeoutSec) * time.Second,
Socks5Proxy: cfg.OSI.Socks5Proxy,
})
client, err := buildOSIClient(cfg)
if err != nil {
return jkdaFindCheckResult{}, err
}
client := osi.NewClient(osi.ClientConfig{
BaseURL: cfg.OSI.BaseURL,
OrgCode: cfg.OSI.OrgCode,
DeviceSN: cfg.OSI.DeviceSN,
UserName: cfg.OSI.UserName,
Ask: cfg.OSI.Ask,
OperateUser: cfg.OSI.OperateUser,
OperateUnit: cfg.OSI.OrgCode,
Transport: transport,
})
records, result, err := client.FindHealthRecord(ctx, osi.FindHealthRecordQuery{IDCard: idCard})
check := jkdaFindCheckResult{Code: result.Code, Message: result.Message, DataCount: len(records)}