diff --git a/src/webserver/pkg/app/response.go b/src/webserver/pkg/app/response.go deleted file mode 100644 index 80b714d..0000000 --- a/src/webserver/pkg/app/response.go +++ /dev/null @@ -1,24 +0,0 @@ -package pkg - -import ( - "github.com/gin-gonic/gin" -) - -type Gin struct { - C *gin.Context -} - -type Response struct { - Code int `json:"code"` - Msg string `json:"msg"` - Data interface{} `json:"data"` -} - -func (g *Gin) Response(httpCode int, errMsg string, data interface{}) { - g.C.JSON(httpCode, Response{ - Code: httpCode, - Msg: errMsg, - Data: data, - }) - return -} diff --git a/src/webserver/routers/router.go b/src/webserver/routers/router.go deleted file mode 100644 index 5ea6577..0000000 --- a/src/webserver/routers/router.go +++ /dev/null @@ -1,21 +0,0 @@ -package routers - -import ( - "github.com/gin-gonic/gin" - "net/http" - api "webserver/pkg/api" -) - -// InitRouter 初始化路由信息 -func InitRouter() *gin.Engine { - r := gin.Default() - // 静态文件路由 - r.LoadHTMLGlob("./template/*") - r.StaticFS("/template", http.Dir("template")) - r.StaticFS("/static", http.Dir("static")) - r.GET("/trans", api.SqliteQueryTRANSLATION) - r.GET("/xyz", api.SqliteQueryXYZ) - r.GET("/address", api.SendAddress) - r.GET("/request", api.Request) - return r -}