From f013ee64a24d6969035645272408f8aae5751a0a Mon Sep 17 00:00:00 2001 From: Leigh Pointer Date: Mon, 10 Jun 2024 22:10:39 +0200 Subject: [PATCH] Updated Module Template with ISearchable implementation --- .../Server/Manager/[Module]Manager.cs | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Manager/[Module]Manager.cs b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Manager/[Module]Manager.cs index 4be95aa7..9c263fef 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Manager/[Module]Manager.cs +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Manager/[Module]Manager.cs @@ -1,16 +1,18 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Text.Json; using Oqtane.Modules; using Oqtane.Models; using Oqtane.Infrastructure; +using Oqtane.Interfaces; using Oqtane.Enums; using Oqtane.Repository; using [Owner].Module.[Module].Repository; namespace [Owner].Module.[Module].Manager { - public class [Module]Manager : MigratableModuleBase, IInstallable, IPortable + public class [Module]Manager : MigratableModuleBase, IInstallable, IPortable, ISearchable { private readonly I[Module]Repository _[Module]Repository; private readonly IDBContextDependencies _DBContextDependencies; @@ -57,5 +59,24 @@ namespace [Owner].Module.[Module].Manager } } } - } + + public IList GetSearchContentList(Oqtane.Models.Module module, DateTime startTime) + { + var searchContentList = new List(); + + var [Module]s = _[Module]Repository.Get[Module]s(module.ModuleId); + foreach (var [Module] in [Module]s) + { + searchContentList.Add(new SearchContent + { + Title = module.Title, + Description = string.Empty, + Body = [Module].Name, + ModifiedTime = [Module].ModifiedOn + }); + } + + return searchContentList; + } +} }