♻️ Extract the Storage service to DysonNetwork.Drive microservice
This commit is contained in:
50
DysonNetwork.Drive/Models/Post.cs
Normal file
50
DysonNetwork.Drive/Models/Post.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DysonNetwork.Drive.Models;
|
||||
|
||||
public class Post : ModelBase
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
[MaxLength(1024)]
|
||||
public string Title { get; set; } = null!;
|
||||
|
||||
public string Content { get; set; } = string.Empty;
|
||||
|
||||
public Guid AuthorId { get; set; }
|
||||
public virtual Account? Author { get; set; }
|
||||
|
||||
public bool IsPublished { get; set; } = false;
|
||||
public bool IsDeleted { get; set; } = false;
|
||||
|
||||
// Navigation properties
|
||||
public virtual ICollection<PostViewInfo> Views { get; set; } = new List<PostViewInfo>();
|
||||
public virtual ICollection<CloudFileReference> Attachments { get; set; } = new List<CloudFileReference>();
|
||||
}
|
||||
|
||||
public class PostViewInfo
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
public Guid PostId { get; set; }
|
||||
public virtual Post? Post { get; set; }
|
||||
|
||||
public string? UserAgent { get; set; }
|
||||
public string? IpAddress { get; set; }
|
||||
public string? Referrer { get; set; }
|
||||
|
||||
public string? ViewerId { get; set; }
|
||||
|
||||
public DateTimeOffset ViewedAt { get; set; } = DateTimeOffset.UtcNow;
|
||||
|
||||
// Additional metadata
|
||||
public string? CountryCode { get; set; }
|
||||
public string? DeviceType { get; set; }
|
||||
public string? Platform { get; set; }
|
||||
public string? Browser { get; set; }
|
||||
}
|
Reference in New Issue
Block a user