2022-12-28 16:36:59 +01:00
|
|
|
|
using BeWo.Service.ServiceUtils.Paths;
|
|
|
|
|
|
using BS.SharedLauncher.DataContract;
|
2023-01-06 14:11:08 +01:00
|
|
|
|
using BS.SharedLauncher.Enums;
|
2022-12-28 16:36:59 +01:00
|
|
|
|
using BS.SharedLauncher.Exceptions;
|
|
|
|
|
|
using BS.SharedLauncher.Extensions;
|
|
|
|
|
|
using BS.SharedLauncher.Logic;
|
|
|
|
|
|
using BS.SharedLauncher.Update;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BeWo.Service.ServiceUtils.Update
|
|
|
|
|
|
{
|
2023-01-06 14:11:08 +01:00
|
|
|
|
public static class UpdateFileResponseHelper
|
2022-12-28 16:36:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
private static string _Version;
|
|
|
|
|
|
private static string _Tenant;
|
2023-01-09 15:30:50 +01:00
|
|
|
|
|
2022-12-28 16:36:59 +01:00
|
|
|
|
private static UpdateFileResponse _Response;
|
|
|
|
|
|
|
|
|
|
|
|
public static UpdateFileResponse GetUpdateFileResponse(UpdateFileRequest request, string tenant)
|
|
|
|
|
|
{
|
|
|
|
|
|
_Response = new UpdateFileResponse();
|
|
|
|
|
|
_Tenant = tenant;
|
|
|
|
|
|
_Version = request.Version;
|
|
|
|
|
|
|
2023-01-09 15:30:50 +01:00
|
|
|
|
calculate(request.UpdateFile.AbsolutePath);
|
2022-12-28 16:36:59 +01:00
|
|
|
|
|
|
|
|
|
|
return _Response;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-01-09 15:30:50 +01:00
|
|
|
|
private static void calculate(string path)
|
2022-12-28 16:36:59 +01:00
|
|
|
|
{
|
2023-01-09 15:30:50 +01:00
|
|
|
|
_Response.FileData = File.ReadAllBytes(path);
|
2022-12-28 16:36:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|