join groups

pull/351/head
wangchuxiao 2 years ago
parent 8c21d0360f
commit c3d3f0986e

@ -750,6 +750,7 @@ demo:
testDepartMentID: 001
imAPIURL: http://127.0.0.1:10002
onboardProcess: false # 是否开启注册流程
createOrganizationUserAndJoinDepartment: false
joinDepartmentIDList: [] # 用户注册进来默认加的部门ID列表 不填就随机
joinDepartmentGroups: false # 注册是否加部门群
oaNotification: false # 注册是否发送OA通知

@ -49,9 +49,7 @@ func OnboardingProcessRoutine() {
func onboardingProcess(operationID, userID, userName, faceURL, phoneNumber, email string) {
log.NewInfo(operationID, utils.GetSelfFuncName(), userName, userID, faceURL)
if err := createOrganizationUser(operationID, userID, userName, phoneNumber, email); err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), "createOrganizationUser failed", err.Error())
}
var joinDepartmentIDList []string
if len(config.Config.Demo.JoinDepartmentIDList) == 0 {
departmentID, err := imdb.GetRandomDepartmentID()
@ -63,12 +61,16 @@ func onboardingProcess(operationID, userID, userName, faceURL, phoneNumber, emai
} else {
joinDepartmentIDList = config.Config.Demo.JoinDepartmentIDList
}
if config.Config.Demo.CreateOrganizationUserAndJoinDepartment && len(joinDepartmentIDList) > 0 {
if err := createOrganizationUser(operationID, userID, userName, phoneNumber, email); err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), "createOrganizationUser failed", err.Error())
}
for _, departmentID := range joinDepartmentIDList {
if err := joinTestDepartment(operationID, userID, departmentID); err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), "joinTestDepartment failed", err.Error())
}
}
}
if config.Config.Demo.JoinDepartmentGroups {
for _, departmentID := range joinDepartmentIDList {

@ -508,6 +508,7 @@ type config struct {
JoinDepartmentIDList []string `yaml:"joinDepartmentIDList"`
JoinDepartmentGroups bool `yaml:"joinDepartmentGroups"`
OaNotification bool `yaml:"oaNotification"`
CreateOrganizationUserAndJoinDepartment bool `json:"createOrganizationUserAndJoinDepartment"`
}
Rtc struct {
SignalTimeout string `yaml:"signalTimeout"`

Loading…
Cancel
Save