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,10 +61,14 @@ func onboardingProcess(operationID, userID, userName, faceURL, phoneNumber, emai
} else {
joinDepartmentIDList = config.Config.Demo.JoinDepartmentIDList
}
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.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())
}
}
}

@ -501,13 +501,14 @@ type config struct {
SmtpAddr string `yaml:"smtpAddr"`
SmtpPort int `yaml:"smtpPort"`
}
TestDepartMentID string `yaml:"testDepartMentID"`
ImAPIURL string `yaml:"imAPIURL"`
NeedInvitationCode bool `yaml:"needInvitationCode"`
OnboardProcess bool `yaml:"onboardProcess"`
JoinDepartmentIDList []string `yaml:"joinDepartmentIDList"`
JoinDepartmentGroups bool `yaml:"joinDepartmentGroups"`
OaNotification bool `yaml:"oaNotification"`
TestDepartMentID string `yaml:"testDepartMentID"`
ImAPIURL string `yaml:"imAPIURL"`
NeedInvitationCode bool `yaml:"needInvitationCode"`
OnboardProcess bool `yaml:"onboardProcess"`
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