Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d7a59845eb | |||
| 98619083a1 |
+15
-2
@@ -73,10 +73,18 @@ func (that *Application) Run(router Router) {
|
||||
if that.Router[k] == nil {
|
||||
that.Router[k] = v
|
||||
}
|
||||
|
||||
//直达接口层复用
|
||||
for k1, v1 := range v {
|
||||
that.Router[k][k1] = v1
|
||||
if that.Router[k][k1] == nil {
|
||||
that.Router[k][k1] = v1
|
||||
}
|
||||
|
||||
for k2, v2 := range v1 {
|
||||
|
||||
that.Router[k][k1][k2] = v2
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//重新设置MethodRouter//直达路由
|
||||
that.MethodRouter = MethodRouter{}
|
||||
@@ -724,6 +732,11 @@ func setMakeCodeLintener(name string, appIns *Application) {
|
||||
context.Req.Method != "POST" {
|
||||
return isFinished
|
||||
}
|
||||
//排除已有接口的无效操作
|
||||
if len(context.RouterString) == 3 && context.Router[context.RouterString[0]] != nil && context.Router[context.RouterString[0]][context.RouterString[1]] != nil && context.Router[context.RouterString[0]][context.RouterString[1]][context.RouterString[2]] != nil {
|
||||
return isFinished
|
||||
}
|
||||
|
||||
//列表检索
|
||||
if len(context.RouterString) == 2 &&
|
||||
context.Req.Method == "GET" {
|
||||
|
||||
Reference in New Issue
Block a user