Wp2ghost/CSharpGhostImporter/GhostDto.cs
2026-10-14 19:12:29 +02:00

42 lines
2.5 KiB
C#

using System.Text.Json.Serialization;
namespace wp2ghost
{
public class GhostRoot { [JsonPropertyName("db")] public List<GhostDb> Db { get; set; } = new() { new GhostDb() }; }
public class GhostDb { [JsonPropertyName("data")] public GhostData Data { get; set; } = new(); }
public class GhostData { [JsonPropertyName("posts")] public List<GhostPost> Posts { get; set; } = new(); }
public class GhostPost
{
[JsonPropertyName("id")] public string? Id { get; set; }
[JsonPropertyName("title")] public string? Title { get; set; }
[JsonPropertyName("slug")] public string? Slug { get; set; }
[JsonPropertyName("html")] public string? Html { get; set; }
[JsonPropertyName("markdown")] public string? Markdown { get; set; }
[JsonPropertyName("feature_image")] public string? FeatureImage { get; set; }
[JsonPropertyName("status")] public string? Status { get; set; }
[JsonPropertyName("created_at")] public string? CreatedAt { get; set; }
[JsonPropertyName("published_at")] public string? PublishedAt { get; set; }
}
public class GhostPostFile
{
[JsonPropertyName("wp_id")] public int WpId { get; set; }
[JsonPropertyName("wp_slug")] public string? WpSlug { get; set; }
[JsonPropertyName("ghost_id")] public string? GhostId { get; set; }
[JsonPropertyName("title")] public string? Title { get; set; }
[JsonPropertyName("slug")] public string? Slug { get; set; }
[JsonPropertyName("excerpt")] public string? Excerpt { get; set; }
[JsonPropertyName("status")] public string? Status { get; set; }
[JsonPropertyName("created_at")] public string? CreatedAt { get; set; }
[JsonPropertyName("published_at")] public string? PublishedAt { get; set; }
[JsonPropertyName("feature_image")] public string? FeatureImage { get; set; }
[JsonPropertyName("categories")] public List<WpCategory> Categories { get; set; } = new();
[JsonPropertyName("tags")] public List<WpCategory> Tags { get; set; } = new();
[JsonPropertyName("keywords")] public string? Keywords { get; set; }
[JsonPropertyName("comments")] public List<WpComment> Comments { get; set; } = new();
[JsonPropertyName("image_files")] public List<string> ImageFiles { get; set; } = new();
[JsonPropertyName("media_files")] public List<string> MediaFiles { get; set; } = new();
[JsonPropertyName("html")] public string? Html { get; set; }
}
}