using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; using Google.Api; namespace DysonNetwork.Shared.Models; public enum PublicationSiteMode { /// /// The fully managed mode which allow other server to handle all the requests /// Including the rendering, data fetching etc. /// Very easy to use and efficient. /// FullyManaged, /// /// The self-managed mode allows user to upload their own site assets and use the Solar Network Pages /// as a static site hosting platform. /// SelfManaged } public class SnPublicationSite : ModelBase { public Guid Id { get; set; } = Guid.NewGuid(); [MaxLength(4096)] public string Slug { get; set; } = null!; [MaxLength(4096)] public string Name { get; set; } = null!; [MaxLength(8192)] public string? Description { get; set; } public PublicationSiteMode Mode { get; set; } = PublicationSiteMode.FullyManaged; public List Pages { get; set; } = []; public Guid PublisherId { get; set; } [NotMapped] public SnPublisher Publisher { get; set; } = null!; public Guid AccountId { get; set; } [NotMapped] public SnAccount? Account { get; set; } } public enum PublicationPageType { /// /// The HTML page type allows user adding a custom HTML page in the fully managed mode. /// HtmlPage, /// /// The redirect mode allows user to create a shortcut for their own link. /// such as example.solian.page/rickroll -- DyZ 301 -> youtube.com/... /// Redirect } public class SnPublicationPage : ModelBase { public Guid Id { get; set; } = Guid.NewGuid(); public PublicationPageType Type { get; set; } = PublicationPageType.HtmlPage; [MaxLength(8192)] public string Path { get; set; } = "/"; [Column(TypeName = "jsonb")] public Dictionary Config { get; set; } = new(); public Guid SiteId { get; set; } [JsonIgnore] public SnPublicationSite Site { get; set; } = null!; }