mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
alter demo
This commit is contained in:
parent
278d09e4db
commit
79907b374a
@ -195,9 +195,9 @@ func GetUsersInfo(c *gin.Context) {
|
|||||||
c.JSON(http.StatusOK, resp)
|
c.JSON(http.StatusOK, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Summary 更新用户信息
|
// @Summary 修改用户信息
|
||||||
// @Description 向你说Hello
|
// @Description 修改用户信息
|
||||||
// @Tags 测试
|
// @Tags 修改用户信息
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param who query string true "人名"
|
// @Param who query string true "人名"
|
||||||
// @Success 200 {string} string "{"msg": "hello Razeen"}"
|
// @Success 200 {string} string "{"msg": "hello Razeen"}"
|
||||||
|
@ -21,9 +21,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func onboardingProcess(operationID, userID, userName, faceURL 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); err != nil {
|
if err := createOrganizationUser(operationID, userID, userName, phoneNumber, email); err != nil {
|
||||||
log.NewError(operationID, utils.GetSelfFuncName(), "createOrganizationUser failed", err.Error())
|
log.NewError(operationID, utils.GetSelfFuncName(), "createOrganizationUser failed", err.Error())
|
||||||
}
|
}
|
||||||
departmentID, err := imdb.GetRandomDepartmentID()
|
departmentID, err := imdb.GetRandomDepartmentID()
|
||||||
@ -45,7 +45,7 @@ func onboardingProcess(operationID, userID, userName, faceURL string) {
|
|||||||
oaNotification(operationID, userID)
|
oaNotification(operationID, userID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func createOrganizationUser(operationID, userID, userName string) error {
|
func createOrganizationUser(operationID, userID, userName, phoneNumber, email string) error {
|
||||||
defer func() {
|
defer func() {
|
||||||
log.NewInfo(operationID, utils.GetSelfFuncName(), userID)
|
log.NewInfo(operationID, utils.GetSelfFuncName(), userID)
|
||||||
}()
|
}()
|
||||||
@ -64,6 +64,9 @@ func createOrganizationUser(operationID, userID, userName string) error {
|
|||||||
EnglishName: randomEnglishName(),
|
EnglishName: randomEnglishName(),
|
||||||
Gender: constant.Male,
|
Gender: constant.Male,
|
||||||
CreateTime: uint32(time.Now().Unix()),
|
CreateTime: uint32(time.Now().Unix()),
|
||||||
|
Telephone: phoneNumber,
|
||||||
|
Mobile: phoneNumber,
|
||||||
|
Email: email,
|
||||||
},
|
},
|
||||||
OperationID: operationID,
|
OperationID: operationID,
|
||||||
OpUserID: config.Config.Manager.AppManagerUid[0],
|
OpUserID: config.Config.Manager.AppManagerUid[0],
|
||||||
|
@ -97,7 +97,7 @@ func SetPassword(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
log.Info(params.OperationID, "end setPassword", account, params.Password)
|
log.Info(params.OperationID, "end setPassword", account, params.Password)
|
||||||
// demo onboarding
|
// demo onboarding
|
||||||
onboardingProcess(params.OperationID, userID, params.Nickname, params.FaceURL)
|
onboardingProcess(params.OperationID, userID, params.Nickname, params.FaceURL, params.AreaCode+params.PhoneNumber, params.Email)
|
||||||
c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "", "data": openIMRegisterResp.UserToken})
|
c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "", "data": openIMRegisterResp.UserToken})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user