1600 lines
44 KiB
Dart
1600 lines
44 KiB
Dart
import 'dart:convert';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import '/flutter_flow/flutter_flow_util.dart';
|
|
import 'api_manager.dart';
|
|
|
|
export 'api_manager.dart' show ApiCallResponse;
|
|
|
|
const _kPrivateApiFunctionName = 'ffPrivateApiCall';
|
|
|
|
/// Start PHP Group Code
|
|
|
|
class PhpGroup {
|
|
static String getBaseUrl() => 'https://freaccess.com.br/freaccess';
|
|
static Map<String, String> headers = {};
|
|
static LoginCall loginCall = LoginCall();
|
|
static RegisterCall registerCall = RegisterCall();
|
|
static ForgotPasswordCall forgotPasswordCall = ForgotPasswordCall();
|
|
static GetLocalsCall getLocalsCall = GetLocalsCall();
|
|
static PostScheduleVisitorCall postScheduleVisitorCall =
|
|
PostScheduleVisitorCall();
|
|
static PostScheduleVisitCall postScheduleVisitCall = PostScheduleVisitCall();
|
|
static DebugCallCall debugCallCall = DebugCallCall();
|
|
static GetScheduleVisitCall getScheduleVisitCall = GetScheduleVisitCall();
|
|
static GetDadosCall getDadosCall = GetDadosCall();
|
|
static GetVisitorByDocCall getVisitorByDocCall = GetVisitorByDocCall();
|
|
static GetFotoVisitanteCall getFotoVisitanteCall = GetFotoVisitanteCall();
|
|
static PostProvVisitSchedulingCall postProvVisitSchedulingCall =
|
|
PostProvVisitSchedulingCall();
|
|
static GetVisitsCall getVisitsCall = GetVisitsCall();
|
|
static DeleteVisitCall deleteVisitCall = DeleteVisitCall();
|
|
static GetPessoasLocalCall getPessoasLocalCall = GetPessoasLocalCall();
|
|
static RespondeSolicitacaoCall respondeSolicitacaoCall =
|
|
RespondeSolicitacaoCall();
|
|
}
|
|
|
|
class LoginCall {
|
|
Future<ApiCallResponse> call({
|
|
String? email = '',
|
|
String? password = '',
|
|
String? uuid = '',
|
|
String? type = '',
|
|
String? description = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'login',
|
|
apiUrl: '$baseUrl/login.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'email': email,
|
|
'password': password,
|
|
'uuid': uuid,
|
|
'tipo': type,
|
|
'descricao': description,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? msg(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.error_msg''',
|
|
));
|
|
List? info(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.error_info''',
|
|
true,
|
|
) as List?;
|
|
String? userUUID(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.uid''',
|
|
));
|
|
dynamic userObject(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.user''',
|
|
);
|
|
String? userName(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.user.name''',
|
|
));
|
|
String? userEmail(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.user.email''',
|
|
));
|
|
String? userDeviceId(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.user.dev_id''',
|
|
));
|
|
String? userCreatAt(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.user.created_at''',
|
|
));
|
|
String? userUpdateAt(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.user.updated_at''',
|
|
));
|
|
String? userStatus(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.user.status''',
|
|
));
|
|
}
|
|
|
|
class RegisterCall {
|
|
Future<ApiCallResponse> call({
|
|
String? name = '',
|
|
String? email = '',
|
|
String? password = '',
|
|
String? token = '',
|
|
String? uuid = '',
|
|
String? tipo = '',
|
|
String? descricao = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'register',
|
|
apiUrl: '$baseUrl/registro.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'name': name,
|
|
'email': email,
|
|
'password': password,
|
|
'token': token,
|
|
'uuid': uuid,
|
|
'tipo': tipo,
|
|
'descricao': descricao,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? uid(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.uid''',
|
|
));
|
|
dynamic user(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.user''',
|
|
);
|
|
String? name(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.user.name''',
|
|
));
|
|
String? email(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.user.email''',
|
|
));
|
|
String? devId(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.user.dev_id''',
|
|
));
|
|
String? createdAt(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.user.created_at''',
|
|
));
|
|
}
|
|
|
|
class ForgotPasswordCall {
|
|
Future<ApiCallResponse> call({
|
|
String? email = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'forgotPassword',
|
|
apiUrl: '$baseUrl/iforgot.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'email': email,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? msg(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.error_msg''',
|
|
));
|
|
}
|
|
|
|
class GetLocalsCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getLocals',
|
|
apiUrl: '$baseUrl/getLocais.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
List? locais(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.locais''',
|
|
true,
|
|
) as List?;
|
|
String? cluOwnerID(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.locais[:].CLU_OWNER_ID''',
|
|
));
|
|
String? cluOwnerDSC(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.locais[:].CLU_OWNER_DSC''',
|
|
));
|
|
String? cluStatus(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.locais[:].CLU_STATUS''',
|
|
));
|
|
String? cluBlkMessage(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.locais[:].CLU_BLK_MESSAGE''',
|
|
));
|
|
String? cliID(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.locais[:].CLI_ID''',
|
|
));
|
|
String? cliPrefix(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.locais[:].CLI_PREFIXO''',
|
|
));
|
|
String? cliName(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.locais[:].CLI_NOME''',
|
|
));
|
|
String? userName(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.locais[:].USU_NOME''',
|
|
));
|
|
String? cliSysId(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.locais[:].CLI_SIS_ID''',
|
|
));
|
|
}
|
|
|
|
class PostScheduleVisitorCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
String? cliID = '',
|
|
String? atividade = 'putVisitante',
|
|
String? documento = '',
|
|
String? nome = '',
|
|
String? tipo = '',
|
|
String? foto = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'postScheduleVisitor',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'Documento': documento,
|
|
'Nome': nome,
|
|
'Tipo': tipo,
|
|
'Foto': foto,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? errorMsg(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.error_msg''',
|
|
));
|
|
}
|
|
|
|
class PostScheduleVisitCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
String? cliID = '',
|
|
String? atividade = '',
|
|
String? devDesc = '',
|
|
String? idVisitante = '',
|
|
String? dtInicio = '',
|
|
String? dtFim = '',
|
|
String? unica = '',
|
|
int? idMotivo,
|
|
int? idNAC,
|
|
String? obs = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'postScheduleVisit',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'idVisitante': idVisitante,
|
|
'dtInicio': dtInicio,
|
|
'dtFim': dtFim,
|
|
'unica': unica,
|
|
'idMotivo': idMotivo,
|
|
'idNAC': idNAC,
|
|
'obs': obs,
|
|
'DevDesc': devDesc,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? errorMsg(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.error_msg''',
|
|
));
|
|
}
|
|
|
|
class DebugCallCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
String? cliID = '',
|
|
String? atividade = '',
|
|
String? devDesc = '',
|
|
String? idVisitante = '',
|
|
String? dtInicio = '',
|
|
String? dtFim = '',
|
|
String? unica = '',
|
|
int? idMotivo,
|
|
int? idNAC,
|
|
String? obs = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'debugCall',
|
|
apiUrl: '$baseUrl/jonh.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'DevDesc': devDesc,
|
|
'idVisitante': idVisitante,
|
|
'dtInicio': dtInicio,
|
|
'dtFim': dtFim,
|
|
'unica': unica,
|
|
'idMotivo': idMotivo,
|
|
'idNAC': idNAC,
|
|
'obs': obs,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? errorMsg(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.error_msg''',
|
|
));
|
|
}
|
|
|
|
class GetScheduleVisitCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
String? cliUUID = '',
|
|
String? atividade = '',
|
|
int? pageSize,
|
|
int? pageNumber,
|
|
String? chaveBusca = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getScheduleVisit',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliUUID,
|
|
'atividade': atividade,
|
|
'pageSize': pageSize,
|
|
'pageNumber': pageNumber,
|
|
'chaveBusca': chaveBusca,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? errorMsg(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.error_msg''',
|
|
));
|
|
int? totalRows(dynamic response) => castToType<int>(getJsonField(
|
|
response,
|
|
r'''$.total_rows''',
|
|
));
|
|
List? visitas(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.visitas''',
|
|
true,
|
|
) as List?;
|
|
List<String>? visitaDesNome(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].DES_NOME''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaMotDescricao(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_DESCRICAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaMotDia(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_DIA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List? visitaMotHorafixa(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_HORAFIXA''',
|
|
true,
|
|
) as List?;
|
|
List<String>? visitaMotHoras(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_HORAS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaMotMinutos(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_MINUTOS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaMotTipo(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_TIPO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaNacDescricao(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].NAC_DESCRICAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVawChave(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_CHAVE''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVarDestino(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_DESTINO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVawDtCriacao(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_DTCRIACAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVawDtFIm(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_DTFIM''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVawDtInicio(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_DTINICIO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVawId(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVawObs(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_OBS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVawStatus(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_STATUS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVawUnica(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_UNICA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVteDocumentos(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_DOCUMENTO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVteEmail(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_EMAIL''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVteEmpresa(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_EMPRESA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVteNome(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_NOME''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVteTipo(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_TIPO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVteTelefone(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_TELEFONE''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? visitaVdoNome(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VDO_NOME''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
int? visitaTotalPages(dynamic response) => castToType<int>(getJsonField(
|
|
response,
|
|
r'''$.total_pages''',
|
|
));
|
|
String? page(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.page''',
|
|
));
|
|
}
|
|
|
|
class GetDadosCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
String? cliUUID = '',
|
|
String? atividade = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getDados',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliUUID,
|
|
'atividade': atividade,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? errorBolean(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? msgStr(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.error_msg''',
|
|
));
|
|
String? visitedDesNomeStr(dynamic response) =>
|
|
castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitado.DES_NOME''',
|
|
));
|
|
String? visitedVDOTIdStr(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitado.VDO_ID''',
|
|
));
|
|
String? visitedVDOTNomeStr(dynamic response) =>
|
|
castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitado.VDO_NOME''',
|
|
));
|
|
String? visitedVDOTipoStr(dynamic response) =>
|
|
castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitado.VDO_TIPO''',
|
|
));
|
|
String? visitedVDOImeiStr(dynamic response) =>
|
|
castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitado.VDO_IMEI''',
|
|
));
|
|
String? visitedVDODocumentoStr(dynamic response) =>
|
|
castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitado.VDO_DOCUMENTO''',
|
|
));
|
|
String? visitedVDOEmailStr(dynamic response) =>
|
|
castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitado.VDO_EMAIL''',
|
|
));
|
|
String? visitedVDOStatusWebStr(dynamic response) =>
|
|
castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitado.VDO_STATUSWEB''',
|
|
));
|
|
List<String>? reasonsMotIdList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.motivos[:].MOT_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? reasonsMotDescStrList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.motivos[:].MOT_DESCRICAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? reasonsMotTypeStrList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.motivos[:].MOT_TIPO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? reasonsMotWebStrList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.motivos[:].MOT_WEB''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
dynamic visitedJson(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.visitado''',
|
|
);
|
|
String? visitedDescIdStr(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitado.DES_ID''',
|
|
));
|
|
String? visitedVDoNotTerceirosStr(dynamic response) =>
|
|
castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitado.VDO_NOTTERCEIROS''',
|
|
));
|
|
List? reasonsJsonList(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.motivos''',
|
|
true,
|
|
) as List?;
|
|
List<String>? resonsMotDiaStrList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.motivos[:].MOT_DIA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? reasonsMotHorasStrList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.motivos[:].MOT_HORAS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List? reasonsMotMinutosStrList(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.motivos[:].MOT_MINUTOS''',
|
|
true,
|
|
) as List?;
|
|
List? reasonsMotHoraFixaStrList(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.motivos[:].MOT_HORAFIXA''',
|
|
true,
|
|
) as List?;
|
|
List? levelJsonList(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.niveis''',
|
|
true,
|
|
) as List?;
|
|
List<String>? levelNACIdStrList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.niveis[:].NAC_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? levelNACDescricaoStrList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.niveis[:].NAC_DESCRICAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? levelNACHorIdStrList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.niveis[:].NAC_HOR_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? levelNACIndPermiteReentradaStrList(dynamic response) =>
|
|
(getJsonField(
|
|
response,
|
|
r'''$.niveis[:].NAC_INDPERMITEREENTRADA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? levelNACObservacaoStrList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.niveis[:].NAC_OBSERVACAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? levelNACTempoAntiCaronaStrList(dynamic response) =>
|
|
(getJsonField(
|
|
response,
|
|
r'''$.niveis[:].NAC_TEMPOANTICARONA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? levelNACTpUserStrList(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.niveis[:].NAC_TPUSER''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
bool? provisionalBoolean(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.provisional''',
|
|
));
|
|
bool? whatsappBoolean(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.whatsapp''',
|
|
));
|
|
}
|
|
|
|
class GetVisitorByDocCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
String? cliID = '',
|
|
String? atividade = '',
|
|
String? documento = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getVisitorByDoc',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'Documento': documento,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? errorMsg(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.error_msg''',
|
|
));
|
|
dynamic visitante(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.visitante''',
|
|
);
|
|
String? vistanteId(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitante.VTE_ID''',
|
|
));
|
|
String? visitanteNome(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitante.VTE_NOME''',
|
|
));
|
|
String? visitanteRG(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitante.VTE_RG''',
|
|
));
|
|
String? visitanteDocumento(dynamic response) =>
|
|
castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitante.VTE_DOCUMENTO''',
|
|
));
|
|
String? visitanteTipo(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.visitante.VTE_TIPO''',
|
|
));
|
|
}
|
|
|
|
class GetFotoVisitanteCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
String? cliID = '',
|
|
String? atividade = '',
|
|
String? documento = '',
|
|
String? tipo = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getFotoVisitante',
|
|
apiUrl: '$baseUrl/getImage.php',
|
|
callType: ApiCallType.GET,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'Documento': documento,
|
|
'tipo': tipo,
|
|
},
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class PostProvVisitSchedulingCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
String? cliID = '',
|
|
String? atividade = '',
|
|
String? data = '',
|
|
String? motivo = '',
|
|
String? nome = '',
|
|
String? proID = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'postProvVisitScheduling',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'data': data,
|
|
'motivo': motivo,
|
|
'nome': nome,
|
|
'proID': proID,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
String? msg(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.mensagem''',
|
|
));
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
}
|
|
|
|
class GetVisitsCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
String? cliID = '',
|
|
String? atividade = '',
|
|
int? pageSize,
|
|
int? pageNumber,
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getVisits',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'pageSize': pageSize,
|
|
'pageNumber': pageNumber,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
int? totalRows(dynamic response) => castToType<int>(getJsonField(
|
|
response,
|
|
r'''$.total_rows''',
|
|
));
|
|
List? visitasList(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.visitas''',
|
|
true,
|
|
) as List?;
|
|
List<String>? desNome(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].DES_NOME''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? motDesc(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_DESCRICAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? motDia(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_DIA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List? motHorafixa(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_HORAFIXA''',
|
|
true,
|
|
) as List?;
|
|
List<String>? motHoras(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_HORAS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? motMinutos(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_MINUTOS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? motTipo(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].MOT_TIPO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? nACDesc(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].NAC_DESCRICAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vAWChave(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_CHAVE''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vAWDestino(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_DESTINO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vAWDTCriacao(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_DTCRIACAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vAWDTFim(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_DTFIM''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vawdtinicio(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_DTINICIO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vAWId(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vAWObs(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_OBS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vAWStatus(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_STATUS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vAWUnica(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VAW_UNICA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vTEDocumento(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_DOCUMENTO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vTEEmail(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_EMAIL''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vTEEmpresa(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_EMPRESA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vTENome(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_NOME''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vTETIpo(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_TIPO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vTETelefone(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VTE_TELEFONE''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? vDONome(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.visitas[:].VDO_NOME''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
}
|
|
|
|
class DeleteVisitCall {
|
|
Future<ApiCallResponse> call({
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
String? cliID = '',
|
|
String? atividade = '',
|
|
String? idVisita = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'deleteVisit',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'idVisita': idVisita,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? msg(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.error_msg''',
|
|
));
|
|
}
|
|
|
|
class GetPessoasLocalCall {
|
|
Future<ApiCallResponse> call({
|
|
String? cliID = '',
|
|
String? ownID = '',
|
|
String? devUUID = '',
|
|
String? userUUID = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getPessoasLocal',
|
|
apiUrl: '$baseUrl/getPessoasLocal.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'cliID': cliID,
|
|
'ownID': ownID,
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
List? pessoas(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.pessoas''',
|
|
true,
|
|
) as List?;
|
|
List<String>? usuEmail(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.pessoas[:].USU_EMAIL''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? usuNome(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.pessoas[:].USU_NOME''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
}
|
|
|
|
class RespondeSolicitacaoCall {
|
|
Future<ApiCallResponse> call({
|
|
String? userUUID = '',
|
|
String? devUUID = '',
|
|
String? atividade = '',
|
|
String? referencia = '',
|
|
String? tarefa = '',
|
|
String? resposta = '',
|
|
String? idVisitante = '',
|
|
String? cliUUID = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'respondeSolicitacao',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'userUUID': userUUID,
|
|
'devUUID': devUUID,
|
|
'cliID': cliUUID,
|
|
'atividade': atividade,
|
|
'referencia': referencia,
|
|
'tarefa': tarefa,
|
|
'resposta': resposta,
|
|
'idVisitante': idVisitante,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
String? msg(dynamic response) => castToType<String>(getJsonField(
|
|
response,
|
|
r'''$.error_msg''',
|
|
));
|
|
}
|
|
|
|
/// End PHP Group Code
|
|
|
|
class ApiPagingParams {
|
|
int nextPageNumber = 0;
|
|
int numItems = 0;
|
|
dynamic lastResponse;
|
|
|
|
ApiPagingParams({
|
|
required this.nextPageNumber,
|
|
required this.numItems,
|
|
required this.lastResponse,
|
|
});
|
|
|
|
@override
|
|
String toString() =>
|
|
'PagingParams(nextPageNumber: $nextPageNumber, numItems: $numItems, lastResponse: $lastResponse,)';
|
|
}
|
|
|
|
String _toEncodable(dynamic item) {
|
|
return item;
|
|
}
|
|
|
|
String _serializeList(List? list) {
|
|
list ??= <String>[];
|
|
try {
|
|
return json.encode(list, toEncodable: _toEncodable);
|
|
} catch (_) {
|
|
if (kDebugMode) {
|
|
print("List serialization failed. Returning empty list.");
|
|
}
|
|
return '[]';
|
|
}
|
|
}
|
|
|
|
String _serializeJson(dynamic jsonVar, [bool isList = false]) {
|
|
jsonVar ??= (isList ? [] : {});
|
|
try {
|
|
return json.encode(jsonVar, toEncodable: _toEncodable);
|
|
} catch (_) {
|
|
if (kDebugMode) {
|
|
print("Json serialization failed. Returning empty json.");
|
|
}
|
|
return isList ? '[]' : '{}';
|
|
}
|
|
}
|