|
@@ -733,18 +733,22 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
- []rest.Route{
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/employee/list",
|
|
|
- Handler: employee.GetApiEmployeeListHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/employee/detail",
|
|
|
- Handler: employee.GetApiEmployeeDetailHandler(serverCtx),
|
|
|
- },
|
|
|
- },
|
|
|
+ rest.WithMiddlewares(
|
|
|
+ []rest.Middleware{serverCtx.Miniprogram},
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/employee/list",
|
|
|
+ Handler: employee.GetApiEmployeeListHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/employee/detail",
|
|
|
+ Handler: employee.GetApiEmployeeDetailHandler(serverCtx),
|
|
|
+ },
|
|
|
+ }...,
|
|
|
+ ),
|
|
|
+ rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
@@ -928,13 +932,17 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
- []rest.Route{
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/category/list",
|
|
|
- Handler: category.GetApiCategoryListHandler(serverCtx),
|
|
|
- },
|
|
|
- },
|
|
|
+ rest.WithMiddlewares(
|
|
|
+ []rest.Middleware{serverCtx.Miniprogram},
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/category/list",
|
|
|
+ Handler: category.GetApiCategoryListHandler(serverCtx),
|
|
|
+ },
|
|
|
+ }...,
|
|
|
+ ),
|
|
|
+ rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
@@ -1069,23 +1077,27 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
- []rest.Route{
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/session/list",
|
|
|
- Handler: chatsession.GetApiSessionListHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/session/update",
|
|
|
- Handler: chatsession.UpdateApiSessionHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/session/delete",
|
|
|
- Handler: chatsession.DeleteApiSessionHandler(serverCtx),
|
|
|
- },
|
|
|
- },
|
|
|
+ rest.WithMiddlewares(
|
|
|
+ []rest.Middleware{serverCtx.Miniprogram},
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/session/list",
|
|
|
+ Handler: chatsession.GetApiSessionListHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/session/update",
|
|
|
+ Handler: chatsession.UpdateApiSessionHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/session/delete",
|
|
|
+ Handler: chatsession.DeleteApiSessionHandler(serverCtx),
|
|
|
+ },
|
|
|
+ }...,
|
|
|
+ ),
|
|
|
+ rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
@@ -1123,13 +1135,17 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
- []rest.Route{
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/card/detail",
|
|
|
- Handler: wxcard.GetApiWxCardDetailHandler(serverCtx),
|
|
|
- },
|
|
|
- },
|
|
|
+ rest.WithMiddlewares(
|
|
|
+ []rest.Middleware{serverCtx.Miniprogram},
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/card/detail",
|
|
|
+ Handler: wxcard.GetApiWxCardDetailHandler(serverCtx),
|
|
|
+ },
|
|
|
+ }...,
|
|
|
+ ),
|
|
|
+ rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
@@ -1167,13 +1183,17 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
- []rest.Route{
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/user/update",
|
|
|
- Handler: wxcarduser.UpdateApiWxCardUserHandler(serverCtx),
|
|
|
- },
|
|
|
- },
|
|
|
+ rest.WithMiddlewares(
|
|
|
+ []rest.Middleware{serverCtx.Miniprogram},
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/user/update",
|
|
|
+ Handler: wxcarduser.UpdateApiWxCardUserHandler(serverCtx),
|
|
|
+ },
|
|
|
+ }...,
|
|
|
+ ),
|
|
|
+ rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
@@ -1211,18 +1231,22 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
- []rest.Route{
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/card/visit",
|
|
|
- Handler: wxcardvisit.SubmitApiWxCardVisitHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/card/visit/history",
|
|
|
- Handler: wxcardvisit.GetApiWxCardVisitListHandler(serverCtx),
|
|
|
- },
|
|
|
- },
|
|
|
+ rest.WithMiddlewares(
|
|
|
+ []rest.Middleware{serverCtx.Miniprogram},
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/card/visit",
|
|
|
+ Handler: wxcardvisit.SubmitApiWxCardVisitHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/card/visit/history",
|
|
|
+ Handler: wxcardvisit.GetApiWxCardVisitListHandler(serverCtx),
|
|
|
+ },
|
|
|
+ }...,
|
|
|
+ ),
|
|
|
+ rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|