|
@@ -75,19 +75,30 @@ func (c *HisApiController) TestPay() {
|
75
|
75
|
|
76
|
76
|
func (c *HisApiController) TestGetBasBaseInfo() {
|
77
|
77
|
|
78
|
|
- DllDef := syscall.MustLoadDLL("SSCard.dll")
|
79
|
|
- Iinit := DllDef.MustFindProc("Init")
|
80
|
|
- readCard := DllDef.MustFindProc("ReadCardBas")
|
81
|
|
- ret, _, err := Iinit.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
|
82
|
|
- if ret != 0 {
|
83
|
|
- fmt.Println("SSCard的报错原因:", err)
|
84
|
|
- fmt.Println("SSCard的运算结果为:", ret)
|
85
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
|
86
|
|
- return
|
87
|
|
- }
|
|
78
|
+ result := C.Init(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
|
|
79
|
+ fmt.Println(result)
|
|
80
|
+ cs1 := C.CString("")
|
|
81
|
+ cs2 := C.CString("")
|
|
82
|
+ C.ReadCardBas(cs1, IntPtr(1024), cs2, IntPtr(1024))
|
|
83
|
+ fmt.Println(cs1)
|
|
84
|
+ fmt.Println(cs2)
|
|
85
|
+ C.free(unsafe.Pointer(cs1))
|
|
86
|
+ C.free(unsafe.Pointer(cs2))
|
88
|
87
|
|
89
|
|
- result := int(ret)
|
90
|
|
- fmt.Println("SSCard的运算结果为1:", result)
|
|
88
|
+ //
|
|
89
|
+ //DllDef := syscall.MustLoadDLL("SSCard.dll")
|
|
90
|
+ //Iinit := DllDef.MustFindProc("Init")
|
|
91
|
+ //readCard := DllDef.MustFindProc("ReadCardBas")
|
|
92
|
+ //ret, _, err := Iinit.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
|
|
93
|
+ //if ret != 0 {
|
|
94
|
+ // fmt.Println("SSCard的报错原因:", err)
|
|
95
|
+ // fmt.Println("SSCard的运算结果为:", ret)
|
|
96
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
|
|
97
|
+ // return
|
|
98
|
+ //}
|
|
99
|
+ //
|
|
100
|
+ //result := int(ret)
|
|
101
|
+ //fmt.Println("SSCard的运算结果为1:", result)
|
91
|
102
|
|
92
|
103
|
//if readCard == nil {
|
93
|
104
|
// fmt.Println("readcard is nil")
|
|
@@ -97,15 +108,15 @@ func (c *HisApiController) TestGetBasBaseInfo() {
|
97
|
108
|
// fmt.Println("readcard reload is nil")
|
98
|
109
|
// return
|
99
|
110
|
//}
|
100
|
|
- ret2, _, err2 := readCard.Call((uintptr)(unsafe.Pointer(str[0])), IntPtr(1024), (uintptr)(unsafe.Pointer(str1[0])), IntPtr(1024))
|
101
|
|
- fmt.Println(" Add(4,5)的结果为:", ret2)
|
102
|
|
- fmt.Println(" str:", str)
|
103
|
|
- fmt.Println(" str1:", str1)
|
104
|
|
- if err2 != nil {
|
105
|
|
- fmt.Println("SSCard的运算结果为:", ret2)
|
106
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
|
107
|
|
- return
|
108
|
|
- }
|
|
111
|
+ //ret2, _, err2 := readCard.Call((uintptr)(unsafe.Pointer(str[0])), IntPtr(1024), (uintptr)(unsafe.Pointer(str1[0])), IntPtr(1024))
|
|
112
|
+ //fmt.Println(" Add(4,5)的结果为:", ret2)
|
|
113
|
+ //fmt.Println(" str:", str)
|
|
114
|
+ //fmt.Println(" str1:", str1)
|
|
115
|
+ //if err2 != nil {
|
|
116
|
+ // fmt.Println("SSCard的运算结果为:", ret2)
|
|
117
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
|
|
118
|
+ // return
|
|
119
|
+ //}
|
109
|
120
|
|
110
|
121
|
}
|
111
|
122
|
|