|
|
@ -9,7 +9,7 @@ import (
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func callbackUserOnline(operationID, userID string, platformID int, token string, isAppBackgroundStatusChanged bool, connID string) cbApi.CommonCallbackResp {
|
|
|
|
func callbackUserOnline(operationID, userID string, platformID int, token string, isAppBackground bool, connID string) cbApi.CommonCallbackResp {
|
|
|
|
callbackResp := cbApi.CommonCallbackResp{OperationID: operationID}
|
|
|
|
callbackResp := cbApi.CommonCallbackResp{OperationID: operationID}
|
|
|
|
if !config.Config.Callback.CallbackUserOnline.Enable {
|
|
|
|
if !config.Config.Callback.CallbackUserOnline.Enable {
|
|
|
|
return callbackResp
|
|
|
|
return callbackResp
|
|
|
@ -25,9 +25,9 @@ func callbackUserOnline(operationID, userID string, platformID int, token string
|
|
|
|
},
|
|
|
|
},
|
|
|
|
UserID: userID,
|
|
|
|
UserID: userID,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Seq: int(time.Now().UnixNano() / 1e6),
|
|
|
|
Seq: int(time.Now().UnixNano() / 1e6),
|
|
|
|
IsAppBackgroundStatusChanged: isAppBackgroundStatusChanged,
|
|
|
|
IsAppBackground: isAppBackground,
|
|
|
|
ConnID: connID,
|
|
|
|
ConnID: connID,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
callbackUserOnlineResp := &cbApi.CallbackUserOnlineResp{CommonCallbackResp: &callbackResp}
|
|
|
|
callbackUserOnlineResp := &cbApi.CallbackUserOnlineResp{CommonCallbackResp: &callbackResp}
|
|
|
|
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserOnlineCommand, callbackUserOnlineReq, callbackUserOnlineResp, config.Config.Callback.CallbackUserOnline.CallbackTimeOut); err != nil {
|
|
|
|
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserOnlineCommand, callbackUserOnlineReq, callbackUserOnlineResp, config.Config.Callback.CallbackUserOnline.CallbackTimeOut); err != nil {
|
|
|
@ -37,7 +37,7 @@ func callbackUserOnline(operationID, userID string, platformID int, token string
|
|
|
|
return callbackResp
|
|
|
|
return callbackResp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func callbackUserOffline(operationID, userID string, platformID int, isAppBackgroundStatusChanged bool, connID string) cbApi.CommonCallbackResp {
|
|
|
|
func callbackUserOffline(operationID, userID string, platformID int, connID string) cbApi.CommonCallbackResp {
|
|
|
|
callbackResp := cbApi.CommonCallbackResp{OperationID: operationID}
|
|
|
|
callbackResp := cbApi.CommonCallbackResp{OperationID: operationID}
|
|
|
|
if !config.Config.Callback.CallbackUserOffline.Enable {
|
|
|
|
if !config.Config.Callback.CallbackUserOffline.Enable {
|
|
|
|
return callbackResp
|
|
|
|
return callbackResp
|
|
|
@ -52,9 +52,8 @@ func callbackUserOffline(operationID, userID string, platformID int, isAppBackgr
|
|
|
|
},
|
|
|
|
},
|
|
|
|
UserID: userID,
|
|
|
|
UserID: userID,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Seq: int(time.Now().UnixNano() / 1e6),
|
|
|
|
Seq: int(time.Now().UnixNano() / 1e6),
|
|
|
|
IsAppBackgroundStatusChanged: isAppBackgroundStatusChanged,
|
|
|
|
ConnID: connID,
|
|
|
|
ConnID: connID,
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
callbackUserOfflineResp := &cbApi.CallbackUserOfflineResp{CommonCallbackResp: &callbackResp}
|
|
|
|
callbackUserOfflineResp := &cbApi.CallbackUserOfflineResp{CommonCallbackResp: &callbackResp}
|
|
|
|
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserOfflineCommand, callbackOfflineReq, callbackUserOfflineResp, config.Config.Callback.CallbackUserOffline.CallbackTimeOut); err != nil {
|
|
|
|
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserOfflineCommand, callbackOfflineReq, callbackUserOfflineResp, config.Config.Callback.CallbackUserOffline.CallbackTimeOut); err != nil {
|
|
|
|