feat: rbac迁移完成,并已部署至dev服务器
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
menu "sundynix-micro-go/app/system/api/internal/handler/menu"
|
||||
operationRecord "sundynix-micro-go/app/system/api/internal/handler/operationRecord"
|
||||
role "sundynix-micro-go/app/system/api/internal/handler/role"
|
||||
user "sundynix-micro-go/app/system/api/internal/handler/user"
|
||||
"sundynix-micro-go/app/system/api/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
@@ -27,7 +28,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
},
|
||||
{
|
||||
// 删除客户端
|
||||
Method: http.MethodDelete,
|
||||
Method: http.MethodPost,
|
||||
Path: "/client/delete",
|
||||
Handler: client.DeleteClientHandler(serverCtx),
|
||||
},
|
||||
@@ -39,7 +40,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
},
|
||||
{
|
||||
// 更新客户端
|
||||
Method: http.MethodPut,
|
||||
Method: http.MethodPost,
|
||||
Path: "/client/update",
|
||||
Handler: client.UpdateClientHandler(serverCtx),
|
||||
},
|
||||
@@ -58,7 +59,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
},
|
||||
{
|
||||
// 删除字典
|
||||
Method: http.MethodDelete,
|
||||
Method: http.MethodPost,
|
||||
Path: "/dict/delete",
|
||||
Handler: dict.DeleteDictHandler(serverCtx),
|
||||
},
|
||||
@@ -70,7 +71,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
},
|
||||
{
|
||||
// 更新字典
|
||||
Method: http.MethodPut,
|
||||
Method: http.MethodPost,
|
||||
Path: "/dict/update",
|
||||
Handler: dict.UpdateDictHandler(serverCtx),
|
||||
},
|
||||
@@ -95,7 +96,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
},
|
||||
{
|
||||
// 删除菜单
|
||||
Method: http.MethodDelete,
|
||||
Method: http.MethodPost,
|
||||
Path: "/menu/delete",
|
||||
Handler: menu.DeleteMenuHandler(serverCtx),
|
||||
},
|
||||
@@ -107,7 +108,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
},
|
||||
{
|
||||
// 更新菜单
|
||||
Method: http.MethodPut,
|
||||
Method: http.MethodPost,
|
||||
Path: "/menu/update",
|
||||
Handler: menu.UpdateMenuHandler(serverCtx),
|
||||
},
|
||||
@@ -120,7 +121,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
[]rest.Route{
|
||||
{
|
||||
// 删除操作日志
|
||||
Method: http.MethodDelete,
|
||||
Method: http.MethodPost,
|
||||
Path: "/log/delete",
|
||||
Handler: operationRecord.DeleteOperationRecordHandler(serverCtx),
|
||||
},
|
||||
@@ -145,7 +146,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
},
|
||||
{
|
||||
// 删除角色
|
||||
Method: http.MethodDelete,
|
||||
Method: http.MethodPost,
|
||||
Path: "/role/delete",
|
||||
Handler: role.DeleteRoleHandler(serverCtx),
|
||||
},
|
||||
@@ -157,7 +158,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
},
|
||||
{
|
||||
// 更新角色
|
||||
Method: http.MethodPut,
|
||||
Method: http.MethodPost,
|
||||
Path: "/role/update",
|
||||
Handler: role.UpdateRoleHandler(serverCtx),
|
||||
},
|
||||
@@ -165,4 +166,41 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
||||
rest.WithPrefix("/api/sys"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// 创建用户
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/create",
|
||||
Handler: user.CreateUserHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 删除用户
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/delete",
|
||||
Handler: user.DeleteUserHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 用户列表
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/list",
|
||||
Handler: user.GetUserListHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 重置密码
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/resetPassword",
|
||||
Handler: user.ResetPasswordHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 更新用户
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/update",
|
||||
Handler: user.UpdateUserHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
||||
rest.WithPrefix("/api/sys"),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user