Wp2ghost/CSharpGhostImporter/WPDto.cs

49 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace wp2ghost
{
public class IdsResponse
{
[JsonPropertyName("count")] public int Count { get; set; }
[JsonPropertyName("post_type")] public string? PostType { get; set; }
[JsonPropertyName("ids")] public List<int>? Ids { get; set; }
}
public class WpPostResponse
{
[JsonPropertyName("id")] public int Id { get; set; }
[JsonPropertyName("title")] public string? Title { get; set; }
[JsonPropertyName("slug")] public string? Slug { get; set; }
[JsonPropertyName("date")] public string? Date { get; set; }
[JsonPropertyName("content")] public string? Content { get; set; }
[JsonPropertyName("excerpt")] public string? Excerpt { get; set; }
[JsonPropertyName("featured_image")] public string? FeaturedImage { 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("media_files")] public List<string>? MediaFiles { get; set; } = new();
}
public class WpCategory
{
[JsonPropertyName("id")] public int Id { get; set; }
[JsonPropertyName("name")] public string? Name { get; set; }
[JsonPropertyName("slug")] public string? Slug { get; set; }
}
public class WpComment
{
[JsonPropertyName("id")] public int Id { get; set; }
[JsonPropertyName("author_name")] public string? AuthorName { get; set; }
[JsonPropertyName("author_email")] public string? AuthorEmail { get; set; }
[JsonPropertyName("author_url")] public string? AuthorUrl { get; set; }
[JsonPropertyName("content")] public string? Content { get; set; }
[JsonPropertyName("date")] public string? Date { get; set; }
}
}