ModuleVersion.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using SqlSugar;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace SKMC.Api.Common.Version
  5. {
  6. public class ModuleVersion
  7. {
  8. public string Name { get; set; }
  9. public string CommitHash { get; set; }
  10. public string ShortVersion => string.IsNullOrEmpty(CommitHash) || CommitHash.Length < 7
  11. ? CommitHash
  12. : CommitHash.Substring(0, 7);
  13. public string Branch { get; set; }
  14. public string Author { get; set; }
  15. public DateTime CommitTime { get; set; }
  16. public string CommitMessage { get; set; }
  17. public bool HasUncommittedChanges { get; set; }
  18. public string Path { get; set; }
  19. public string DisplayVersion
  20. {
  21. get
  22. {
  23. var shortHash = string.IsNullOrEmpty(CommitHash) || CommitHash.Length < 7
  24. ? "unknown"
  25. : CommitHash.Substring(0, 7);
  26. return $"1.0.0.git{shortHash}";
  27. }
  28. }
  29. public string AssemblyFileVersion { get; set; }
  30. public string Dependencies { get; set; } = string.Empty;
  31. public string DependedBy { get; set; } = string.Empty;
  32. }
  33. }