试试统一api

This commit is contained in:
suyl
2021-06-25 10:23:02 +08:00
parent ee02691601
commit 97cc8cce0d
2 changed files with 16 additions and 0 deletions

View File

@@ -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)
}

View File

@@ -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表示非运行服务