|
@@ -8,8 +8,6 @@ import (
|
|
|
"sparrow/services/knowoapi/model"
|
|
|
"sparrow/services/knowoapi/services"
|
|
|
|
|
|
- "github.com/opentracing/opentracing-go"
|
|
|
-
|
|
|
jwtmiddleware "github.com/iris-contrib/middleware/jwt"
|
|
|
"github.com/kataras/iris/v12"
|
|
|
)
|
|
@@ -54,15 +52,7 @@ func registerRouters(srv *iris.Application, models *model.All, gen *generator.Ke
|
|
|
roleService := services.NewRoleService(models)
|
|
|
ruleChainService := services.NewRuleChainService(models)
|
|
|
subDeviceService := services.NewSubDeviceService(models)
|
|
|
- v1router := srv.Party("/api/v1", func(ctx iris.Context) {
|
|
|
- span := opentracing.StartSpan(ctx.Path())
|
|
|
- defer span.Finish()
|
|
|
- span.SetTag("http.method", ctx.Method())
|
|
|
- span.SetTag("http.url", ctx.Path())
|
|
|
- span.SetTag("http.status_code", ctx.GetStatusCode())
|
|
|
- ctx.Values().Set("span", span)
|
|
|
- ctx.Next()
|
|
|
- })
|
|
|
+ v1router := srv.Party("/api/v1")
|
|
|
|
|
|
// 登陆,注册
|
|
|
loginAPI := mvc.New(v1router.Party("/"))
|