ABPCMS.Application/ABPCMSApplicationModule.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System.Reflection;
using Abp.Authorization;
using Abp.Authorization.Roles;
using Abp.Authorization.Users;
using Abp.AutoMapper;
using Abp.Domain.Repositories;
using Abp.Modules;
using ABPCMS.Authorization.Roles;
using ABPCMS.Authorization.Users;
using ABPCMS.Roles.Dto;
using ABPCMS.Users.Dto;
using Abp.Threading.BackgroundWorkers;
using Abp.Runtime.Caching;
using Abp.Runtime.Caching.Redis;
using Abp.Hangfire;
using Abp.Quartz;
using ABPCMS.HangfireServiceBase;
using Quartz;
using Abp.Quartz.Configuration;
namespace ABPCMS
{
[DependsOn(typeof(ABPCMSCoreModule), typeof(AbpAutoMapperModule),
typeof(AbpHangfireModule),
// typeof(HangFireWorkerModule) //- ENABLE TO USE HANGFIRE INSTEAD OF DEFAULT JOB MANAGER
//typeof(AbpRedisCacheModule),
typeof(AbpQuartzModule)
)]
public class ABPCMSApplicationModule : AbpModule
{
public override void PreInitialize()
{
base.PreInitialize();
//IocManager.Register<ICacheManager, AbpRedisCacheManager>();
//如果Redis在本机,并且使用的默认端口,下面的代码可以不要
//Configuration.Modules.AbpRedisCacheModule().ConnectionStringKey = "KeyName";
//Configuration.Modules.AbpAutoMapper().Configurators.Add(mapper =>
//{
// mapper.AddProfile<ScheduleProfile>();
//});
}
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
// TODO: Is there somewhere else to store these, with the dto classes
Configuration.Modules.AbpAutoMapper().Configurators.Add(cfg =>
{
// Role and permission
cfg.CreateMap<Permission, string>().ConvertUsing(r => r.Name);
cfg.CreateMap<RolePermissionSetting, string>().ConvertUsing(r => r.Name);
cfg.CreateMap<CreateRoleDto, Role>().ForMember(x => x.Permissions, opt => opt.Ignore());
cfg.CreateMap<RoleDto, Role>().ForMember(x => x.Permissions, opt => opt.Ignore());
后面还有 32 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
