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