This commit is contained in:
laodaming
2023-11-24 15:02:11 +08:00
parent a179924253
commit 43b45a5461
6 changed files with 4 additions and 120 deletions

View File

@@ -37,11 +37,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/api/ldap-admin/set_ldap_group_auth",
Handler: SetLdapGroupAuthHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/api/ldap-admin/set_ldap_group_user",
Handler: SetLdapGroupUserHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/api/ldap-admin/get_apis",

View File

@@ -1,35 +0,0 @@
package handler
import (
"net/http"
"reflect"
"fusenapi/utils/basic"
"fusenapi/server/ldap-admin/internal/logic"
"fusenapi/server/ldap-admin/internal/svc"
"fusenapi/server/ldap-admin/internal/types"
)
func SetLdapGroupUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.SetLdapGroupUserReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}
// 创建一个业务逻辑层实例
l := logic.NewSetLdapGroupUserLogic(r.Context(), svcCtx)
rl := reflect.ValueOf(l)
basic.BeforeLogic(w, r, rl)
resp := l.SetLdapGroupUser(&req, userinfo)
if !basic.AfterLogic(w, r, rl, resp) {
basic.NormalAfterLogic(w, r, resp)
}
}
}