正在显示
3 个修改的文件
包含
27 行增加
和
12 行删除
@@ -14,6 +14,18 @@ info( | @@ -14,6 +14,18 @@ info( | ||
14 | group: common | 14 | group: common |
15 | ) | 15 | ) |
16 | service Core { | 16 | service Core { |
17 | + @doc "日志查询" | ||
18 | + @handler commonGetLog | ||
19 | + get /log/:module | ||
20 | +} | ||
21 | + | ||
22 | +// 通用接口 | ||
23 | +@server( | ||
24 | + prefix: v1 | ||
25 | + middleware: LogRequest | ||
26 | + group: common | ||
27 | +) | ||
28 | +service Core { | ||
17 | @doc "短信验证码" | 29 | @doc "短信验证码" |
18 | @handler commonSmsCode | 30 | @handler commonSmsCode |
19 | post /common/sms/code (CommonSmsCodeRequest) returns (CommonSmsCodeResposne) | 31 | post /common/sms/code (CommonSmsCodeRequest) returns (CommonSmsCodeResposne) |
@@ -22,10 +34,6 @@ service Core { | @@ -22,10 +34,6 @@ service Core { | ||
22 | @handler miniQrcodeInvite | 34 | @handler miniQrcodeInvite |
23 | post /mini/qrcode (MiniQrCodeRequest) | 35 | post /mini/qrcode (MiniQrCodeRequest) |
24 | 36 | ||
25 | - @doc "日志查询" | ||
26 | - @handler commonGetLog | ||
27 | - get /log/:module | ||
28 | - | ||
29 | @doc "清理缓存" | 37 | @doc "清理缓存" |
30 | @handler commonGetClearCache | 38 | @handler commonGetClearCache |
31 | get /clear | 39 | get /clear |
@@ -44,7 +52,6 @@ type( | @@ -44,7 +52,6 @@ type( | ||
44 | type( | 52 | type( |
45 | MiniQrCodeRequest{ | 53 | MiniQrCodeRequest{ |
46 | Page string `json:"page"` // 微信页面入口 | 54 | Page string `json:"page"` // 微信页面入口 |
47 | - Path string `json:"path"` // | ||
48 | Scene string `json:"scene"` // 参数 | 55 | Scene string `json:"scene"` // 参数 |
49 | } | 56 | } |
50 | ) | 57 | ) |
@@ -22,6 +22,19 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | @@ -22,6 +22,19 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||
22 | server.AddRoutes( | 22 | server.AddRoutes( |
23 | []rest.Route{ | 23 | []rest.Route{ |
24 | { | 24 | { |
25 | + Method: http.MethodGet, | ||
26 | + Path: "/log/:module", | ||
27 | + Handler: common.CommonGetLogHandler(serverCtx), | ||
28 | + }, | ||
29 | + }, | ||
30 | + rest.WithPrefix("/v1"), | ||
31 | + ) | ||
32 | + | ||
33 | + server.AddRoutes( | ||
34 | + rest.WithMiddlewares( | ||
35 | + []rest.Middleware{serverCtx.LogRequest}, | ||
36 | + []rest.Route{ | ||
37 | + { | ||
25 | Method: http.MethodPost, | 38 | Method: http.MethodPost, |
26 | Path: "/common/sms/code", | 39 | Path: "/common/sms/code", |
27 | Handler: common.CommonSmsCodeHandler(serverCtx), | 40 | Handler: common.CommonSmsCodeHandler(serverCtx), |
@@ -33,15 +46,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | @@ -33,15 +46,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||
33 | }, | 46 | }, |
34 | { | 47 | { |
35 | Method: http.MethodGet, | 48 | Method: http.MethodGet, |
36 | - Path: "/log/:module", | ||
37 | - Handler: common.CommonGetLogHandler(serverCtx), | ||
38 | - }, | ||
39 | - { | ||
40 | - Method: http.MethodGet, | ||
41 | Path: "/clear", | 49 | Path: "/clear", |
42 | Handler: common.CommonGetClearCacheHandler(serverCtx), | 50 | Handler: common.CommonGetClearCacheHandler(serverCtx), |
43 | }, | 51 | }, |
44 | - }, | 52 | + }..., |
53 | + ), | ||
45 | rest.WithPrefix("/v1"), | 54 | rest.WithPrefix("/v1"), |
46 | ) | 55 | ) |
47 | 56 |
@@ -10,7 +10,6 @@ type CommonSmsCodeResposne struct { | @@ -10,7 +10,6 @@ type CommonSmsCodeResposne struct { | ||
10 | 10 | ||
11 | type MiniQrCodeRequest struct { | 11 | type MiniQrCodeRequest struct { |
12 | Page string `json:"page"` // 微信页面入口 | 12 | Page string `json:"page"` // 微信页面入口 |
13 | - Path string `json:"path"` // | ||
14 | Scene string `json:"scene"` // 参数 | 13 | Scene string `json:"scene"` // 参数 |
15 | } | 14 | } |
16 | 15 |
-
请 注册 或 登录 后发表评论