Skip to content

Commit

Permalink
feature: 添加自定义字段,docker-compose添加配置文件挂载 (opsre#51)
Browse files Browse the repository at this point in the history
Co-authored-by: ruochen <[email protected]>
  • Loading branch information
0x0034 and ruochen authored Jul 4, 2022
1 parent e4e4786 commit 0367a63
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ go-ldap-admin

# Dependency directories (remove the comment below to include it)
# vendor/
tmp
tmp
docs/docker-compose/data
1 change: 1 addition & 0 deletions docs/docker-compose/config/config.yml
2 changes: 2 additions & 0 deletions docs/docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ services:
WAIT_HOSTS: mysql:3306, openldap:389
ports:
- 8888:8888
volumes:
- ./config/config.yml:/app/config.yml
depends_on:
- mysql
- openldap
Expand Down
8 changes: 7 additions & 1 deletion public/client/dingtalk/dingtalk.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func GetAllUsers() (ret []map[string]interface{}, err error) {
ele := make(map[string]interface{})
ele["userid"] = user.UserId
ele["unionid"] = user.UnionId
ele["name_pinyin"] = strings.Join(pinyin.LazyConvert(user.Name, nil), "")
ele["custom_name_pinyin"] = strings.Join(pinyin.LazyConvert(user.Name, nil), "")
ele["name"] = user.Name
ele["avatar"] = user.Avatar
ele["mobile"] = user.Mobile
Expand All @@ -62,7 +62,13 @@ func GetAllUsers() (ret []map[string]interface{}, err error) {
ele["remark"] = user.Remark
ele["leader"] = user.Leader
ele["org_email"] = user.OrgEmail
if user.OrgEmail != "" {
ele["custom_nickname_org_email"] = strings.Split(user.OrgEmail, "@")[0]
}
ele["email"] = user.Email
if user.Email != "" {
ele["custom_nickname_email"] = strings.Split(user.Email, "@")[0]
}
// 部门ids
var sourceDeptIds []string
for _, deptId := range user.DeptIds {
Expand Down
8 changes: 7 additions & 1 deletion public/client/feishu/feishu.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,18 @@ func GetAllUsers() (ret []map[string]interface{}, err error) {
for _, user := range res.Items {
ele := make(map[string]interface{})
ele["name"] = user.Name
ele["name_pinyin"] = strings.Join(pinyin.LazyConvert(user.Name, nil), "")
ele["custom_name_pinyin"] = strings.Join(pinyin.LazyConvert(user.Name, nil), "")
ele["union_id"] = user.UnionID
ele["user_id"] = user.UserID
ele["open_id"] = user.OpenID
ele["en_name"] = user.EnName
ele["nickname"] = user.Nickname
if user.Email != "" {
ele["custom_nickname_email"] = strings.Split(user.Email, "@")[0]
}
if user.EnterpriseEmail != "" {
ele["custom_nickname_enterprise_email"] = strings.Split(user.EnterpriseEmail, "@")[0]
}
ele["email"] = user.Email
ele["mobile"] = user.Mobile[3:]
ele["gender"] = user.Gender
Expand Down
8 changes: 7 additions & 1 deletion public/client/wechat/wecom.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,19 @@ func GetAllUsers() (ret []map[string]interface{}, err error) {
for _, user := range users.UserList {
ele := make(map[string]interface{})
ele["name"] = user.Name
ele["name_pinyin"] = strings.Join(pinyin.LazyConvert(user.Name, nil), "")
ele["custom_name_pinyin"] = strings.Join(pinyin.LazyConvert(user.Name, nil), "")
ele["userid"] = user.UserID
ele["mobile"] = user.Mobile
ele["position"] = user.Position
ele["gender"] = user.Gender
ele["email"] = user.Email
if user.Email != "" {
ele["custom_nickname_email"] = strings.Split(user.Email, "@")[0]
}
ele["biz_email"] = user.BizMail
if user.BizMail != "" {
ele["custom_nickname_biz_email"] = strings.Split(user.BizMail, "@")[0]
}
ele["avatar"] = user.Avatar
ele["telephone"] = user.Telephone
ele["alias"] = user.Alias
Expand Down

0 comments on commit 0367a63

Please sign in to comment.