blob: 77828d490b1c064da572314a1da289d2d436b822 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Settings;
using Tango.Transport.Web;
namespace Tango.MachineStudio.Common.Update
{
public class MachineStudioUpdateService : IMachineStudioUpdateService
{
private string address;
private WebTransportClient _client;
public MachineStudioUpdateService()
{
address = SettingsManager.Default.GetOrCreate<MachineStudioSettings>().GetMachineServiceAddress() + "/api/MachineStudio/";
_client = new WebTransportClient();
}
public Task<CheckForUpdatesResponse> CheckForUpdates(CheckForUpdatesRequest request)
{
return _client.PostJson<CheckForUpdatesRequest, CheckForUpdatesResponse>(address + "CheckForUpdates", request);
}
public Task<UploadVersionResponse> UploadVersion(UploadVersionRequest request)
{
return _client.PostJson<UploadVersionRequest, UploadVersionResponse>(address + "UploadVersion", request);
}
public Task<UploadCompletedResponse> NotifyUploadCompleted(UploadCompletedRequest request)
{
return _client.PostJson<UploadCompletedRequest, UploadCompletedResponse>(address + "NotifyUploadCompleted", request);
}
public Task<LatestVersionResponse> GetLatestVersion(LatestVersionRequest request)
{
return _client.PostJson<LatestVersionRequest, LatestVersionResponse>(address + "GetLatestVersion", request);
}
}
}
|