getUserSessionInfo method
Future<GenericServerResponse<BeaResultCurrentUserInfo> >
getUserSessionInfo(
- GenericServerInput? input
Implementation
Future<GenericServerResponse<BeaResultCurrentUserInfo>> getUserSessionInfo(GenericServerInput? input) async {
GenericServerResponse<BeaResultCurrentUserInfo> genericServerResponse = new GenericServerResponse<BeaResultCurrentUserInfo>();
try{
if(input == null){
throw new Exception("Input not found.");
}
String url = UrlUtils.getUrl(_baseUrl, UrlUtils.URL_CURRENT_LOGIN_INFO);
String jsonInput = '{}';
Response response = await bsm!.genericBeaHttpPost(url, jsonInput);
int? statusCode = response.statusCode;
switch(statusCode){
case 200:
genericServerResponse.data = BeaResultCurrentUserInfo.fromJson(response.data['result']);
break;
case 500:
var res = response.data['error'];
BeaError? error = res == null ? res : BeaError.fromJson(res);
if (error != null) {
genericServerResponse.beaError = error;
} else {
genericServerResponse.beaError = new BeaError("Unknown Error", 0, "");
}
break;
case 401:
genericServerResponse.beaSession = new BeaSession(true);
break;
}
}on Exception catch (e){
print('Error to get BEA user session info');
FLog.error(
className: this.runtimeType.toString(),
methodName: "getUserSessionInfo",
text: 'Error to get BEA user session info - $e');
throw e;
}
return genericServerResponse;
}