package logic import ( "context" "fusenapi/utils/auth" "fusenapi/utils/basic" "fusenapi/server/ldap-admin/internal/svc" "fusenapi/server/ldap-admin/internal/types" "github.com/zeromicro/go-zero/core/logx" ) type GetDepartmentsLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewGetDepartmentsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDepartmentsLogic { return &GetDepartmentsLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } // 处理进入前逻辑w,r // func (l *GetDepartmentsLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) { // } func (l *GetDepartmentsLogic) GetDepartments(req *types.Request, userinfo *auth.UserInfo) (resp *basic.Response) { // todo 从ldap获取组织架构数据 return nil } /* dn: dc=fusen,dc=com o : [fusen com] dc : [fusen] objectClass : [top dcObject organization] dn: cn=root,dc=fusen,dc=com cn : [root] objectClass : [organizationalRole] description : [Directory Manager] dn: ou=People,dc=fusen,dc=com ou : [People] objectClass : [top organizationalUnit] telephoneNumber : [aabb] dn: ou=Group,dc=fusen,dc=com ou : [Group] objectClass : [top organizationalUnit] dn: uid=fsuser,ou=People,dc=fusen,dc=com uid : [fsuser] cn : [fsuser] sn : [fsuser] mail : [fsuser@fusen.com] objectClass : [person organizationalPerson inetOrgPerson posixAccount top shadowAccount] userPassword : [{crypt}$6$fpyhuX7q$XBAA2URfWZCYZRLQpzzqucuFymrYvJL/NXztQ6/ug89GHvfN.OCUOGOZzyoKZwgF/LXToY5Wmqf9Yb0JoQbkL1] shadowLastChange : [19674] shadowMin : [0] shadowMax : [99999] shadowWarning : [7] loginShell : [/bin/bash] uidNumber : [1000] gidNumber : [1000] homeDirectory : [/home/fsuser] dn: uid=fstest,ou=People,dc=fusen,dc=com uid : [fstest] cn : [fstest] sn : [fstest] mail : [fstest@fusen.com] objectClass : [person organizationalPerson inetOrgPerson posixAccount top shadowAccount] userPassword : [{crypt}$6$SYX2T3.y$OvYYU08PG8g.4SvI3A4MHSzfK5qSZeqB/2StqXxtd0E/RAENXFXBQH4bvkjLsbcDQMMobkzoyRyVJZv5xcK3r0] shadowLastChange : [19674] shadowMin : [0] shadowMax : [99999] shadowWarning : [7] loginShell : [/bin/bash] uidNumber : [1001] gidNumber : [1001] homeDirectory : [/home/fstest] mobile : [17557283677] dn: cn=fusen,ou=Group,dc=fusen,dc=com objectClass : [posixGroup top] cn : [fusen] userPassword : [{crypt}x] gidNumber : [1000] dn: cn=fusen2,ou=Group,dc=fusen,dc=com objectClass : [posixGroup top] cn : [fusen2] userPassword : [{crypt}x] gidNumber : [1001] dn: cn=gitlab,ou=Group,dc=fusen,dc=com objectClass : [top groupOfNames] cn : [gitlab] member : [uid=testuser,ou=People,dc=funsen,dc=com] */