正在显示
2 个修改的文件
包含
0 行增加
和
37 行删除
pkg/port/beego/controllers/hello.go
已删除
100644 → 0
1 | -package controllers | ||
2 | - | ||
3 | -import ( | ||
4 | - "github.com/beego/beego/v2/server/web" | ||
5 | - "github.com/beego/beego/v2/server/web/context" | ||
6 | -) | ||
7 | - | ||
8 | -type HelloController struct { | ||
9 | - web.Controller | ||
10 | -} | ||
11 | - | ||
12 | -func (c *HelloController) Say() { | ||
13 | - c.JSONResp(map[string]string{ | ||
14 | - "msg": "hello", | ||
15 | - }) | ||
16 | -} | ||
17 | - | ||
18 | -func SayHello(c *context.Context) { | ||
19 | - c.JSONResp(map[string]string{ | ||
20 | - "msg": "hello", | ||
21 | - }) | ||
22 | -} |
pkg/port/beego/routers/hello.go
已删除
100644 → 0
1 | -package routers | ||
2 | - | ||
3 | -import ( | ||
4 | - "github.com/beego/beego/v2/server/web" | ||
5 | - "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/controllers" | ||
6 | -) | ||
7 | - | ||
8 | -func init() { | ||
9 | - h1 := web.NewNamespace("/v1/demo", | ||
10 | - web.NSCtrlGet("/hello", (*controllers.HelloController).Say), | ||
11 | - web.NSCtrlGet("/hello2", (*controllers.HelloController).Say), | ||
12 | - // web.NSGet("/hello1", controllers.SayHello), | ||
13 | - ) | ||
14 | - web.AddNamespace(h1) | ||
15 | -} |
-
请 注册 或 登录 后发表评论