feat(handler): 体检 HTTP 查询端点(T-302)
- GET /api/health-check/last(最近一次)+ /api/health-check/list(年度已检未检名单) - 回写平台完整响应 Result.Raw,抽 writeRawOrError 共用 - last 按 idCard/phrid/empiId;list 按 checkYear(必填)+idCard+checkType - 单测:路径/原样回写/缺参 400(脱敏假 OSI 后端);默认仅绑本机 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -16,11 +16,16 @@ func runServer(cfg config.Config, addr string) error {
|
||||
}
|
||||
|
||||
hr := handler.NewHealthRecordHandler(client)
|
||||
hc := handler.NewHealthCheckHandler(client)
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/api/health-record/find", hr.Find)
|
||||
mux.HandleFunc("/api/health-check/last", hc.Last)
|
||||
mux.HandleFunc("/api/health-check/list", hc.List)
|
||||
|
||||
fmt.Printf("chis_osi server listening on %s\n", addr)
|
||||
fmt.Printf(" GET http://%s/api/health-record/find?idCard=<身份证>\n", addr)
|
||||
fmt.Printf(" GET http://%s/api/health-check/last?idCard=<身份证>\n", addr)
|
||||
fmt.Printf(" GET http://%s/api/health-check/list?checkYear=<年度>&idCard=<身份证>\n", addr)
|
||||
|
||||
server := &http.Server{Addr: addr, Handler: mux}
|
||||
return server.ListenAndServe()
|
||||
|
||||
Reference in New Issue
Block a user