initial project commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="6.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
19
Habitica.Todoist.Integration.Model/Habitica/Task.cs
Normal file
19
Habitica.Todoist.Integration.Model/Habitica/Task.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Habitica
|
||||
{
|
||||
public class Task
|
||||
{
|
||||
[JsonProperty("text")]
|
||||
public string Text { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
[JsonProperty("date")]
|
||||
public string Date { get; set; }
|
||||
[JsonProperty("priority")]
|
||||
public string Priority { get; set; }
|
||||
}
|
||||
}
|
||||
14
Habitica.Todoist.Integration.Model/Habitica/TaskType.cs
Normal file
14
Habitica.Todoist.Integration.Model/Habitica/TaskType.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Habitica
|
||||
{
|
||||
public static class TaskType
|
||||
{
|
||||
public static string Habit = "habit";
|
||||
public static string Daily = "daily";
|
||||
public static string Todo = "todo";
|
||||
public static string Reward = "reward";
|
||||
}
|
||||
}
|
||||
20
Habitica.Todoist.Integration.Model/Todoist/Due.cs
Normal file
20
Habitica.Todoist.Integration.Model/Todoist/Due.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Todoist
|
||||
{
|
||||
public class Due
|
||||
{
|
||||
public string Date { get; set; }
|
||||
public string Timezone { get; set; }
|
||||
public string @String { get; set; }
|
||||
|
||||
public string ToJavaScriptDateStr()
|
||||
{
|
||||
try { return Date + "T00:00:00.000Z"; } catch { }
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Habitica.Todoist.Integration.Model/Todoist/Item.cs
Normal file
26
Habitica.Todoist.Integration.Model/Todoist/Item.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Todoist
|
||||
{
|
||||
public class Item
|
||||
{
|
||||
public string Content { get; set; }
|
||||
public string Id { get; set; }
|
||||
public Due Due { get; set; }
|
||||
public int Is_deleted { get; set; }
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Habitica.Todoist.Integration.Model/Todoist/SyncResponse.cs
Normal file
13
Habitica.Todoist.Integration.Model/Todoist/SyncResponse.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Todoist
|
||||
{
|
||||
public class SyncResponse
|
||||
{
|
||||
public string Sync_token { get; set; }
|
||||
public bool Full_sync { get; set; }
|
||||
public List<Item> Items { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user