Fleshed out the table storage service and started syncing logic

This commit is contained in:
2020-03-19 19:09:03 -04:00
parent 59377a7749
commit 0bfab99f1b
22 changed files with 630 additions and 131 deletions

View File

@@ -6,27 +6,17 @@ namespace Habitica.Todoist.Integration.Model.Todoist
{
public class Item
{
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("content")]
public string Content { get; set; }
[JsonProperty("Id")]
public string Id { get; set; }
[JsonProperty("due")]
public Due Due { get; set; }
[JsonProperty("priority")]
public int Priority { get; set; }
[JsonProperty("is_deleted")]
public int Is_deleted { get; set; }
[JsonProperty("date_completed")]
public string Date_completed { get; set; }
public int? GetDifficulty()
{
try { return int.Parse(Content.Split('-').Last().Last().ToString()); } catch { }
return null;
}
public string GetCleanContent()
{
try { return Content.Split('-').First(); } catch { }
return null;
}
}
}

View File

@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using System.Text;
namespace Habitica.Todoist.Integration.Model.Todoist
namespace Habitica.Todoist.Integration.Model.Todoist.Responses
{
public class SyncResponse
{
@@ -11,7 +11,7 @@ namespace Habitica.Todoist.Integration.Model.Todoist
public string Sync_token { get; set; }
[JsonProperty("full_sync")]
public bool Full_sync { get; set; }
[JsonProperty("itmes")]
[JsonProperty("items")]
public List<Item> Items { get; set; }
}
}