43 lines
2.2 KiB
C#
43 lines
2.2 KiB
C#
using System.Text.Json.Nodes;
|
|
|
|
namespace IM.InitCommon.Management;
|
|
|
|
public record PageResult<T>(IReadOnlyList<T> Items, int Total, int Page, int Size);
|
|
public record InternalAction(Guid Id, Guid ActorId, Guid TargetId, string Action, string Reason);
|
|
public record ActionReceipt(string TargetName, string Before, string After);
|
|
public record EvidenceRequest(Guid ReporterId, string Type, Guid TargetId, Guid[] MessageIds);
|
|
public record EvidenceSnapshot(Guid Id, Guid SenderId, string SenderName, string Text, string Type, Guid? FileId, DateTimeOffset SentAt);
|
|
public record SubjectEvidence(string TargetName, IReadOnlyList<EvidenceSnapshot> Evidence);
|
|
public record UserAccess(bool Enabled, string Stamp);
|
|
public record ServiceHealth(string Service, string Status, double? LatencyMs, DateTime CheckedAt, DateTime? LastSuccessAt, string? Error, long? ConfigVersion = null);
|
|
public sealed class Policy
|
|
{
|
|
public long Version { get; set; }
|
|
public string PlatformName { get; set; } = "IM";
|
|
public string Description { get; set; } = "";
|
|
public string SupportEmail { get; set; } = "";
|
|
public bool RegistrationEnabled { get; set; } = true;
|
|
public int PasswordMinLength { get; set; } = 6;
|
|
public int FriendLimit { get; set; }
|
|
public int CreatedGroupLimit { get; set; }
|
|
public int GroupMemberLimit { get; set; }
|
|
public int DefaultJoinAuthority { get; set; }
|
|
public int TextLimit { get; set; }
|
|
public int RecallMinutes { get; set; }
|
|
public long UploadMaxBytes { get; set; }
|
|
public string[] AllowedFileTypes { get; set; } = [];
|
|
public string[] ReportCategories { get; set; } = ["推广信息", "骚扰辱骂", "冒充身份", "其他"];
|
|
public int ReportsPerDay { get; set; } = 20;
|
|
public int ReportCooldownMinutes { get; set; } = 10;
|
|
public int ClientAccessMinutes { get; set; }
|
|
public int ClientRefreshDays { get; set; }
|
|
public int AdminSessionMinutes { get; set; } = 480;
|
|
public int AdminLockThreshold { get; set; } = 5;
|
|
public int AdminLockMinutes { get; set; } = 15;
|
|
}
|
|
public static class ManagementResult
|
|
{
|
|
public static object Ok(object? data = null) => new { code = 0, message = "成功", data };
|
|
public static object Fail(string message) => new { code = 1003, message, data = (object?)null };
|
|
}
|