FileSqlServerSync/Server/RemoteServer/Models/SyncFilesLog.cs
zhaoyouya 46315ba760 chore: 添加sqlite 数据库,remote server 增加一些接口
添加了一些数据模型,添加了一些简单的单元测试
2024-10-12 21:57:45 +08:00

96 lines
2.1 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace RemoteServer;
public class SyncLogHead
{
[Key]
public Guid Id { get; set; }
/// <summary>
/// git versions
/// </summary>
[MaxLength(50)]
public required string VersionsFromTag { get; set; }
/// <summary>
/// 同步时间
/// </summary>
public DateTime SyncTime { get; set; }
/// <summary>
/// 客户端ID
/// </summary>
[MaxLength(200)]
public required string ClientID { get; set; }
/// <summary>
/// 客户端名称
/// </summary>
[MaxLength(50)]
public string? ClientName { get; set; }
/// <summary>
/// 状态 0 正在进行1 已完成2 失败有错误
/// </summary>
public int Status { get; set; }
/// <summary>
/// 同步消息
/// </summary>
public string? Message { get; set; }
}
public class SyncLogFile
{
[Key]
public Guid Id { get; set; }
/// <summary>
/// 头部Id
/// </summary>
public Guid HeadId { get; set; }
/// <summary>
/// 客户端文件全目录
/// </summary>
[MaxLength(500)]
public required string ClientRootPath { get; set; }
/// <summary>
/// 服务器文件全目录
/// </summary>
[MaxLength(500)]
public required string ServerRootPath { get; set; }
/// <summary>
/// 相对路径
/// </summary>
[MaxLength(500)]
public required string RelativePath { get; set; }
}
public class SyncGitCommit
{
[Key]
public Guid Id { get; set; }
public Guid HeadId { get; set; }
/// <summary>
/// git commit id
/// </summary>
public required string CommitId { get; set; }
/// <summary>
/// git commit 用户名
/// </summary>
public required string CommitUserName { get; set; }
/// <summary>
/// git commit 时间
/// </summary>
public DateTime CommitTime { get; set; }
/// <summary>
/// git 提交内容
/// </summary>
public required string CommitMessage { get; set; }
}