- 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>
30 lines
757 B
Go
30 lines
757 B
Go
package main
|
|
|
|
import (
|
|
"time"
|
|
|
|
"chis_osi/config"
|
|
"chis_osi/osi"
|
|
)
|
|
|
|
// buildOSIClient 用配置里的 OSI 段组装带签名/代理的薄客户端,供验证入口与 server 模式复用。
|
|
func buildOSIClient(cfg config.Config) (*osi.Client, error) {
|
|
transport, err := osi.NewTransport(osi.TransportConfig{
|
|
Timeout: time.Duration(cfg.OSI.TimeoutSec) * time.Second,
|
|
Socks5Proxy: cfg.OSI.Socks5Proxy,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return 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,
|
|
}), nil
|
|
}
|