feat(osi): 实现通用 Call 与响应判码(T-004)

This commit is contained in:
ila
2026-07-06 22:31:02 +08:00
parent 56acc01d92
commit 2a77a4dbc1
10 changed files with 413 additions and 11 deletions
+29
View File
@@ -0,0 +1,29 @@
package contract
import (
"encoding/json"
"testing"
)
func TestEnvelopeUsesUploadInfoWithBaseAndManageInfo(t *testing.T) {
envelope := Envelope{
ServiceID: "JKDA00002",
UploadInfo: UploadInfo{
BaseInfo: map[string]string{"idCard": "440100199001011234"},
ManageInfo: ManageInfo{
DSFMC: "dyytgw",
OperateUser: "712041",
OperateUnit: "12441625456962881G",
},
},
}
raw, err := json.Marshal(envelope)
if err != nil {
t.Fatalf("Marshal: %v", err)
}
want := `{"serviceId":"JKDA00002","uploadinfo":{"baseInfo":{"idCard":"440100199001011234"},"manageInfo":{"DSFMC":"dyytgw","operateUser":"712041","operateUnit":"12441625456962881G"}}}`
if string(raw) != want {
t.Fatalf("envelope JSON = %s", raw)
}
}