fix bugs
This commit is contained in:
@@ -12,6 +12,8 @@ using System.Text.Json.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Serilog;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SafeBagDE70.API
|
||||
{
|
||||
@@ -99,7 +101,37 @@ namespace SafeBagDE70.API
|
||||
return bSuccess;
|
||||
|
||||
}
|
||||
public static async Task<List<AeonMallCustomer>> GetAeonMallCustomers(int tenantId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var url = URL + "GetAeonMallCustomers?tenantId="+tenantId;
|
||||
HttpClientHandler clientHandler = new HttpClientHandler();
|
||||
clientHandler.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return true; };
|
||||
|
||||
// Pass the handler to httpclient(from you are calling api)
|
||||
HttpClient client = new HttpClient(clientHandler);
|
||||
|
||||
HttpResponseMessage response = await client.GetAsync(url);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string jsonResponse = await response.Content.ReadAsStringAsync();
|
||||
var tenants = JsonConvert.DeserializeObject<List<AeonMallCustomer>>(jsonResponse);
|
||||
return tenants;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error($"Error: {response.StatusCode}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Fatal($"Exception: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static string GetMACAddress()
|
||||
@@ -130,6 +162,26 @@ namespace SafeBagDE70.API
|
||||
|
||||
}
|
||||
}
|
||||
public class AeonMallCustomer
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
public long? CreatorUserId { get; set; }
|
||||
public long? DeleterUserId { get; set; }
|
||||
public DateTime? DeletionTime { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
public DateTime? LastModificationTime { get; set; }
|
||||
public long? LastModifierUserId { get; set; }
|
||||
public int? TenantId { get; set; }
|
||||
public string? Cards { get; set; }
|
||||
public string? TenantCode { get; set; }
|
||||
public string? TenantName { get; set; }
|
||||
public string? TenantShortName { get; set; }
|
||||
public string? OpenningDate { get; set; }
|
||||
public string? Note { get; set; }
|
||||
public string? Type { get; set; }
|
||||
public string? TimeTag { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user