-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
54 lines (47 loc) · 889 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import (
"github.com/TommyLemon/unitauto-go/unitauto"
"unitauto.demo/unitauto/demo"
)
func Test() string {
return "OK"
}
func main() {
unitauto.DEFAULT_MODULE_PATH = "unitauto.demo" // TODO your package
/*
main.Test
{
"static": true // methodName = "Test"
}
*/
unitauto.CLASS_MAP["main.Test"] = Test
/*
demo.Add.Add
{
"methodArgs": [
"int:1",
"int:2"
]
}
*/
unitauto.CLASS_MAP["demo.Add"] = demo.Add
/*
Test.SetName // unitauto.DEFAULT_MODULE_PATH = "unitauto.demo"
{
"this": {
"type": "*unitauto.test.Test",
"value": {
"Id": 2,
"Name": "hello"
}
},
"methodArgs": [
"UnitAuto@Go"
]
}
*/
unitauto.CLASS_MAP["unitauto.demo.Test"] = demo.Test{}
unitauto.CLASS_MAP["*unitauto.demo.Test"] = &demo.Test{}
println("test with http://apijson.cn/unit/go or Postman")
unitauto.Start(8082)
}