CmsKit - Refactorins & Renamings

pull/9396/head
enisn 4 years ago
parent 5b5477d2cf
commit 3fe381d95e

@ -2,7 +2,7 @@
$(function () {
var l = abp.localization.getResource("CmsKit");
var menuService = volo.cmsKit.admin.menus.menuAdmin;
var menuService = volo.cmsKit.admin.menus.menuItemAdmin;
var createModal = new abp.ModalManager({ viewUrl: abp.appPath + 'CmsKit/Menus/MenuItems/CreateModal', modalClass: 'createMenuItem' });
var updateModal = new abp.ModalManager({ viewUrl: abp.appPath + 'CmsKit/Menus/MenuItems/UpdateModal', modalClass: 'updateMenuItem'});

@ -1,4 +1,3 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
@ -8,20 +7,21 @@ using Volo.CmsKit.Pages;
namespace Volo.CmsKit.Menus
{
public class PageChangedHandler: ILocalEventHandler<EntityUpdatedEventData<Page>>,
public class PageChangedHandler :
ILocalEventHandler<EntityUpdatedEventData<Page>>,
ITransientDependency
{
protected IMenuItemRepository MenuRepository { get; }
protected MenuItemManager MenuManager { get; }
public PageChangedHandler(
IMenuItemRepository menuRepository,
IMenuItemRepository menuRepository,
MenuItemManager menuManager)
{
MenuRepository = menuRepository;
MenuManager = menuManager;
}
public async Task HandleEventAsync(EntityUpdatedEventData<Page> eventData)
{
// TODO: Write a repository query.

@ -39,7 +39,7 @@ namespace Volo.CmsKit.MongoDB
public IMongoCollection<MediaDescriptor> MediaDescriptors => Collection<MediaDescriptor>();
public IMongoCollection<MenuItem> Menus => Collection<MenuItem>();
public IMongoCollection<MenuItem> MenuItems => Collection<MenuItem>();
protected override void CreateModel(IMongoModelBuilder modelBuilder)
{

@ -39,6 +39,6 @@ namespace Volo.CmsKit.MongoDB
IMongoCollection<MediaDescriptor> MediaDescriptors { get; }
IMongoCollection<MenuItem> Menus { get; }
IMongoCollection<MenuItem> MenuItems { get; }
}
}

@ -7,6 +7,6 @@ namespace Volo.CmsKit.Public.Menus
{
public interface IMenuItemPublicAppService : IApplicationService
{
Task<List<MenuItemDto>> GetMenuItemsAsync();
Task<List<MenuItemDto>> GetListAsync();
}
}

@ -21,7 +21,7 @@ namespace Volo.CmsKit.Public.Menus
DistributedCache = distributedCache;
}
public async Task<List<MenuItemDto>> GetMenuItemsAsync()
public async Task<List<MenuItemDto>> GetListAsync()
{
var cachedMenu = await DistributedCache.GetOrAddAsync(
MenuApplicationConsts.MainMenuCacheKey,

@ -22,9 +22,9 @@ namespace Volo.CmsKit.Public.Menus
}
[HttpGet]
public Task<List<MenuItemDto>> GetMenuItemsAsync()
public Task<List<MenuItemDto>> GetListAsync()
{
return MenuPublicAppService.GetMenuItemsAsync();
return MenuPublicAppService.GetListAsync();
}
}
}

@ -26,7 +26,7 @@ namespace Volo.CmsKit.Public.Web.Menus
{
var menuAppService = context.ServiceProvider.GetRequiredService<IMenuItemPublicAppService>();
var menuItems = await menuAppService.GetMenuItemsAsync();
var menuItems = await menuAppService.GetListAsync();
if (!menuItems.IsNullOrEmpty())
{

Loading…
Cancel
Save