Merge remote-tracking branch 'origin/v2.3.0release' into v2.3.0release

pull/351/head
skiffer-git 2 years ago
commit 49a127d97d

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

@ -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,10 +61,14 @@ 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 {
for _, departmentID := range joinDepartmentIDList { if err := createOrganizationUser(operationID, userID, userName, phoneNumber, email); err != nil {
if err := joinTestDepartment(operationID, userID, departmentID); err != nil { log.NewError(operationID, utils.GetSelfFuncName(), "createOrganizationUser failed", err.Error())
log.NewError(operationID, utils.GetSelfFuncName(), "joinTestDepartment 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"` SmtpAddr string `yaml:"smtpAddr"`
SmtpPort int `yaml:"smtpPort"` SmtpPort int `yaml:"smtpPort"`
} }
TestDepartMentID string `yaml:"testDepartMentID"` TestDepartMentID string `yaml:"testDepartMentID"`
ImAPIURL string `yaml:"imAPIURL"` ImAPIURL string `yaml:"imAPIURL"`
NeedInvitationCode bool `yaml:"needInvitationCode"` NeedInvitationCode bool `yaml:"needInvitationCode"`
OnboardProcess bool `yaml:"onboardProcess"` OnboardProcess bool `yaml:"onboardProcess"`
JoinDepartmentIDList []string `yaml:"joinDepartmentIDList"` JoinDepartmentIDList []string `yaml:"joinDepartmentIDList"`
JoinDepartmentGroups bool `yaml:"joinDepartmentGroups"` JoinDepartmentGroups bool `yaml:"joinDepartmentGroups"`
OaNotification bool `yaml:"oaNotification"` OaNotification bool `yaml:"oaNotification"`
CreateOrganizationUserAndJoinDepartment bool `json:"createOrganizationUserAndJoinDepartment"`
} }
Rtc struct { Rtc struct {
SignalTimeout string `yaml:"signalTimeout"` SignalTimeout string `yaml:"signalTimeout"`

Loading…
Cancel
Save