|
@@ -36,6 +36,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -36,6 +36,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
36
|
)
|
36
|
)
|
|
37
|
|
37
|
|
|
38
|
server.AddRoutes(
|
38
|
server.AddRoutes(
|
|
|
|
39
|
+ rest.WithMiddlewares(
|
|
|
|
40
|
+ []rest.Middleware{serverCtx.LogRequest},
|
|
39
|
[]rest.Route{
|
41
|
[]rest.Route{
|
|
40
|
{
|
42
|
{
|
|
41
|
Method: http.MethodPost,
|
43
|
Method: http.MethodPost,
|
|
@@ -67,14 +69,15 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -67,14 +69,15 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
67
|
Path: "/article_comment/at_who/list",
|
69
|
Path: "/article_comment/at_who/list",
|
|
68
|
Handler: comment.MiniArticleCommentAtWhoHandler(serverCtx),
|
70
|
Handler: comment.MiniArticleCommentAtWhoHandler(serverCtx),
|
|
69
|
},
|
71
|
},
|
|
70
|
- },
|
72
|
+ }...,
|
|
|
|
73
|
+ ),
|
|
71
|
rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
|
74
|
rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
|
|
72
|
rest.WithPrefix("/v1/mini"),
|
75
|
rest.WithPrefix("/v1/mini"),
|
|
73
|
)
|
76
|
)
|
|
74
|
|
77
|
|
|
75
|
server.AddRoutes(
|
78
|
server.AddRoutes(
|
|
76
|
rest.WithMiddlewares(
|
79
|
rest.WithMiddlewares(
|
|
77
|
- []rest.Middleware{serverCtx.LoginStatusCheck},
|
80
|
+ []rest.Middleware{serverCtx.LoginStatusCheck, serverCtx.LogRequest},
|
|
78
|
[]rest.Route{
|
81
|
[]rest.Route{
|
|
79
|
{
|
82
|
{
|
|
80
|
Method: http.MethodPost,
|
83
|
Method: http.MethodPost,
|
|
@@ -113,6 +116,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -113,6 +116,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
113
|
)
|
116
|
)
|
|
114
|
|
117
|
|
|
115
|
server.AddRoutes(
|
118
|
server.AddRoutes(
|
|
|
|
119
|
+ rest.WithMiddlewares(
|
|
|
|
120
|
+ []rest.Middleware{serverCtx.LogRequest},
|
|
116
|
[]rest.Route{
|
121
|
[]rest.Route{
|
|
117
|
{
|
122
|
{
|
|
118
|
Method: http.MethodPost,
|
123
|
Method: http.MethodPost,
|
|
@@ -129,14 +134,15 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -129,14 +134,15 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
129
|
Path: "/mini/message/like",
|
134
|
Path: "/mini/message/like",
|
|
130
|
Handler: message.MiniLikeHandler(serverCtx),
|
135
|
Handler: message.MiniLikeHandler(serverCtx),
|
|
131
|
},
|
136
|
},
|
|
132
|
- },
|
137
|
+ }...,
|
|
|
|
138
|
+ ),
|
|
133
|
rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
|
139
|
rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
|
|
134
|
rest.WithPrefix("/v1"),
|
140
|
rest.WithPrefix("/v1"),
|
|
135
|
)
|
141
|
)
|
|
136
|
|
142
|
|
|
137
|
server.AddRoutes(
|
143
|
server.AddRoutes(
|
|
138
|
rest.WithMiddlewares(
|
144
|
rest.WithMiddlewares(
|
|
139
|
- []rest.Middleware{serverCtx.LoginStatusCheck},
|
145
|
+ []rest.Middleware{serverCtx.LoginStatusCheck, serverCtx.LogRequest},
|
|
140
|
[]rest.Route{
|
146
|
[]rest.Route{
|
|
141
|
{
|
147
|
{
|
|
142
|
Method: http.MethodPost,
|
148
|
Method: http.MethodPost,
|
|
@@ -191,6 +197,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -191,6 +197,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
191
|
)
|
197
|
)
|
|
192
|
|
198
|
|
|
193
|
server.AddRoutes(
|
199
|
server.AddRoutes(
|
|
|
|
200
|
+ rest.WithMiddlewares(
|
|
|
|
201
|
+ []rest.Middleware{serverCtx.LogRequest},
|
|
194
|
[]rest.Route{
|
202
|
[]rest.Route{
|
|
195
|
{
|
203
|
{
|
|
196
|
Method: http.MethodPost,
|
204
|
Method: http.MethodPost,
|
|
@@ -267,14 +275,15 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -267,14 +275,15 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
267
|
Path: "/mini/user/mylike",
|
275
|
Path: "/mini/user/mylike",
|
|
268
|
Handler: user.MiniMyLikeHandler(serverCtx),
|
276
|
Handler: user.MiniMyLikeHandler(serverCtx),
|
|
269
|
},
|
277
|
},
|
|
270
|
- },
|
278
|
+ }...,
|
|
|
|
279
|
+ ),
|
|
271
|
rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
|
280
|
rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
|
|
272
|
rest.WithPrefix("/v1"),
|
281
|
rest.WithPrefix("/v1"),
|
|
273
|
)
|
282
|
)
|
|
274
|
|
283
|
|
|
275
|
server.AddRoutes(
|
284
|
server.AddRoutes(
|
|
276
|
rest.WithMiddlewares(
|
285
|
rest.WithMiddlewares(
|
|
277
|
- []rest.Middleware{serverCtx.LoginStatusCheck},
|
286
|
+ []rest.Middleware{serverCtx.LoginStatusCheck, serverCtx.LogRequest},
|
|
278
|
[]rest.Route{
|
287
|
[]rest.Route{
|
|
279
|
{
|
288
|
{
|
|
280
|
Method: http.MethodPost,
|
289
|
Method: http.MethodPost,
|
|
@@ -338,31 +347,37 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -338,31 +347,37 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
338
|
)
|
347
|
)
|
|
339
|
|
348
|
|
|
340
|
server.AddRoutes(
|
349
|
server.AddRoutes(
|
|
|
|
350
|
+ rest.WithMiddlewares(
|
|
|
|
351
|
+ []rest.Middleware{serverCtx.LogRequest},
|
|
341
|
[]rest.Route{
|
352
|
[]rest.Route{
|
|
342
|
{
|
353
|
{
|
|
343
|
Method: http.MethodPost,
|
354
|
Method: http.MethodPost,
|
|
344
|
Path: "/mini/company/search",
|
355
|
Path: "/mini/company/search",
|
|
345
|
Handler: company.MiniCompanySearchHandler(serverCtx),
|
356
|
Handler: company.MiniCompanySearchHandler(serverCtx),
|
|
346
|
},
|
357
|
},
|
|
347
|
- },
|
358
|
+ }...,
|
|
|
|
359
|
+ ),
|
|
348
|
rest.WithPrefix("/v1"),
|
360
|
rest.WithPrefix("/v1"),
|
|
349
|
)
|
361
|
)
|
|
350
|
|
362
|
|
|
351
|
server.AddRoutes(
|
363
|
server.AddRoutes(
|
|
|
|
364
|
+ rest.WithMiddlewares(
|
|
|
|
365
|
+ []rest.Middleware{serverCtx.LogRequest},
|
|
352
|
[]rest.Route{
|
366
|
[]rest.Route{
|
|
353
|
{
|
367
|
{
|
|
354
|
Method: http.MethodPost,
|
368
|
Method: http.MethodPost,
|
|
355
|
Path: "/mini/company/search-joined",
|
369
|
Path: "/mini/company/search-joined",
|
|
356
|
Handler: company.MiniCompanySearchJoinedHandler(serverCtx),
|
370
|
Handler: company.MiniCompanySearchJoinedHandler(serverCtx),
|
|
357
|
},
|
371
|
},
|
|
358
|
- },
|
372
|
+ }...,
|
|
|
|
373
|
+ ),
|
|
359
|
rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
|
374
|
rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
|
|
360
|
rest.WithPrefix("/v1"),
|
375
|
rest.WithPrefix("/v1"),
|
|
361
|
)
|
376
|
)
|
|
362
|
|
377
|
|
|
363
|
server.AddRoutes(
|
378
|
server.AddRoutes(
|
|
364
|
rest.WithMiddlewares(
|
379
|
rest.WithMiddlewares(
|
|
365
|
- []rest.Middleware{serverCtx.LoginStatusCheck},
|
380
|
+ []rest.Middleware{serverCtx.LoginStatusCheck, serverCtx.LogRequest},
|
|
366
|
[]rest.Route{
|
381
|
[]rest.Route{
|
|
367
|
{
|
382
|
{
|
|
368
|
Method: http.MethodPost,
|
383
|
Method: http.MethodPost,
|
|
@@ -381,6 +396,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -381,6 +396,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
381
|
)
|
396
|
)
|
|
382
|
|
397
|
|
|
383
|
server.AddRoutes(
|
398
|
server.AddRoutes(
|
|
|
|
399
|
+ rest.WithMiddlewares(
|
|
|
|
400
|
+ []rest.Middleware{serverCtx.LogRequest},
|
|
384
|
[]rest.Route{
|
401
|
[]rest.Route{
|
|
385
|
{
|
402
|
{
|
|
386
|
Method: http.MethodPost,
|
403
|
Method: http.MethodPost,
|
|
@@ -467,14 +484,15 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -467,14 +484,15 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
467
|
Path: "/show/search_article",
|
484
|
Path: "/show/search_article",
|
|
468
|
Handler: article.MiniSearchArticlePageHandler(serverCtx),
|
485
|
Handler: article.MiniSearchArticlePageHandler(serverCtx),
|
|
469
|
},
|
486
|
},
|
|
470
|
- },
|
487
|
+ }...,
|
|
|
|
488
|
+ ),
|
|
471
|
rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
|
489
|
rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
|
|
472
|
rest.WithPrefix("/v1/mini"),
|
490
|
rest.WithPrefix("/v1/mini"),
|
|
473
|
)
|
491
|
)
|
|
474
|
|
492
|
|
|
475
|
server.AddRoutes(
|
493
|
server.AddRoutes(
|
|
476
|
rest.WithMiddlewares(
|
494
|
rest.WithMiddlewares(
|
|
477
|
- []rest.Middleware{serverCtx.LoginStatusCheck},
|
495
|
+ []rest.Middleware{serverCtx.LoginStatusCheck, serverCtx.LogRequest},
|
|
478
|
[]rest.Route{
|
496
|
[]rest.Route{
|
|
479
|
{
|
497
|
{
|
|
480
|
Method: http.MethodGet,
|
498
|
Method: http.MethodGet,
|
|
@@ -519,7 +537,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -519,7 +537,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
519
|
|
537
|
|
|
520
|
server.AddRoutes(
|
538
|
server.AddRoutes(
|
|
521
|
rest.WithMiddlewares(
|
539
|
rest.WithMiddlewares(
|
|
522
|
- []rest.Middleware{serverCtx.LoginStatusCheck},
|
540
|
+ []rest.Middleware{serverCtx.LoginStatusCheck, serverCtx.LogRequest},
|
|
523
|
[]rest.Route{
|
541
|
[]rest.Route{
|
|
524
|
{
|
542
|
{
|
|
525
|
Method: http.MethodGet,
|
543
|
Method: http.MethodGet,
|
|
@@ -554,7 +572,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
@@ -554,7 +572,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
554
|
|
572
|
|
|
555
|
server.AddRoutes(
|
573
|
server.AddRoutes(
|
|
556
|
rest.WithMiddlewares(
|
574
|
rest.WithMiddlewares(
|
|
557
|
- []rest.Middleware{serverCtx.LoginStatusCheck},
|
575
|
+ []rest.Middleware{serverCtx.LoginStatusCheck, serverCtx.LogRequest},
|
|
558
|
[]rest.Route{
|
576
|
[]rest.Route{
|
|
559
|
{
|
577
|
{
|
|
560
|
Method: http.MethodPost,
|
578
|
Method: http.MethodPost,
|