增加获取最新版本接口
This commit is contained in:
parent
b5e1badf07
commit
cb1ef1db08
|
|
@ -1,5 +1,6 @@
|
|||
using LFlow.Base.Default;
|
||||
using LFlow.Base.Utils;
|
||||
using LFlow.VersionManagement.Enums;
|
||||
using LFlow.VersionManagement.Model;
|
||||
using SqlSugar;
|
||||
|
||||
|
|
@ -20,4 +21,14 @@ public class VersionManagementRepo(ISqlSugarClient db) : DefaultCurdRepo<Version
|
|||
.Select(x => x.ID)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public VersionModel GetLatestVersion(VersionType type, VersionChannel channel, UpgradeTargetType targetType)
|
||||
{
|
||||
return db.Queryable<VersionModel>()
|
||||
.Where(mt => type == mt.VersionType && channel == mt.VersionChannel && targetType == mt.UpgradeTargetType)
|
||||
.GroupBy(mt => mt.CurrentVersion)
|
||||
.OrderBy(mt => mt.LastPublishTime, OrderByType.Desc)
|
||||
.First();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue