seperated todoist and habitica api calls into services
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="6.0.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -15,5 +15,7 @@ namespace Habitica.Todoist.Integration.Model.Habitica
|
||||
public string Date { get; set; }
|
||||
[JsonProperty("priority")]
|
||||
public string Priority { get; set; }
|
||||
[JsonProperty("id")]
|
||||
public string Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
12
Habitica.Todoist.Integration.Model/Storage/HabitTodoLink.cs
Normal file
12
Habitica.Todoist.Integration.Model/Storage/HabitTodoLink.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
{
|
||||
public class HabitTodoLink
|
||||
{
|
||||
public string HabiticaId { get; set; }
|
||||
public string TodoistId { get; set; }
|
||||
}
|
||||
}
|
||||
14
Habitica.Todoist.Integration.Model/Storage/TodoAction.cs
Normal file
14
Habitica.Todoist.Integration.Model/Storage/TodoAction.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
{
|
||||
public enum TodoAction
|
||||
{
|
||||
Add = 1,
|
||||
Update = 2,
|
||||
Complete = 3,
|
||||
Delete = 4
|
||||
}
|
||||
}
|
||||
12
Habitica.Todoist.Integration.Model/Storage/TodoApp.cs
Normal file
12
Habitica.Todoist.Integration.Model/Storage/TodoApp.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
{
|
||||
public enum TodoApp
|
||||
{
|
||||
Habitica = 1,
|
||||
Todoist = 2
|
||||
}
|
||||
}
|
||||
15
Habitica.Todoist.Integration.Model/Storage/TodoChange.cs
Normal file
15
Habitica.Todoist.Integration.Model/Storage/TodoChange.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
{
|
||||
public class TodoChange
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public TodoApp Application { get; set; }
|
||||
public TodoAction Action { get; set; }
|
||||
public bool Applied { get; set; }
|
||||
public string JsonTodo { get; set; }
|
||||
}
|
||||
}
|
||||
12
Habitica.Todoist.Integration.Model/Storage/TodoHabitLink.cs
Normal file
12
Habitica.Todoist.Integration.Model/Storage/TodoHabitLink.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
{
|
||||
public class TodoHabitLink
|
||||
{
|
||||
public string TodoistId { get; set; }
|
||||
public string HabiticaId { get; set; }
|
||||
}
|
||||
}
|
||||
11
Habitica.Todoist.Integration.Model/Storage/TodoistSync.cs
Normal file
11
Habitica.Todoist.Integration.Model/Storage/TodoistSync.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
{
|
||||
public class TodoistSync
|
||||
{
|
||||
public string SyncToken { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
@@ -7,8 +8,11 @@ namespace Habitica.Todoist.Integration.Model.Todoist
|
||||
{
|
||||
public class Due
|
||||
{
|
||||
[JsonProperty("date")]
|
||||
public string Date { get; set; }
|
||||
[JsonProperty("timezone")]
|
||||
public string Timezone { get; set; }
|
||||
[JsonProperty("string")]
|
||||
public string @String { get; set; }
|
||||
|
||||
public string ToJavaScriptDateStr()
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Todoist
|
||||
{
|
||||
public class Item
|
||||
{
|
||||
[JsonProperty("content")]
|
||||
public string Content { get; set; }
|
||||
[JsonProperty("Id")]
|
||||
public string Id { get; set; }
|
||||
[JsonProperty("due")]
|
||||
public Due Due { get; set; }
|
||||
[JsonProperty("is_deleted")]
|
||||
public int Is_deleted { get; set; }
|
||||
[JsonProperty("date_completed")]
|
||||
public string Date_completed { get; set; }
|
||||
|
||||
public int? GetDifficulty()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
@@ -6,8 +7,11 @@ namespace Habitica.Todoist.Integration.Model.Todoist
|
||||
{
|
||||
public class SyncResponse
|
||||
{
|
||||
[JsonProperty("sync_token")]
|
||||
public string Sync_token { get; set; }
|
||||
[JsonProperty("full_sync")]
|
||||
public bool Full_sync { get; set; }
|
||||
[JsonProperty("itmes")]
|
||||
public List<Item> Items { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user