Api 2.0 changes

master-Api2.0
Sikander Saleem 9 months ago
parent 9362859013
commit 42aa5cbc1b

@ -107,7 +107,7 @@ class DashboardApiClient {
//Mark Attendance
Future<GenericResponseModel?> markAttendance({String lat = "0", String? long = "0", required int pointType, String nfcValue = "", bool isGpsRequired = false, String QRValue = "", String payrollCode = ""}) async {
String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC";
String url = "${ApiConsts.erpRest}AuthenticateAndSwipeUserSupportNFC";
var uuid = Uuid();
// Generate a v4 (random) id
@ -132,7 +132,7 @@ class DashboardApiClient {
//Mark Fake Location
Future<GenericResponseModel?> markFakeLocation({String lat = "0", String? long = "0", required String sourceName}) async {
String url = "${ApiConsts.swpRest}CreateIssueInfo";
String url = "${ApiConsts.erpRest}CreateIssueInfo";
var uuid = Uuid();
// Generate a v4 (random) id

@ -17,7 +17,7 @@ class LoginApiClient {
factory LoginApiClient() => _instance;
Future<GetMobileLoginInfoListModel?> getMobileLoginInfoNEW(String deviceToken, String deviceType) async {
String url = "${ApiConsts.erpRest}Mohemm_GetMobileLoginInfo_NEW";
String url = "${ApiConsts.authRest}Mohemm_GetMobileLoginInfo_NEW";
Map<String, dynamic> postParams = {};
postParams["DeviceToken"] = deviceToken;
postParams["DeviceType"] = deviceType;
@ -29,7 +29,7 @@ class LoginApiClient {
Future<GenericResponseModel?> insertMobileLoginInfoNEW(
String email, int sessionId, String employeeName, int loginType, String mobileNumber, String userName, String deviceToken, String deviceType) async {
String url = "${ApiConsts.erpRest}Mohemm_InsertMobileLoginInfo";
String url = "${ApiConsts.authRest}Mohemm_InsertMobileLoginInfo";
Map<String, dynamic> postParams = {
"MobileNumber": mobileNumber,
"P_USER_NAME": userName,
@ -52,14 +52,14 @@ class LoginApiClient {
}
Future<CheckMobileAppVersionModel> checkMobileAppVersion() async {
String url = "${ApiConsts.utilitiesRest}CheckMobileAppVersion";
String url = "${ApiConsts.utilitiesRest}CheckMobileAppVersion"; // todo @zahoor, not found in swagger
Map<String, dynamic> postParams = {};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) => CheckMobileAppVersionModel.fromJson(json), url, postParams);
}
Future<MemberLoginListModel?> memberLogin(String username, String password) async {
String url = "${ApiConsts.erpRest}MemberLogin";
String url = "${ApiConsts.authRest}MemberLogin";
Map<String, dynamic> postParams = {"P_APP_VERSION": "CS", "P_LANGUAGE": "US", "P_PASSWORD": password, "P_USER_NAME": username};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
@ -70,14 +70,14 @@ class LoginApiClient {
}
Future<BasicMemberInformationModel?> mohemmSendActivationCodeByOTPNotificationType(int isMobileFingerPrint, String? mobileNumber, int optSendType, String? pUserName) async {
String url = "${ApiConsts.erpRest}Mohemm_SendActivationCodebyOTPNotificationType";
String url = "${ApiConsts.authRest}Mohemm_SendActivationCodebyOTPNotificationType";
Map<String, dynamic> postParams = {"IsMobileFingerPrint": isMobileFingerPrint, "MobileNumber": mobileNumber, "OTP_SendType": optSendType, "P_USER_NAME": pUserName};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).basicMemberInformation, url, postParams);
}
Future<GenericResponseModel?> checkActivationCode(bool isDeviceNFC, String? mobileNumber, String activationCode, String? pUserName) async {
String url = "${ApiConsts.erpRest}CheckActivationCode";
String url = "${ApiConsts.authRest}CheckActivationCode";
Map<String, dynamic> postParams = {"IsDeviceNFC": isDeviceNFC, "MobileNumber": mobileNumber, "activationCode": activationCode, "P_USER_NAME": pUserName};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
@ -97,14 +97,14 @@ class LoginApiClient {
}
Future<BasicMemberInformationModel?> getBasicUserInformation(String pAppVersion, String pUsername) async {
String url = "${ApiConsts.erpRest}Get_BasicUserInformation";
String url = "${ApiConsts.authRest}Get_BasicUserInformation";
Map<String, dynamic> postParams = {"P_APP_VERSION": pAppVersion, "P_USER_NAME": pUsername};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).basicMemberInformation, url, postParams);
}
Future<GenericResponseModel?> sendPublicActivationCode(String? mobileNumber, String? pUsername) async {
String url = "${ApiConsts.erpRest}SendPublicActivationCode";
String url = "${ApiConsts.erpRest}SendPublicActivationCode"; // todo @zahoor, not found in swagger
Map<String, dynamic> postParams = {"MobileNumber": mobileNumber, "P_MOBILE_NUMBER": mobileNumber, "P_USER_NAME": pUsername};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
@ -115,7 +115,7 @@ class LoginApiClient {
}
Future<GenericResponseModel?> checkPublicActivationCode(String activationCode, String? pUserName) async {
String url = "${ApiConsts.erpRest}checkPublicActivationCode";
String url = "${ApiConsts.erpRest}checkPublicActivationCode"; // todo @zahoor, not found in swagger
Map<String, dynamic> postParams = {"activationCode": activationCode, "P_USER_NAME": pUserName};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
@ -126,7 +126,7 @@ class LoginApiClient {
}
Future<GenericResponseModel?> changePasswordForget(String forgetPasswordTokenID, String pNewPassword, String pConfirmNewPassword, String? pUserName) async {
String url = "${ApiConsts.erpRest}ChangePassword_Forget";
String url = "${ApiConsts.erpRest}ChangePassword_Forget"; // todo @zahoor, not found in swagger
Map<String, dynamic> postParams = {"P_USER_NAME": pUserName, "ForgetPasswordTokenID": forgetPasswordTokenID, "P_Confirm_NEW_PASSWORD": pConfirmNewPassword, "P_NEW_PASSWORD": pNewPassword};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
@ -147,7 +147,7 @@ class LoginApiClient {
}
Future<GenericResponseModel> changePasswordFromActiveDirectorySession(String password, String email) async {
String url = "${ApiConsts.authenticationRest}SetPassword";
String url = "${ApiConsts.authenticationRest}SetPassword"; // todo @zahoor, not found in swagger
Map<String, dynamic> postParams = {"EmailAddress": email, "Password": password, "generalid": "Cs2020@2016\$2958"};
postParams.addAll(AppState().postParamsJson);
postParams["LogInTokenID"] = "@acT!V3D!r3Ct0rY"; // hard code token for active directory

@ -11,21 +11,34 @@ class ApiConsts {
// static String baseUrl = "https://mohemm.hmg.com"; // New Live server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
static String baseUrl = "https://ms.hmg.com"; // Api 2.0
// https://ms.hmg.com/mohem/api/Auth/MemberLogin
// static String baseUrl = "http://10.20.200.111:1010/";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://mohemm.hmg.com";
// static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = baseUrl + "/Services/"; // server
static String baseUrlServices = baseUrl + "/mohem/api/"; // baseUrlServices Api 2.0
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";
static String authenticationRest = baseUrlServices + "Authentication.svc/REST/";
static String erpRest = baseUrlServices + "ERP.svc/REST/";
static String swpRest = baseUrlServices + "SWP.svc/REST/";
static String user = baseUrlServices + "api/User/";
static String cocRest = baseUrlServices + "COCWS.svc/REST/";
// static String erpRest = baseUrlServices + "ERP.svc/REST/";
// static String swpRest = baseUrlServices + "SWP.svc/REST/";
// static String user = baseUrlServices + "api/User/";
// static String cocRest = baseUrlServices + "COCWS.svc/REST/";
// Api 2.0 --------------------------------------------
static String authRest = baseUrlServices + "Auth/";
static String cocRest = baseUrlServices + "COCWS/";
static String erpRest = baseUrlServices + "ERP/";
static String perfRest = baseUrlServices + "Perf/";
//Chat
static String chatServerBaseUrl = "https://apiderichat.hmg.com/";

Loading…
Cancel
Save