...
|
...
|
@@ -183,58 +183,61 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
[]rest.Route{
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/user/info",
|
|
|
Handler: user.SystemUserInfoHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/user/statistics",
|
|
|
Handler: user.SystemUserStatisticsHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodGet,
|
|
|
Path: "/system/user/:id",
|
|
|
Handler: user.SystemUserGetHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPut,
|
|
|
Path: "/system/user/:id",
|
|
|
Handler: user.SystemUserUpdateHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/user/search",
|
|
|
Handler: user.SystemUserSearchHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodGet,
|
|
|
Path: "/system/account/:id",
|
|
|
Handler: user.SystemUserAccountGetHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/account",
|
|
|
Handler: user.SystemUserAccountSaveHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/account/enable",
|
|
|
Handler: user.SystemUserAccountEnableHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPut,
|
|
|
Path: "/system/account/:id",
|
|
|
Handler: user.SystemUserAccountUpdateHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/account/search",
|
|
|
Handler: user.SystemUserAccountSearchHandler(serverCtx),
|
|
|
},
|
|
|
},
|
|
|
rest.WithMiddlewares(
|
|
|
[]rest.Middleware{serverCtx.LoginStatusCheck},
|
|
|
[]rest.Route{
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/user/info",
|
|
|
Handler: user.SystemUserInfoHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/user/statistics",
|
|
|
Handler: user.SystemUserStatisticsHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodGet,
|
|
|
Path: "/system/user/:id",
|
|
|
Handler: user.SystemUserGetHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPut,
|
|
|
Path: "/system/user/:id",
|
|
|
Handler: user.SystemUserUpdateHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/user/search",
|
|
|
Handler: user.SystemUserSearchHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodGet,
|
|
|
Path: "/system/account/:id",
|
|
|
Handler: user.SystemUserAccountGetHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/account",
|
|
|
Handler: user.SystemUserAccountSaveHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/account/enable",
|
|
|
Handler: user.SystemUserAccountEnableHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPut,
|
|
|
Path: "/system/account/:id",
|
|
|
Handler: user.SystemUserAccountUpdateHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/account/search",
|
|
|
Handler: user.SystemUserAccountSearchHandler(serverCtx),
|
|
|
},
|
|
|
}...,
|
|
|
),
|
|
|
rest.WithJwt(serverCtx.Config.SystemAuth.AccessSecret),
|
|
|
rest.WithPrefix("/v1"),
|
|
|
)
|
...
|
...
|
@@ -374,65 +377,71 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { |
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
[]rest.Route{
|
|
|
{
|
|
|
Method: http.MethodGet,
|
|
|
Path: "/system/role/:id",
|
|
|
Handler: role.SystemGetRoleHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/role",
|
|
|
Handler: role.SystemSaveRoleHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodDelete,
|
|
|
Path: "/system/role/:id",
|
|
|
Handler: role.SystemDeleteRoleHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPut,
|
|
|
Path: "/system/role/:id",
|
|
|
Handler: role.SystemUpdateRoleHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/role/search",
|
|
|
Handler: role.SystemSearchRoleHandler(serverCtx),
|
|
|
},
|
|
|
},
|
|
|
rest.WithMiddlewares(
|
|
|
[]rest.Middleware{serverCtx.LoginStatusCheck},
|
|
|
[]rest.Route{
|
|
|
{
|
|
|
Method: http.MethodGet,
|
|
|
Path: "/system/role/:id",
|
|
|
Handler: role.SystemGetRoleHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/role",
|
|
|
Handler: role.SystemSaveRoleHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodDelete,
|
|
|
Path: "/system/role/:id",
|
|
|
Handler: role.SystemDeleteRoleHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPut,
|
|
|
Path: "/system/role/:id",
|
|
|
Handler: role.SystemUpdateRoleHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/role/search",
|
|
|
Handler: role.SystemSearchRoleHandler(serverCtx),
|
|
|
},
|
|
|
}...,
|
|
|
),
|
|
|
rest.WithJwt(serverCtx.Config.SystemAuth.AccessSecret),
|
|
|
rest.WithPrefix("/v1"),
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
[]rest.Route{
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/department/list",
|
|
|
Handler: department.SystemListHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/department/add",
|
|
|
Handler: department.SystemAddHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodGet,
|
|
|
Path: "/system/department/:id",
|
|
|
Handler: department.SystemGetHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPut,
|
|
|
Path: "/system/department/:id",
|
|
|
Handler: department.SystemUpdateHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodDelete,
|
|
|
Path: "/system/department/:id",
|
|
|
Handler: department.SystemDeleteHandler(serverCtx),
|
|
|
},
|
|
|
},
|
|
|
rest.WithMiddlewares(
|
|
|
[]rest.Middleware{serverCtx.LoginStatusCheck},
|
|
|
[]rest.Route{
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/department/list",
|
|
|
Handler: department.SystemListHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPost,
|
|
|
Path: "/system/department/add",
|
|
|
Handler: department.SystemAddHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodGet,
|
|
|
Path: "/system/department/:id",
|
|
|
Handler: department.SystemGetHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodPut,
|
|
|
Path: "/system/department/:id",
|
|
|
Handler: department.SystemUpdateHandler(serverCtx),
|
|
|
},
|
|
|
{
|
|
|
Method: http.MethodDelete,
|
|
|
Path: "/system/department/:id",
|
|
|
Handler: department.SystemDeleteHandler(serverCtx),
|
|
|
},
|
|
|
}...,
|
|
|
),
|
|
|
rest.WithJwt(serverCtx.Config.SystemAuth.AccessSecret),
|
|
|
rest.WithPrefix("/v1"),
|
|
|
)
|
...
|
...
|
|