2441 lines
68 KiB
Dart
2441 lines
68 KiB
Dart
import 'dart:async';
|
|
import 'dart:convert';
|
|
import 'dart:developer';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
|
import 'package:hub/shared/utils/cache_util.dart';
|
|
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
|
|
import 'package:hub/shared/utils/validator_util.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 UpdToken updToken = UpdToken();
|
|
static RegisterCall registerCall = RegisterCall();
|
|
static ForgotPasswordCall forgotPasswordCall = ForgotPasswordCall();
|
|
static GetLocalsCall getLocalsCall = GetLocalsCall();
|
|
static PostScheduleVisitorCall postScheduleVisitorCall =
|
|
PostScheduleVisitorCall();
|
|
static PostScheduleVisitCall postScheduleVisitCall = PostScheduleVisitCall();
|
|
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();
|
|
static GetAccessCall getAccessCall = GetAccessCall();
|
|
static GetLiberationsCall getLiberationsCall = GetLiberationsCall();
|
|
static GetMessagesCall getMessagesCall = GetMessagesCall();
|
|
static ChangeNotifica changeNotifica = ChangeNotifica();
|
|
static RespondeVinculo resopndeVinculo = RespondeVinculo();
|
|
static ChangePass changePass = ChangePass();
|
|
static ChangePanic changePanic = ChangePanic();
|
|
static DeleteAccount deleteAccount = DeleteAccount();
|
|
static CancelaVisita cancelaVisita = CancelaVisita();
|
|
static BuscaEnconcomendas buscaEnconcomendas = BuscaEnconcomendas();
|
|
static RegisterPet registerPet = RegisterPet();
|
|
static DeletePet deletePet = DeletePet();
|
|
static UpdatePet updatePet = UpdatePet();
|
|
static GetPets getPets = GetPets();
|
|
static GetPetPhoto getPetPhoto = GetPetPhoto();
|
|
static UnregisterDevice unregisterDevice = UnregisterDevice();
|
|
}
|
|
|
|
class UnregisterDevice {
|
|
Future<ApiCallResponse> call() async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'unregisterDevice',
|
|
apiUrl: '$baseUrl/unregisterDevice.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,
|
|
);
|
|
}
|
|
}
|
|
|
|
class DeletePet {
|
|
Future<ApiCallResponse> call({
|
|
int? petID = 0,
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'excluirPet';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'deletePet',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'petId': petID,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class UpdatePet {
|
|
Future<ApiCallResponse> call({
|
|
int? petID = 0,
|
|
String? image = '',
|
|
String? name = '',
|
|
String? species = '',
|
|
String? breed = '',
|
|
String? color = '',
|
|
String? birthdayDate = '',
|
|
String? gender = '',
|
|
String? size = '',
|
|
String? notes = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'atualizarPet';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'updatePet',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'id': petID,
|
|
'image': image,
|
|
'name': name,
|
|
'species': species,
|
|
'breed': breed,
|
|
if (color != '') 'color': color,
|
|
if (birthdayDate != '')
|
|
'birthdayDate':
|
|
ValidatorUtil.toISO8601USA('dd/MM/yyyy', birthdayDate!),
|
|
'gender': gender,
|
|
'size': size,
|
|
if (notes != '') 'notes': notes,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class GetPets {
|
|
Future<ApiCallResponse> call({
|
|
int? page = 0,
|
|
int? pageSize = 0,
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'consultaPets';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getPets',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'page': page,
|
|
'pageSize': pageSize,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class GetPetPhoto {
|
|
Future<ApiCallResponse> call({
|
|
int? petId = 0,
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'consultaFotoPet';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getPetPhoto',
|
|
apiUrl: '$baseUrl/getImage.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'atividade': atividade,
|
|
'cliID': cliID,
|
|
'petId': petId,
|
|
},
|
|
bodyType: BodyType.BLOB,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class RegisterPet {
|
|
Future<ApiCallResponse> call({
|
|
String? image = '',
|
|
String? name = '',
|
|
String? species = '',
|
|
String? breed = '',
|
|
String? color = '',
|
|
String? birthdayDate = '',
|
|
String? gender = '',
|
|
String? size = '',
|
|
String? notes = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'cadastrarPet';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'registerPet',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'image': image,
|
|
'name': name,
|
|
'species': species,
|
|
'breed': breed,
|
|
if (color != '') 'color': color,
|
|
if (birthdayDate != '')
|
|
'birthdayDate':
|
|
ValidatorUtil.toISO8601USA('dd/MM/yyyy', birthdayDate!),
|
|
'gender': gender,
|
|
'size': size,
|
|
if (notes != '') 'notes': notes,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class BuscaEnconcomendas {
|
|
Future<ApiCallResponse> call({
|
|
String? page = '',
|
|
String? pageSize = '',
|
|
String? adresseeType = '',
|
|
String? status = '',
|
|
}) async {
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'getEncomendas';
|
|
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getEncomendas',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'atividade': atividade,
|
|
'cliID': cliID,
|
|
'page': page,
|
|
'pageSize': pageSize,
|
|
'adresseeType': adresseeType,
|
|
'status': status,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class CancelaVisita {
|
|
Future<ApiCallResponse> call({
|
|
int? idDestino,
|
|
int? idVisita,
|
|
String? AccessKey = '',
|
|
String? UsuEmail = '',
|
|
String? DevDesc = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'cancelaVisita';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'cancelaVisita',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'atividade': atividade,
|
|
'cliID': cliID,
|
|
'idVisita': idVisita,
|
|
'AccessKey': AccessKey,
|
|
'UsuEmail': UsuEmail,
|
|
'DevDesc': DevDesc,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class DeleteAccount {
|
|
Future<ApiCallResponse> call() async {
|
|
final devUUID = CacheUtil.get('devUUID');
|
|
final userUUID = CacheUtil.get('userUUID');
|
|
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'deleteAccount',
|
|
apiUrl: '$baseUrl/deleteAccount.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,
|
|
);
|
|
}
|
|
}
|
|
|
|
class ChangePanic {
|
|
Future<ApiCallResponse> call({
|
|
String? newSenhaPanico = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'updVisitado';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'changePass',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'newSenhaPanico': newSenhaPanico,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class ChangePass {
|
|
Future<ApiCallResponse> call({
|
|
String? newSenha = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'updVisitado';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'changePass',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'newSenha': newSenha,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class RespondeVinculo {
|
|
Future<ApiCallResponse> call({
|
|
String? tarefa = '',
|
|
String? cliID = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'respondeVinculo',
|
|
apiUrl: '$baseUrl/responderVinculo.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'tarefa': tarefa,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class ChangeNotifica {
|
|
Future<ApiCallResponse> call({
|
|
String? notifica = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = CacheUtil.get('devUUID');
|
|
final userUUID = CacheUtil.get('userUUID');
|
|
final cliID = CacheUtil.get('cliUUID');
|
|
const atividade = 'updVisitado';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'changeNotifica',
|
|
apiUrl: '$baseUrl/processRequest.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'devUUID': devUUID,
|
|
'userUUID': userUUID,
|
|
'cliID': cliID,
|
|
'atividade': atividade,
|
|
'notifica': notifica,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class UpdToken {
|
|
Future<ApiCallResponse> call() async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final token = AppState().token;
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'updToken',
|
|
apiUrl: '$baseUrl/updtoken.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'token': token,
|
|
'devid': devUUID,
|
|
'useruuid': userUUID,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
class LoginCall {
|
|
Future<ApiCallResponse> call() async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
final devUUID = CacheUtil.get('devUUID');
|
|
|
|
final email = AppState().email;
|
|
final password = AppState().passwd;
|
|
final type = AppState().deviceType;
|
|
final description = AppState().deviceDescription;
|
|
final token = FirebaseMessagingService.getToken();
|
|
|
|
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': devUUID,
|
|
'token': token,
|
|
'tipo': type,
|
|
'descricao': description,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
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,
|
|
);
|
|
}
|
|
}
|
|
|
|
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,
|
|
);
|
|
}
|
|
}
|
|
|
|
class GetLocalsCall {
|
|
Future<ApiCallResponse> call() async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
|
|
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,
|
|
);
|
|
}
|
|
|
|
List? locais(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.locais''',
|
|
true,
|
|
) as List?;
|
|
}
|
|
|
|
class PostScheduleVisitorCall {
|
|
Future<ApiCallResponse> call({
|
|
String? documento = '',
|
|
String? nome = '',
|
|
String? tipo = '',
|
|
String? foto = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'putVisitante';
|
|
|
|
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? devDesc = '',
|
|
String? idVisitante = '',
|
|
String? dtInicio = '',
|
|
String? dtFim = '',
|
|
String? unica = '',
|
|
int? idMotivo,
|
|
int? idNAC,
|
|
String? obs = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'putVisita';
|
|
|
|
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 GetScheduleVisitCall {
|
|
Future<ApiCallResponse> call({
|
|
int? pageSize,
|
|
int? pageNumber,
|
|
String? chaveBusca = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliUUID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'getVisitas';
|
|
|
|
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() async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliUUID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'getDados';
|
|
|
|
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? documento = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'getVisitante';
|
|
|
|
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''',
|
|
));
|
|
}
|
|
|
|
class GetFotoVisitanteCall {
|
|
Future<ApiCallResponse> call({
|
|
String? documento = '',
|
|
String? tipo = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'getFotoVisitante';
|
|
|
|
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? data = '',
|
|
String? motivo = '',
|
|
String? nome = '',
|
|
String? proID = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'putAgendamentoProv';
|
|
|
|
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': ValidatorUtil.toISO8601("dd/MM/yyyy HH:mm:ss", 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({
|
|
int? pageSize,
|
|
int? pageNumber,
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'getVisitas';
|
|
|
|
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? idVisita = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'cancelaVisita';
|
|
|
|
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() async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final ownerUUID = await CacheUtil.get('ownerUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliUUID = await CacheUtil.get('cliUUID');
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getPessoasLocal',
|
|
apiUrl: '$baseUrl/getPessoasLocal.php',
|
|
callType: ApiCallType.POST,
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
params: {
|
|
'cliID': cliUUID,
|
|
'ownID': ownerUUID,
|
|
'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? referencia = '',
|
|
String? tarefa = '',
|
|
String? resposta = '',
|
|
String? idVisitante = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliUUID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'respondeSolicitacao';
|
|
|
|
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''',
|
|
));
|
|
}
|
|
|
|
class GetAccessCall {
|
|
Future<ApiCallResponse> call({
|
|
String? pageSize = '',
|
|
String? pageNumber = '',
|
|
String? pesTipo = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = await CacheUtil.get('devUUID');
|
|
final userUUID = await CacheUtil.get('userUUID');
|
|
final cliUUID = await CacheUtil.get('cliUUID');
|
|
const atividade = 'getAcessos';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getAccess',
|
|
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,
|
|
'pesTipo': pesTipo,
|
|
},
|
|
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? rows(dynamic response) => castToType<int>(getJsonField(
|
|
response,
|
|
r'''$.total_rows''',
|
|
));
|
|
int? pages(dynamic response) => castToType<int>(getJsonField(
|
|
response,
|
|
r'''$.total_pages''',
|
|
));
|
|
int? page(dynamic response) => castToType<int>(getJsonField(
|
|
response,
|
|
r'''$.page''',
|
|
));
|
|
List? access(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.acessos''',
|
|
true,
|
|
) as List?;
|
|
List<String>? accessDateTime(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].ACE_DATAHORA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessType(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].ACE_TIPO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessDesc(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].ACI_DESCRICAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessID(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].ACI_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessMobileNotify(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].ACI_NOTIFICA_MOBILE''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessDestDesc(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].DEST_DESC''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessDestType(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].DEST_TIPO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessDestID(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].DEST_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessDestProID(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].DEST_PRO_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessIdenExternCode(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].IDE_CODEXTERNO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessIdenInternalCode(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].IDE_CODINTERNO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessIdenDesc(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].IDE_DESCRICAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessIdenID(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].IDE_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessIdenStatus(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].IDE_STATUS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessIdenUse(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].IDE_USO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessPersonID(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].PES_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessPersonName(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].PES_NOME''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessPersonType(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].PES_TIPO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessDescSet(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].SET_DESCRICAO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessIDSet(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].SET_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? accessTypeet(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.acessos[:].SET_TIPO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
}
|
|
|
|
class GetLiberationsCall {
|
|
Stream<ApiCallResponse> call() {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
final StreamController<ApiCallResponse> controller = StreamController();
|
|
|
|
Future.microtask(() async {
|
|
final devUUID = CacheUtil.get('devUUID');
|
|
final userUUID = CacheUtil.get('userUUID');
|
|
final cliUUID = CacheUtil.get('cliUUID');
|
|
const atividade = 'getLiberacoes';
|
|
|
|
try {
|
|
final response = await ApiManager.instance.makeApiCall(
|
|
callName: 'getLiberations',
|
|
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,
|
|
);
|
|
controller.add(response);
|
|
await controller.close();
|
|
} catch (e) {
|
|
controller.addError(e);
|
|
await controller.close();
|
|
}
|
|
});
|
|
|
|
return controller.stream;
|
|
}
|
|
|
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
|
response,
|
|
r'''$.error''',
|
|
));
|
|
List? rqList(dynamic response) => getJsonField(
|
|
response,
|
|
r'''$.solicitacoes''',
|
|
true,
|
|
) as List?;
|
|
List<String>? rqNotID(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotDest(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_DESTINO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotSendDate(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_DTENVIO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotReceiveDate(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_DTRESPOSTA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotEmailAnswer(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_EMAILRESPOSTA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotReason(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_MOTIVO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotSendMsg(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_MSGENVIO''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotReceiveMsg(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_MSGRESPOSTA''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotName(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_NOME''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotOperator(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_OPERADOR''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotStatus(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_STATUS''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqNotVTE(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].NOT_VISITANTE''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqVteID(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].VTE_ID''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqVteName(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].VTE_NOME''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
List<String>? rqVteRG(dynamic response) => (getJsonField(
|
|
response,
|
|
r'''$.solicitacoes[:].VTE_RG''',
|
|
true,
|
|
) as List?)
|
|
?.withoutNulls
|
|
.map((x) => castToType<String>(x))
|
|
.withoutNulls
|
|
.toList();
|
|
}
|
|
|
|
class GetMessagesCall {
|
|
Future<ApiCallResponse> call({
|
|
String? pageSize = '',
|
|
String? pageNumber = '',
|
|
String? tipoDestino = '',
|
|
}) async {
|
|
final baseUrl = PhpGroup.getBaseUrl();
|
|
|
|
final devUUID = CacheUtil.get('devUUID');
|
|
final userUUID = CacheUtil.get('userUUID');
|
|
final cliUUID = CacheUtil.get('cliUUID');
|
|
const atividade = 'getMensagens';
|
|
|
|
return ApiManager.instance.makeApiCall(
|
|
callName: 'getMessages',
|
|
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,
|
|
'tipoDestino': tipoDestino,
|
|
},
|
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
|
returnBody: true,
|
|
encodeBodyUtf8: false,
|
|
decodeUtf8: false,
|
|
cache: false,
|
|
isStreamingApi: false,
|
|
alwaysAllowBody: false,
|
|
);
|
|
}
|
|
}
|
|
|
|
/// 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) {}
|
|
return '[]';
|
|
}
|
|
}
|
|
|
|
String _serializeJson(dynamic jsonVar, [bool isList = false]) {
|
|
jsonVar ??= (isList ? [] : {});
|
|
try {
|
|
return json.encode(jsonVar, toEncodable: _toEncodable);
|
|
} catch (_) {
|
|
if (kDebugMode) {}
|
|
return isList ? '[]' : '{}';
|
|
}
|
|
}
|