♻️ Extract the Storage service to DysonNetwork.Drive microservice

This commit is contained in:
2025-07-06 17:29:26 +08:00
parent 6a3d04af3d
commit 14b79f16f4
71 changed files with 2629 additions and 346 deletions

View 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; }
}