more api tweaks

removed WebfrontSettings
IW4MAdminSettings are only generated when the file does not exist, placeholder values stored in DefaultSettings.json
This commit is contained in:
RaidMax
2018-04-19 00:48:14 -05:00
parent 23ec72e6b6
commit 438718507b
31 changed files with 310 additions and 77 deletions

View File

@ -19,6 +19,30 @@ namespace IW4MAdmin.Application.API.Master
public string AccessToken { get; set; }
}
public class VersionInfo
{
[JsonProperty("current-version-stable")]
public float CurrentVersionStable { get; set; }
[JsonProperty("current-version-prerelease")]
public float CurrentVersionPrerelease { get; set; }
}
public class ResultMessage
{
[JsonProperty("message")]
public string Message { get; set; }
}
public class Endpoint
{
#if !DEBUG
private static IMasterApi api = RestClient.For<IMasterApi>("http://api.raidmax.org:5000");
#else
private static IMasterApi api = RestClient.For<IMasterApi>("http://127.0.0.1");
#endif
public static IMasterApi Get() => api;
}
[Header("User-Agent", "IW4MAdmin-RestEase")]
public interface IMasterApi
{
@ -29,9 +53,12 @@ namespace IW4MAdmin.Application.API.Master
Task<TokenId> Authenticate([Body] AuthenticationId Id);
[Post("instance/")]
Task<ApiInstance> AddInstance([Body] ApiInstance instance);
Task<ResultMessage> AddInstance([Body] ApiInstance instance);
[Put("instance/{id}")]
Task<ApiInstance> UpdateInstance([Path] string id, [Body] ApiInstance instance);
Task<ResultMessage> UpdateInstance([Path] string id, [Body] ApiInstance instance);
[Get("version")]
Task<VersionInfo> GetVersion();
}
}