temp
This commit is contained in:
@@ -15,7 +15,7 @@ namespace BeWo.Service.ServiceUtils.DistanceCalculator
|
||||
{
|
||||
public class GoogleDistanceMatrixApi : IDistanceAPI
|
||||
{
|
||||
public class Response
|
||||
public class GoogleDistanceMatrixResponse
|
||||
{
|
||||
public string Status { get; set; }
|
||||
|
||||
@@ -102,12 +102,12 @@ namespace BeWo.Service.ServiceUtils.DistanceCalculator
|
||||
{
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return FillMatrix(JsonConvert.DeserializeObject<Response>(content));
|
||||
return FillMatrix(JsonConvert.DeserializeObject<GoogleDistanceMatrixResponse>(content));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AddressRouteMatrix FillMatrix(Response response)
|
||||
public AddressRouteMatrix FillMatrix(GoogleDistanceMatrixResponse response)
|
||||
{
|
||||
for (int i = 0; i < response.Rows.Length; i++)
|
||||
{
|
||||
@@ -131,7 +131,7 @@ namespace BeWo.Service.ServiceUtils.DistanceCalculator
|
||||
return Matrix;
|
||||
}
|
||||
|
||||
public AddressRoute ToAddressRoute(Response.Element element)
|
||||
public AddressRoute ToAddressRoute(GoogleDistanceMatrixResponse.Element element)
|
||||
{
|
||||
var res = new AddressRoute();
|
||||
|
||||
|
||||
@@ -10,8 +10,11 @@ using System.ServiceModel.Channels;
|
||||
using System.ServiceModel.Dispatcher;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BeWo.Data;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Service.Core;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.Exceptions;
|
||||
using BS.Shared.Extensions;
|
||||
using NHibernate.Hql.Ast.ANTLR.Tree;
|
||||
|
||||
@@ -19,6 +22,8 @@ namespace BeWo.Service.ServiceUtils
|
||||
{
|
||||
public static class ServiceHelper
|
||||
{
|
||||
public static FileLogger CoreLogger { get; } = new FileLogger(MergedConfig.GetSetting(WebConfigSetting.ServiceLogFilePath));
|
||||
|
||||
public static Tuple<string, string> GetInterfaceAndMethodASP(Message request , IClientChannel channel)
|
||||
{
|
||||
// Hole Interface
|
||||
@@ -112,34 +117,5 @@ namespace BeWo.Service.ServiceUtils
|
||||
|
||||
return attribute;
|
||||
}
|
||||
|
||||
public static void WriteLogFile(string pFileName, string pContent, string root_path = null)
|
||||
{
|
||||
if (root_path == null)
|
||||
root_path = MergedConfig.GetSetting(WebConfigSetting.StoredFilesFolderPath);
|
||||
|
||||
var storage = DAOFactory.GetLocalFileStorage(root_path);
|
||||
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
using (var writer = new StreamWriter(stream))
|
||||
{
|
||||
writer.Write(pContent);
|
||||
writer.Flush();
|
||||
stream.Position = 0;
|
||||
|
||||
storage.SaveLogAsync(pFileName, stream).GetAwaiter().GetResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteLogFile(string pFileName, Stream pContent)
|
||||
{
|
||||
var root_path = MergedConfig.GetSetting(WebConfigSetting.StoredFilesFolderPath);
|
||||
|
||||
var storage = DAOFactory.GetLocalFileStorage(root_path);
|
||||
|
||||
storage.SaveLogAsync(pFileName, pContent).GetAwaiter().GetResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user