From 5ed583a0062d57baa2412349f7a5a5313d57fb96 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Tue, 22 Oct 2024 10:14:13 +0800 Subject: [PATCH] 105040 Update --- LFlow.Base/appsettings.json | 1 + .../Controller/VersionManagementController.cs | 4 ++-- .../Repository/VersionManagementRepo.cs | 21 ++++++++++++++++--- .../Service/IVersionManagementService.cs | 2 +- .../Service/VersionManagementService.cs | 4 ++-- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/LFlow.Base/appsettings.json b/LFlow.Base/appsettings.json index b436c37..ecc731c 100644 --- a/LFlow.Base/appsettings.json +++ b/LFlow.Base/appsettings.json @@ -1,4 +1,5 @@ { + "Urls": "https://127.0.0.1:8443;http://127.0.0.1:8088", "Serilog": { "MinimumLevel": { "Default": "Debug", diff --git a/LFlow.VersionManagement/Controller/VersionManagementController.cs b/LFlow.VersionManagement/Controller/VersionManagementController.cs index 3eadeea..f8bceb4 100644 --- a/LFlow.VersionManagement/Controller/VersionManagementController.cs +++ b/LFlow.VersionManagement/Controller/VersionManagementController.cs @@ -68,8 +68,8 @@ public class VersionManagementController(IVersionManagementService service) : Ba //} [HttpGet] - public ApiResult GetLastUpdate(VersionType type, VersionChannel channel, UpgradeTargetType targetType) + public ApiResult GetLastUpdate(VersionChannel channel, UpgradeTargetType targetType) { - return ApiResult.SuccessResult(service.GetLastVersion(type, channel, targetType)); + return ApiResult.SuccessResult(service.GetLastVersion(channel, targetType)); } } diff --git a/LFlow.VersionManagement/Repository/VersionManagementRepo.cs b/LFlow.VersionManagement/Repository/VersionManagementRepo.cs index 0e838dc..a6b355b 100644 --- a/LFlow.VersionManagement/Repository/VersionManagementRepo.cs +++ b/LFlow.VersionManagement/Repository/VersionManagementRepo.cs @@ -7,12 +7,22 @@ using SqlSugar; namespace LFlow.VersionManagement.Repository; public class VersionManagementRepo(ISqlSugarClient db) : DefaultCurdRepo(db) { + /// + /// 根据条件搜索 + /// + /// + /// public override List Search(VersionModel whereObj) { return db.Queryable() .Where(whereObj.ToWhereExp()) .ToList(); } + /// + /// 根据条件搜索ID + /// + /// + /// public override List WhereSearchId(VersionModel whereObj) { return db.Queryable() @@ -21,11 +31,16 @@ public class VersionManagementRepo(ISqlSugarClient db) : DefaultCurdRepo x.ID) .ToList(); } - - public VersionModel GetLatestVersion(VersionType type, VersionChannel channel, UpgradeTargetType targetType) + /// + /// 获取最新版本 + /// + /// + /// + /// + public VersionModel GetLatestVersion(VersionChannel channel, UpgradeTargetType targetType) { return db.Queryable() - .Where(mt => type == mt.VersionType && channel == mt.VersionChannel && targetType == mt.UpgradeTargetType) + .Where(mt => channel == mt.VersionChannel && targetType == mt.UpgradeTargetType) .GroupBy(mt => mt.CurrentVersion) .OrderBy(mt => mt.LastPublishTime, OrderByType.Desc) .First(); diff --git a/LFlow.VersionManagement/Service/IVersionManagementService.cs b/LFlow.VersionManagement/Service/IVersionManagementService.cs index 6016cd1..5bb7555 100644 --- a/LFlow.VersionManagement/Service/IVersionManagementService.cs +++ b/LFlow.VersionManagement/Service/IVersionManagementService.cs @@ -13,5 +13,5 @@ public interface IVersionManagementService : IService// List GetAll(int pageIndex, int pageSize, ref int total); - VersionDto? GetLastVersion(VersionType type, VersionChannel channel, UpgradeTargetType targetType); + VersionDto? GetLastVersion(VersionChannel channel, UpgradeTargetType targetType); } diff --git a/LFlow.VersionManagement/Service/VersionManagementService.cs b/LFlow.VersionManagement/Service/VersionManagementService.cs index 2a99773..29f3de2 100644 --- a/LFlow.VersionManagement/Service/VersionManagementService.cs +++ b/LFlow.VersionManagement/Service/VersionManagementService.cs @@ -23,11 +23,11 @@ public class VersionManagementService : IVersionManagementService // 搜索需要增加分页 public List Search(VersionDto whereObj) => _repo.Search(whereObj.Adapt()).Adapt>(); - public VersionDto? GetLastVersion(VersionType type, VersionChannel channel, UpgradeTargetType targetType) + public VersionDto? GetLastVersion(VersionChannel channel, UpgradeTargetType targetType) { if (_repo is VersionManagementRepo versionRepo) { - return versionRepo.GetLatestVersion(type, channel, targetType).Adapt(); + return versionRepo.GetLatestVersion(channel, targetType).Adapt(); } else {