fusenapi/server/ldap-admin/internal/handler/deleteldaporginationhandler.go

36 lines
777 B
Go
Raw Normal View History

2023-11-13 09:52:20 +00:00
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"
)
2023-11-16 06:29:24 +00:00
func DeleteLdapOrginationHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
2023-11-13 09:52:20 +00:00
return func(w http.ResponseWriter, r *http.Request) {
2023-11-16 06:29:24 +00:00
var req types.DeleteLdapOrginationReq
2023-11-13 09:52:20 +00:00
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}
// 创建一个业务逻辑层实例
2023-11-16 06:29:24 +00:00
l := logic.NewDeleteLdapOrginationLogic(r.Context(), svcCtx)
2023-11-13 09:52:20 +00:00
rl := reflect.ValueOf(l)
basic.BeforeLogic(w, r, rl)
2023-11-16 06:29:24 +00:00
resp := l.DeleteLdapOrgination(&req, userinfo)
2023-11-13 09:52:20 +00:00
if !basic.AfterLogic(w, r, rl, resp) {
basic.NormalAfterLogic(w, r, resp)
}
}
}