试试统一api
This commit is contained in:
@@ -1,7 +1,21 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
|
import "reflect"
|
||||||
|
|
||||||
type CallResult struct {
|
type CallResult struct {
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Desc string `json:"desc"`
|
Desc string `json:"desc"`
|
||||||
Data string `json:"data"`
|
Data string `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//定义路由器结构类型
|
||||||
|
type Routers struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
routerMap map[string]reflect.Value
|
||||||
|
)
|
||||||
|
|
||||||
|
func Init() {
|
||||||
|
routerMap = make(map[string]reflect.Value)
|
||||||
|
}
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.rosy.net.cn/jx-callback/controllers"
|
||||||
_ "net/http/pprof"
|
_ "net/http/pprof"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
@@ -38,6 +39,7 @@ func Init() {
|
|||||||
}
|
}
|
||||||
cms.InitServiceInfo(Version, buildTime, GitCommit)
|
cms.InitServiceInfo(Version, buildTime, GitCommit)
|
||||||
misc.Init()
|
misc.Init()
|
||||||
|
controllers.Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回true表示非运行服务
|
// 返回true表示非运行服务
|
||||||
|
|||||||
Reference in New Issue
Block a user