ModuleVersionEntity.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using SqlSugar;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace SKMC.Api.Common.Version
  8. {
  9. [SugarTable("SKMC_MODULE_VERSION")]
  10. public class ModuleVersionEntity
  11. {
  12. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  13. public long Id { get; set; }
  14. public string Name { get; set; }
  15. public string CommitHash { get; set; }
  16. public string ShortVersion => string.IsNullOrEmpty(CommitHash) || CommitHash.Length < 7
  17. ? CommitHash
  18. : CommitHash.Substring(0, 7);
  19. public string Branch { get; set; }
  20. public string Author { get; set; }
  21. public DateTime CommitTime { get; set; }
  22. public string CommitMessage { get; set; }
  23. public bool HasUncommittedChanges { get; set; }
  24. public string Path { get; set; }
  25. public string DisplayVersion
  26. {
  27. get
  28. {
  29. var shortHash = string.IsNullOrEmpty(CommitHash) || CommitHash.Length < 7
  30. ? "unknown"
  31. : CommitHash.Substring(0, 7);
  32. return $"{CommitTime.ToString("yyMMddHHmmss")}{shortHash}";
  33. }
  34. }
  35. public string AssemblyFileVersion { get; set; }
  36. public string Dependencies { get; set; }
  37. public string DependedBy { get; set; }
  38. }
  39. }