├── Lfz.MqListener.WindowService ├── readme.txt ├── 安装服务.bat ├── 卸载服务.bat ├── 调度.ico ├── Config │ └── autoupdater.json ├── Program.cs ├── ProjectInstaller.cs ├── Service1.cs ├── Service1.Designer.cs ├── Properties │ └── AssemblyInfo.cs └── App.config ├── Lib ├── AopSdk.dll ├── LibCurlNet.dll ├── NLog │ └── NLog.dll ├── Excel导出模板工具 │ ├── NPOI.dll │ ├── IrisSkin2.dll │ ├── NPOI.OOXML.dll │ ├── ExcelReport.dll │ ├── NPOI.Extend.dll │ ├── XmlGenerator.exe │ ├── NPOI.OpenXml4Net.dll │ ├── NPOI.OpenXmlFormats.dll │ ├── XmlGenerator.vshost.exe │ ├── ICSharpCode.SharpZipLib.dll │ └── XmlGenerator.vshost.exe.manifest ├── ThirdPart │ ├── LitJSON.dll │ └── MvcPager.dll ├── ActiveMQ │ ├── Apache.NMS.dll │ └── Apache.NMS.ActiveMQ.dll ├── Json │ └── Newtonsoft.Json.dll ├── Interop.IWshRuntimeLibrary.dll ├── SharpCompress │ └── SharpCompress.dll ├── WebApiNET4 │ ├── System.Net.Http.dll │ ├── System.Web.Http.dll │ ├── System.Net.Http.Formatting.dll │ └── System.Net.Http.WebRequest.dll ├── NHibernate.4.0.4.4000 │ └── NHibernate.dll ├── MySql.Data.6.9.8 │ ├── net40 │ │ └── MySql.Data.dll │ └── net45 │ │ └── MySql.Data.dll ├── FluentNHibernate.2.0.3.0 │ └── FluentNHibernate.dll └── ServiceStack.Redis.3.9.71 │ ├── ServiceStack.Common.dll │ ├── ServiceStack.Redis.dll │ ├── ServiceStack.Text.dll │ └── ServiceStack.Interfaces.dll ├── .nuget ├── NuGet.exe └── NuGet.Config ├── Lfz.Core ├── IWebHelper.cs ├── WebHelper.cs ├── Data │ ├── IRepository.cs │ ├── Repository.cs │ ├── EfRepository.cs │ ├── Nh │ │ ├── INhRepository.cs │ │ ├── Entities │ │ │ ├── EntityMap.cs │ │ │ ├── MetaEntityBase.cs │ │ │ ├── DefaultMap.cs │ │ │ └── GuidMap.cs │ │ ├── Providers │ │ │ ├── AbstractDataServicesProvider.cs │ │ │ ├── AbstractDataServicesProvider.partial.cs │ │ │ ├── IDataServicesProviderFactory.cs │ │ │ ├── IDataServicesProvider.cs │ │ │ ├── DataServicesProviderFactory.cs │ │ │ ├── SqlServerDataServicesProvider.cs │ │ │ ├── MySqlDataServicesProvider.cs │ │ │ └── MsSqlCeConfiguration.cs │ │ ├── Conventions │ │ │ ├── CascadeAllDeleteOrphanAttribute.cs │ │ │ ├── StringLengthMaxAttribute.cs │ │ │ ├── AggregateAttribute.cs │ │ │ ├── CascadeAllDeleteOrphanConvention.cs │ │ │ ├── StringLengthConvention.cs │ │ │ ├── CacheConvention.cs │ │ │ ├── AttributeCollectionConvention.cs │ │ │ └── ReferenceConvention.cs │ │ ├── NhRepository.partial.cs │ │ └── INhTypeProvider.cs │ ├── MappingConfiguration.cs │ ├── RawSql │ │ ├── BusinessService.cs │ │ ├── RawSqlSearchService.cs │ │ ├── DbProvider.cs │ │ ├── DbProviderConfig.cs │ │ ├── TemplateColumnDataType.cs │ │ ├── TemplateDataSourceType.cs │ │ └── IDbProviderConfig.cs │ ├── ISessionConfigurationCache.cs │ ├── SessionConfigurationCache.cs │ ├── DefaultDatabaseCacheConfiguration.cs │ ├── Conventions │ │ ├── RecordTableNameConvention.cs │ │ ├── CascadeAllDeleteOrphanAttribute.cs │ │ ├── StringLengthConvention.cs │ │ ├── CacheConvention.cs │ │ ├── AttributeCollectionConvention.cs │ │ └── AggregateAttribute.cs │ ├── Providers │ │ ├── SqlServerDataServicesProvider.cs │ │ ├── IDataServicesProviderFactory.cs │ │ ├── SessionFactoryParameters.cs │ │ ├── DataServiceParameters.cs │ │ ├── IDataServicesProvider.cs │ │ ├── MySqlDataServicesProvider.cs │ │ └── DataServicesProviderFactory.cs │ ├── ISessionLocator.cs │ ├── IDatabaseCacheConfiguration.cs │ ├── KeyValueEntity.cs │ ├── Infrastructure │ │ ├── BaseDataProviderManager.cs │ │ ├── IEfDataProvider.cs │ │ ├── IDataProvider.cs │ │ ├── EfDataProviderManager.cs │ │ ├── SqlCeDataProvider.cs │ │ └── BaseEfDataProvider.cs │ ├── DescriptionAttribute.cs │ ├── Extensions.cs │ ├── EntityMappingBase.cs │ ├── SelectTreeListItem.cs │ ├── Schema │ │ └── StringLengthAttribute.cs │ ├── Initializers │ │ └── DropCreateCeDatabaseAlways.cs │ ├── DataModule.cs │ └── CommandInfo.cs ├── Enums │ ├── DataStatus.cs │ ├── ChoseYesOrNo.cs │ ├── Hr │ │ ├── RightHrType.cs │ │ ├── ModuleRightsType.cs │ │ ├── HrDepartmentType.cs │ │ ├── RightValue.cs │ │ └── InternalUserRoleType.cs │ ├── PermissionType.cs │ ├── Sex.cs │ ├── AsynchronousCallStatus.cs │ ├── DelFlag.cs │ ├── FuncListen.cs │ ├── TreeLevel.cs │ ├── BindingMoblieStatus.cs │ ├── AttachmentType.cs │ └── UserDataStatus.cs ├── Logging │ ├── ILogger.cs │ ├── NullLogger.cs │ ├── LoggerType.cs │ ├── LogLevel.cs │ └── ConsoleLoger.cs ├── Rest │ ├── JsonContent.cs │ ├── JsonUtils.cs │ ├── RestStatus.cs │ ├── IJsonContent.cs │ ├── ResponseContent.cs │ ├── RestContentBase.cs │ ├── HttpContextExtension.cs │ ├── JsonPropertyFilterEnum.cs │ ├── RestContentContractResolver.cs │ ├── RestContentBaseExtenstion.cs │ └── RestResolverFilterAttribute.cs ├── Utitlies │ ├── UrlOper.cs │ ├── ZipHelper.cs │ ├── AppUnitity.cs │ └── Utils.Regex.cs ├── WebApi │ ├── ApiResult.cs │ ├── PagedApiResult.cs │ └── ServerApiStatus.cs ├── Models │ ├── ISearchHit.cs │ ├── KeySearchHit.cs │ ├── PageIndexChangedHit.cs │ ├── PropertyTrackStatus.cs │ ├── SearchHitBase.cs │ ├── IViewStateSearchHit.cs │ ├── ListItem.cs │ ├── SearchHit.cs │ └── PropertyTrackInfo.cs ├── Mq │ ├── MqInstanceInfo.cs │ ├── MqClientConfigInfo.cs │ ├── ActiveMQ │ │ └── ActiveMQPoolConnectionManager.cs │ └── IMqConfigService.cs ├── Redis │ ├── RedisConfig.cs │ └── IRedisConfigService.cs ├── Network │ ├── BufferManager.cs │ ├── DataEventArgs.cs │ ├── PacketBufferToken.cs │ ├── TcpClientService.cs │ ├── TcpListenServiceBase.cs │ ├── UdpListenServiceBase.cs │ ├── UdpReceviceEventArgs.cs │ ├── HttpListenServiceBase.cs │ ├── SocketAsyncEventArgsPool.cs │ ├── UdpSyncListenServiceBase.cs │ ├── SocketReceivedEventHandler.cs │ ├── UdpSyncListenReceviceService.cs │ ├── CallBackState.cs │ └── TcpClientAsyncService.cs ├── Services │ ├── ServiceBase.cs │ ├── ThreadServiceBase.cs │ ├── TimeServiceBase.cs │ ├── ServiceEventHandler.cs │ ├── IInstallService.cs │ ├── StringEventArgs.cs │ ├── IService.cs │ └── InstallService.cs ├── Caching │ ├── RedisCacheManager.cs │ ├── IAsyncTokenProvider.cs │ ├── Weak.cs │ ├── CacheModule.cs │ └── IParallelCacheContext.cs ├── Collections │ ├── QueryableExtentsion.cs │ ├── IPageOfDatatable.cs │ ├── IPageOfItems.cs │ ├── PageOfItemsExtension.cs │ └── IPagerInfo.cs ├── Config │ ├── RunConfig.json │ ├── Parameters.config │ ├── IConfigInfo.cs │ ├── EncryptContent.cs │ ├── IConfigFileManager.cs │ ├── RunConfig.cs │ └── AppSettingsHelper.cs ├── Security │ ├── Cryptography │ │ └── RSACryption.cs │ ├── AuthorizationManager.cs │ ├── CustomX509Validator.cs │ └── UserNamePasswordCustomValidator.cs ├── Commands │ ├── ICommandResult.cs │ ├── CommandHandlerNotFoundException.cs │ ├── ValidationHandlerNotFoundException.cs │ ├── DefaultCommandResult.cs │ ├── IValidationHandler.cs │ ├── ICommandBus.cs │ ├── ICommandHandler.cs │ └── CommandHandlerBase.cs ├── IO │ ├── FileSystemSettings.cs │ ├── IStorageFolder.cs │ └── IStorageFile.cs ├── TcSoftVersion.cs ├── Properties │ └── AssemblyInfo.cs ├── DataAnnotations │ └── CustomRequiredAttribute.cs ├── IDependency.cs ├── CustomDescriptionAttribute.cs └── Validation │ └── ValidationResult.cs ├── Lfz.MqListener ├── 调度.ico ├── Config │ └── autoupdater.json ├── Properties │ └── AssemblyInfo.cs └── App.config ├── Lfz.AutoUpdater ├── Rest │ ├── JsonUtils.cs │ ├── JsonContent.cs │ ├── RestStatus.cs │ ├── IJsonContent.cs │ ├── ResponseContent.cs │ ├── RestContentBase.cs │ ├── JsonPropertyFilterEnum.cs │ ├── RestContentContractResolver.cs │ ├── RestContentBaseExtenstion.cs │ └── RestResolverFilterAttribute.cs ├── autoupdater.ico ├── Logging │ ├── ILogger.cs │ ├── LogLevel.cs │ ├── NullLogger.cs │ ├── LoggerType.cs │ └── ConsoleLoger.cs ├── Utitlies │ ├── AppUnitity.cs │ ├── ZipHelper.cs │ └── Utils.Regex.cs ├── Config │ ├── RunConfig.json │ ├── IConfigInfo.cs │ ├── autoupdater.json │ └── RunConfig.cs ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ └── AssemblyInfo.cs ├── IO │ ├── FileSystemSettings.cs │ ├── IStorageFolder.cs │ └── IStorageFile.cs ├── App.config ├── Program.cs └── CustomDescriptionAttribute.cs ├── Lfz.MqListener.Service ├── Mq │ ├── IMqProducerService.cs │ └── MqCommandInfo.cs ├── Shared │ ├── App │ │ ├── AppBasicInfo.cs │ │ └── MqAutoUpdateInfo.cs │ ├── Enums │ │ ├── MqListenerStatus.cs │ │ ├── CacheVersionType.cs │ │ ├── ClusterComputerType.cs │ │ ├── StoreStatus.cs │ │ └── CustomerInfoStatus.cs │ ├── Models │ │ ├── NMSMessageType.cs │ │ ├── TopicName.cs │ │ ├── QuqueName.cs │ │ └── MqConsts.cs │ ├── SysConfig.cs │ └── ITreeContent.cs ├── Models │ ├── Device │ │ └── DeviceBasicInfo.cs │ └── ConfigCenter │ │ ├── ConfigCenterMqTable.cs │ │ ├── ConfigCenterMqListener.cs │ │ ├── ConfigCenterClusterComputer.cs │ │ ├── ConfigCenterRedisCacheKey.cs │ │ └── ConfigCenter_ModuleSettings.cs ├── CacheShared │ └── RedisConfigService.cs ├── MqVistor │ ├── IMqCommandQuqueVistor.cs │ ├── SyncTable │ │ ├── SyncBigDataServiceHelper.cs │ │ ├── ISyncTableComand.cs │ │ └── ComandHandler │ │ │ └── SyncChargeCommandHandler.cs │ ├── IMqCommandTopicVistor.cs │ └── Heartbeat │ │ ├── DeviceHeatbeatCommandVistor.cs │ │ ├── DeviceRegisterCommandVistor.cs │ │ ├── AppHeartbeatCommandVistor.cs │ │ └── AppRegisterCommandVistor.cs ├── Config │ └── AppSettingsHelperExtension.cs ├── Properties │ └── AssemblyInfo.cs ├── Access │ ├── ConfigCenterRedisCacheKeyAccess.cs │ └── DeviceAccess.cs └── Service │ └── IConfigCenterMqListenerService.cs ├── README.md └── Lfz.MqListener.DlqConsole ├── Properties └── AssemblyInfo.cs └── App.config /Lfz.MqListener.WindowService/readme.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Lib/AopSdk.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/AopSdk.dll -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/.nuget/NuGet.exe -------------------------------------------------------------------------------- /Lib/LibCurlNet.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/LibCurlNet.dll -------------------------------------------------------------------------------- /Lib/NLog/NLog.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/NLog/NLog.dll -------------------------------------------------------------------------------- /Lfz.Core/IWebHelper.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/IWebHelper.cs -------------------------------------------------------------------------------- /Lfz.Core/WebHelper.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/WebHelper.cs -------------------------------------------------------------------------------- /Lfz.MqListener/调度.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener/调度.ico -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/NPOI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Excel导出模板工具/NPOI.dll -------------------------------------------------------------------------------- /Lib/ThirdPart/LitJSON.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/ThirdPart/LitJSON.dll -------------------------------------------------------------------------------- /Lfz.Core/Data/IRepository.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/IRepository.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/Repository.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/Repository.cs -------------------------------------------------------------------------------- /Lfz.Core/Enums/DataStatus.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Enums/DataStatus.cs -------------------------------------------------------------------------------- /Lfz.Core/Logging/ILogger.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Logging/ILogger.cs -------------------------------------------------------------------------------- /Lfz.Core/Rest/JsonContent.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Rest/JsonContent.cs -------------------------------------------------------------------------------- /Lfz.Core/Rest/JsonUtils.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Rest/JsonUtils.cs -------------------------------------------------------------------------------- /Lfz.Core/Rest/RestStatus.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Rest/RestStatus.cs -------------------------------------------------------------------------------- /Lfz.Core/Utitlies/UrlOper.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Utitlies/UrlOper.cs -------------------------------------------------------------------------------- /Lfz.Core/WebApi/ApiResult.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/WebApi/ApiResult.cs -------------------------------------------------------------------------------- /Lib/ActiveMQ/Apache.NMS.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/ActiveMQ/Apache.NMS.dll -------------------------------------------------------------------------------- /Lib/Json/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Json/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /Lib/ThirdPart/MvcPager.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/ThirdPart/MvcPager.dll -------------------------------------------------------------------------------- /Lfz.Core/Data/EfRepository.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/EfRepository.cs -------------------------------------------------------------------------------- /Lfz.Core/Enums/ChoseYesOrNo.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Enums/ChoseYesOrNo.cs -------------------------------------------------------------------------------- /Lfz.Core/Models/ISearchHit.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Models/ISearchHit.cs -------------------------------------------------------------------------------- /Lfz.Core/Mq/MqInstanceInfo.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Mq/MqInstanceInfo.cs -------------------------------------------------------------------------------- /Lfz.Core/Redis/RedisConfig.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Redis/RedisConfig.cs -------------------------------------------------------------------------------- /Lfz.Core/Rest/IJsonContent.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Rest/IJsonContent.cs -------------------------------------------------------------------------------- /Lfz.Core/Utitlies/ZipHelper.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Utitlies/ZipHelper.cs -------------------------------------------------------------------------------- /Lfz.MqListener.WindowService/安装服务.bat: -------------------------------------------------------------------------------- 1 | C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe TCMqListener.exe -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/IrisSkin2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Excel导出模板工具/IrisSkin2.dll -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/NPOI.OOXML.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Excel导出模板工具/NPOI.OOXML.dll -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Rest/JsonUtils.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Rest/JsonUtils.cs -------------------------------------------------------------------------------- /Lfz.AutoUpdater/autoupdater.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/autoupdater.ico -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/INhRepository.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/Nh/INhRepository.cs -------------------------------------------------------------------------------- /Lfz.Core/Enums/Hr/RightHrType.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Enums/Hr/RightHrType.cs -------------------------------------------------------------------------------- /Lfz.Core/Enums/PermissionType.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Enums/PermissionType.cs -------------------------------------------------------------------------------- /Lfz.Core/Models/KeySearchHit.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Models/KeySearchHit.cs -------------------------------------------------------------------------------- /Lfz.Core/Mq/MqClientConfigInfo.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Mq/MqClientConfigInfo.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/BufferManager.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/BufferManager.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/DataEventArgs.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/DataEventArgs.cs -------------------------------------------------------------------------------- /Lfz.Core/Rest/ResponseContent.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Rest/ResponseContent.cs -------------------------------------------------------------------------------- /Lfz.Core/Rest/RestContentBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Rest/RestContentBase.cs -------------------------------------------------------------------------------- /Lfz.Core/Services/ServiceBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Services/ServiceBase.cs -------------------------------------------------------------------------------- /Lfz.Core/Utitlies/AppUnitity.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Utitlies/AppUnitity.cs -------------------------------------------------------------------------------- /Lfz.Core/WebApi/PagedApiResult.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/WebApi/PagedApiResult.cs -------------------------------------------------------------------------------- /Lfz.MqListener.WindowService/卸载服务.bat: -------------------------------------------------------------------------------- 1 | C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /u TCMqListener.exe -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/ExcelReport.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Excel导出模板工具/ExcelReport.dll -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/NPOI.Extend.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Excel导出模板工具/NPOI.Extend.dll -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/XmlGenerator.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Excel导出模板工具/XmlGenerator.exe -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Logging/ILogger.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Logging/ILogger.cs -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Rest/JsonContent.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Rest/JsonContent.cs -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Rest/RestStatus.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Rest/RestStatus.cs -------------------------------------------------------------------------------- /Lfz.Core/WebApi/ServerApiStatus.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/WebApi/ServerApiStatus.cs -------------------------------------------------------------------------------- /Lfz.MqListener.WindowService/调度.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.WindowService/调度.ico -------------------------------------------------------------------------------- /Lib/Interop.IWshRuntimeLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Interop.IWshRuntimeLibrary.dll -------------------------------------------------------------------------------- /Lib/SharpCompress/SharpCompress.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/SharpCompress/SharpCompress.dll -------------------------------------------------------------------------------- /Lib/WebApiNET4/System.Net.Http.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/WebApiNET4/System.Net.Http.dll -------------------------------------------------------------------------------- /Lib/WebApiNET4/System.Web.Http.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/WebApiNET4/System.Web.Http.dll -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Rest/IJsonContent.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Rest/IJsonContent.cs -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Utitlies/AppUnitity.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Utitlies/AppUnitity.cs -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Utitlies/ZipHelper.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Utitlies/ZipHelper.cs -------------------------------------------------------------------------------- /Lfz.Core/Caching/RedisCacheManager.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Caching/RedisCacheManager.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/MappingConfiguration.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/MappingConfiguration.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Entities/EntityMap.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/Nh/Entities/EntityMap.cs -------------------------------------------------------------------------------- /Lfz.Core/Enums/Hr/ModuleRightsType.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Enums/Hr/ModuleRightsType.cs -------------------------------------------------------------------------------- /Lfz.Core/Models/PageIndexChangedHit.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Models/PageIndexChangedHit.cs -------------------------------------------------------------------------------- /Lfz.Core/Models/PropertyTrackStatus.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Models/PropertyTrackStatus.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/PacketBufferToken.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/PacketBufferToken.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/TcpClientService.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/TcpClientService.cs -------------------------------------------------------------------------------- /Lfz.Core/Rest/HttpContextExtension.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Rest/HttpContextExtension.cs -------------------------------------------------------------------------------- /Lfz.Core/Services/ThreadServiceBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Services/ThreadServiceBase.cs -------------------------------------------------------------------------------- /Lfz.Core/Services/TimeServiceBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Services/TimeServiceBase.cs -------------------------------------------------------------------------------- /Lib/ActiveMQ/Apache.NMS.ActiveMQ.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/ActiveMQ/Apache.NMS.ActiveMQ.dll -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/NPOI.OpenXml4Net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Excel导出模板工具/NPOI.OpenXml4Net.dll -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Rest/ResponseContent.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Rest/ResponseContent.cs -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Rest/RestContentBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Rest/RestContentBase.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/RawSql/BusinessService.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/RawSql/BusinessService.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/TcpListenServiceBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/TcpListenServiceBase.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/UdpListenServiceBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/UdpListenServiceBase.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/UdpReceviceEventArgs.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/UdpReceviceEventArgs.cs -------------------------------------------------------------------------------- /Lfz.Core/Rest/JsonPropertyFilterEnum.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Rest/JsonPropertyFilterEnum.cs -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/NPOI.OpenXmlFormats.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Excel导出模板工具/NPOI.OpenXmlFormats.dll -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/XmlGenerator.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Excel导出模板工具/XmlGenerator.vshost.exe -------------------------------------------------------------------------------- /Lib/NHibernate.4.0.4.4000/NHibernate.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/NHibernate.4.0.4.4000/NHibernate.dll -------------------------------------------------------------------------------- /Lfz.Core/Collections/QueryableExtentsion.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Collections/QueryableExtentsion.cs -------------------------------------------------------------------------------- /Lfz.Core/Config/RunConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | LoggerType: 3, 3 | ApiDomainUrl: "http://api.ziyouchi.com", 4 | EnabledEncrypt: false 5 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/ISessionConfigurationCache.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/ISessionConfigurationCache.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Entities/MetaEntityBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/Nh/Entities/MetaEntityBase.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/RawSql/RawSqlSearchService.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/RawSql/RawSqlSearchService.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/SessionConfigurationCache.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/SessionConfigurationCache.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/HttpListenServiceBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/HttpListenServiceBase.cs -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/ICSharpCode.SharpZipLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/Excel导出模板工具/ICSharpCode.SharpZipLib.dll -------------------------------------------------------------------------------- /Lib/MySql.Data.6.9.8/net40/MySql.Data.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/MySql.Data.6.9.8/net40/MySql.Data.dll -------------------------------------------------------------------------------- /Lib/MySql.Data.6.9.8/net45/MySql.Data.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/MySql.Data.6.9.8/net45/MySql.Data.dll -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Config/RunConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | LoggerType: 3, 3 | ApiDomainUrl: "http://api.ziyouchi.com", 4 | EnabledEncrypt: false 5 | } -------------------------------------------------------------------------------- /Lfz.Core/Models/SearchHitBase.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Models 2 | { 3 | public abstract class SearchHitBase : ISearchHit 4 | { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /Lfz.Core/Network/SocketAsyncEventArgsPool.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/SocketAsyncEventArgsPool.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/UdpSyncListenServiceBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/UdpSyncListenServiceBase.cs -------------------------------------------------------------------------------- /Lfz.Core/Rest/RestContentContractResolver.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Rest/RestContentContractResolver.cs -------------------------------------------------------------------------------- /Lfz.Core/Security/Cryptography/RSACryption.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Security/Cryptography/RSACryption.cs -------------------------------------------------------------------------------- /Lib/WebApiNET4/System.Net.Http.Formatting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/WebApiNET4/System.Net.Http.Formatting.dll -------------------------------------------------------------------------------- /Lib/WebApiNET4/System.Net.Http.WebRequest.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/WebApiNET4/System.Net.Http.WebRequest.dll -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Rest/JsonPropertyFilterEnum.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Rest/JsonPropertyFilterEnum.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/SocketReceivedEventHandler.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/SocketReceivedEventHandler.cs -------------------------------------------------------------------------------- /Lfz.Core/Network/UdpSyncListenReceviceService.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Network/UdpSyncListenReceviceService.cs -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Mq/IMqProducerService.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/Mq/IMqProducerService.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/DefaultDatabaseCacheConfiguration.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/DefaultDatabaseCacheConfiguration.cs -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/App/AppBasicInfo.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/Shared/App/AppBasicInfo.cs -------------------------------------------------------------------------------- /Lib/FluentNHibernate.2.0.3.0/FluentNHibernate.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/FluentNHibernate.2.0.3.0/FluentNHibernate.dll -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Rest/RestContentContractResolver.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.AutoUpdater/Rest/RestContentContractResolver.cs -------------------------------------------------------------------------------- /Lfz.Core/Mq/ActiveMQ/ActiveMQPoolConnectionManager.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Mq/ActiveMQ/ActiveMQPoolConnectionManager.cs -------------------------------------------------------------------------------- /Lib/ServiceStack.Redis.3.9.71/ServiceStack.Common.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/ServiceStack.Redis.3.9.71/ServiceStack.Common.dll -------------------------------------------------------------------------------- /Lib/ServiceStack.Redis.3.9.71/ServiceStack.Redis.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/ServiceStack.Redis.3.9.71/ServiceStack.Redis.dll -------------------------------------------------------------------------------- /Lib/ServiceStack.Redis.3.9.71/ServiceStack.Text.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/ServiceStack.Redis.3.9.71/ServiceStack.Text.dll -------------------------------------------------------------------------------- /Lfz.Core/Data/Conventions/RecordTableNameConvention.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/Conventions/RecordTableNameConvention.cs -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Models/Device/DeviceBasicInfo.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/Models/Device/DeviceBasicInfo.cs -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/Enums/MqListenerStatus.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/Shared/Enums/MqListenerStatus.cs -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/Models/NMSMessageType.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/Shared/Models/NMSMessageType.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Providers/AbstractDataServicesProvider.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/Nh/Providers/AbstractDataServicesProvider.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/Providers/SqlServerDataServicesProvider.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/Providers/SqlServerDataServicesProvider.cs -------------------------------------------------------------------------------- /Lfz.MqListener.Service/CacheShared/RedisConfigService.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/CacheShared/RedisConfigService.cs -------------------------------------------------------------------------------- /Lfz.MqListener.Service/MqVistor/IMqCommandQuqueVistor.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/MqVistor/IMqCommandQuqueVistor.cs -------------------------------------------------------------------------------- /Lib/ServiceStack.Redis.3.9.71/ServiceStack.Interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lib/ServiceStack.Redis.3.9.71/ServiceStack.Interfaces.dll -------------------------------------------------------------------------------- /Lfz.Core/Models/IViewStateSearchHit.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Models 2 | { 3 | public interface IViewStateSearchHit 4 | { 5 | string SearchHitViewState { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Models/ConfigCenter/ConfigCenterMqTable.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/Models/ConfigCenter/ConfigCenterMqTable.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Providers/AbstractDataServicesProvider.partial.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.Core/Data/Nh/Providers/AbstractDataServicesProvider.partial.cs -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Models/ConfigCenter/ConfigCenterMqListener.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/Models/ConfigCenter/ConfigCenterMqListener.cs -------------------------------------------------------------------------------- /Lfz.MqListener.Service/MqVistor/SyncTable/SyncBigDataServiceHelper.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/MqVistor/SyncTable/SyncBigDataServiceHelper.cs -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Lfz.Core/Models/ListItem.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Models 2 | { 3 | public class ListItem 4 | { 5 | public string Text { get; set; } 6 | public object Value { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Models/ConfigCenter/ConfigCenterClusterComputer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/Models/ConfigCenter/ConfigCenterClusterComputer.cs -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Models/ConfigCenter/ConfigCenterRedisCacheKey.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lfz233002072/activemq/HEAD/Lfz.MqListener.Service/Models/ConfigCenter/ConfigCenterRedisCacheKey.cs -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Entities/DefaultMap.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Data.Nh.Entities 2 | { 3 | public abstract class DefaultMap : 4 | EntityMap where T : EntityBase 5 | { 6 | 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Conventions/CascadeAllDeleteOrphanAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lfz.Data.Nh.Conventions { 4 | 5 | public class CascadeAllDeleteOrphanAttribute : Attribute { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Entities/GuidMap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lfz.Data.Nh.Entities 4 | { 5 | public abstract class GuidMap : 6 | EntityMap where T : EntityBase 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Config/IConfigInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.AutoUpdater.Config 2 | { 3 | /// 4 | /// 配置信息基类 5 | /// 6 | internal interface IConfigInfo 7 | { 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Lfz.Core/Caching/IAsyncTokenProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PMSoft.Caching { 4 | public interface IAsyncTokenProvider { 5 | IVolatileToken GetToken(Action> task); 6 | } 7 | } -------------------------------------------------------------------------------- /Lfz.Core/Commands/ICommandResult.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Commands 2 | { 3 | /// 4 | /// CQRS模式中Command的返回结果 5 | /// 6 | public interface ICommandResult 7 | { 8 | 9 | 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Lfz.Core/Enums/Sex.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Enums 2 | { 3 | /// 4 | /// 性别 5 | /// 6 | public enum Sex 7 | { 8 | 男=0, 9 | 女=1, 10 | 11 | } 12 | 13 | #region 部门类别 14 | 15 | #endregion 16 | } 17 | -------------------------------------------------------------------------------- /Lfz.Core/Enums/AsynchronousCallStatus.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Enums 2 | { 3 | /// 4 | /// 5 | /// 6 | public enum AsynchronousCallStatus 7 | { 8 | Default = 0, 9 | 10 | Success = 1, 11 | 12 | Error = -1 13 | } 14 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Providers/IDataServicesProviderFactory.cs: -------------------------------------------------------------------------------- 1 | using Lfz.Data.RawSql; 2 | 3 | namespace Lfz.Data.Nh.Providers { 4 | public interface IDataServicesProviderFactory : IDependency { 5 | IDataServicesProvider CreateProvider(IDbProviderConfig sessionFactoryParameters); 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Lfz.Core/Services/ServiceEventHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Lfz.Services 5 | { 6 | /// 7 | /// 8 | /// 9 | [Serializable] 10 | [ComVisible(true)] 11 | public delegate void ServiceEventHandler(); 12 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/Models/TopicName.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.MqListener.Shared.Models 2 | { 3 | /// 4 | /// 5 | /// 6 | public enum TopicName 7 | { 8 | /// 9 | /// 10 | /// 11 | PushMessage, 12 | } 13 | } -------------------------------------------------------------------------------- /Lfz.MqListener.WindowService/Config/autoupdater.json: -------------------------------------------------------------------------------- 1 | { 2 | Version: "2.0.0.1", 3 | NewVersion: "2.0.0.2", 4 | AppType: 2, 5 | AppName: "拓创客户端程序", 6 | ExcuteFileName: "TCMqListener", 7 | IsWindowService: true, 8 | DownloadUrl: "", 9 | LastUpdateTime: "2012-01-01 12:06:01" 10 | } -------------------------------------------------------------------------------- /Lfz.MqListener/Config/autoupdater.json: -------------------------------------------------------------------------------- 1 | { 2 | Version: "2.0.0.1", 3 | NewVersion: "2.0.0.2", 4 | AppType: 2, 5 | AppName: "拓创客户端程序", 6 | ExcuteFileName: "TCSoft.MqListener.exe", 7 | IsWindowService: false, 8 | DownloadUrl: "", 9 | LastUpdateTime: "2012-01-01 12:06:01" 10 | } -------------------------------------------------------------------------------- /Lfz.Core/Enums/DelFlag.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Enums 2 | { 3 | public enum DelFlag 4 | { 5 | /// 6 | /// 正常 7 | /// 8 | Normal=0, 9 | 10 | /// 11 | /// 已经删除 12 | /// 13 | Deleted=1 14 | 15 | } 16 | } -------------------------------------------------------------------------------- /Lfz.Core/Collections/IPageOfDatatable.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | 3 | namespace Lfz.Collections 4 | { 5 | /// 6 | /// 7 | /// 8 | public interface IPageOfDatatable : IPagerInfo 9 | { 10 | /// 11 | /// 12 | /// 13 | DataTable Data { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/ISessionLocator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NHibernate; 3 | 4 | namespace PMSoft.Data { 5 | /// 6 | /// 7 | /// 8 | public interface ISessionLocator :IDisposable 9 | { 10 | /// 11 | /// 12 | /// 13 | ISession For(Type entityType); 14 | } 15 | } -------------------------------------------------------------------------------- /Lfz.Core/IO/FileSystemSettings.cs: -------------------------------------------------------------------------------- 1 | 2 | using Lfz.Config; 3 | 4 | namespace Lfz.IO 5 | { 6 | /// 7 | /// 文件信息配置信息 8 | /// 9 | public class FileSystemSettings : IConfigInfo 10 | { 11 | /// 12 | /// 13 | /// 14 | public string DirectoryName { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/RawSql/DbProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Data.RawSql 2 | { 3 | /// 4 | /// 5 | /// 6 | public enum DbProvider 7 | { 8 | /// 9 | /// 10 | /// 11 | MySql=0, 12 | 13 | /// 14 | /// 15 | /// 16 | SqlServer=1 17 | } 18 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Config/autoupdater.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2.0.0.1", 3 | "AppType": 2, 4 | "NewVersion": "2.0.0.4", 5 | "AppName": "拓创客户端程序", 6 | "ExcuteFileName": "TCSoft.MqListener.exe", 7 | "IsWindowService": false, 8 | "DownloadUrl": "http://img.ziyouchi.com/Uploads/20160129/9dfad9394de5488193d55d0411d0e2eb.zip", 9 | "LastUpdateTime": "2016-01-29 18:08:11" 10 | } -------------------------------------------------------------------------------- /Lfz.Core/Enums/FuncListen.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Enums 2 | { 3 | /// 4 | /// 5 | /// 6 | public enum FuncListen 7 | { 8 | /// 9 | /// 10 | /// 11 | GetLoginUserId = 0, 12 | 13 | /// 14 | /// 15 | /// 16 | GetVisitPath = 1 17 | } 18 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/IO/FileSystemSettings.cs: -------------------------------------------------------------------------------- 1 | 2 | using Lfz.AutoUpdater.Config; 3 | 4 | namespace Lfz.AutoUpdater.IO 5 | { 6 | /// 7 | /// 文件信息配置信息 8 | /// 9 | internal class FileSystemSettings : IConfigInfo 10 | { 11 | /// 12 | /// 13 | /// 14 | public string DirectoryName { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Providers/IDataServicesProvider.cs: -------------------------------------------------------------------------------- 1 | using FluentNHibernate.Cfg.Db; 2 | using Lfz.Data.RawSql; 3 | 4 | namespace Lfz.Data.Nh.Providers { 5 | public interface IDataServicesProvider { 6 | 7 | NHibernate.Cfg.Configuration BuildConfiguration(IDbProviderConfig config); 8 | 9 | IPersistenceConfigurer GetPersistenceConfigurer(bool createDatabase); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Conventions/StringLengthMaxAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Lfz.Data.Nh.Conventions 4 | { 5 | public class StringLengthMaxAttribute : StringLengthAttribute { 6 | public StringLengthMaxAttribute() : base(10000) { 7 | // 10000 is an arbitrary number large enough to be in the nvarchar(max) range 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Lfz.Core/Config/Parameters.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 192.168.1.138 4 | 5009 5 | 192.168.1.138 6 | 5009 7 | 2 8 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Conventions/AggregateAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lfz.Data.Nh.Conventions { 4 | 5 | /// 6 | /// This attribute is used to mark relationships which need to be eagerly fetched with the parent object, 7 | /// thus defining an aggregate in terms of DDD 8 | /// 9 | public class AggregateAttribute : Attribute { 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Lfz.Core/Data/IDatabaseCacheConfiguration.cs: -------------------------------------------------------------------------------- 1 | using NHibernate.Cfg.Loquacious; 2 | 3 | namespace PMSoft.Data { 4 | /// 5 | /// 6 | /// 7 | public interface IDatabaseCacheConfiguration { 8 | /// 9 | /// 10 | /// 11 | /// 12 | void Configure(ICacheConfigurationProperties cache); 13 | } 14 | } -------------------------------------------------------------------------------- /Lfz.Core/Config/IConfigInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Config 2 | { 3 | /// 4 | /// 配置信息基类 5 | /// 6 | public interface IConfigInfo 7 | { 8 | } 9 | 10 | /// 11 | /// 12 | /// 13 | public interface ISysConfig 14 | { 15 | /// 16 | /// 缓存版本号 17 | /// 18 | int CacheVersion { get; } 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Lfz.Core/Network/CallBackState.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Sockets; 2 | 3 | namespace Lfz.Network 4 | { 5 | internal class CallBackState 6 | { 7 | /// 8 | /// 9 | /// 10 | public TcpClient Client { get; set; } 11 | /// 12 | /// 13 | /// 14 | public NetworkStream NetworkStream { get; set; } 15 | 16 | public byte[] Data; 17 | } 18 | } -------------------------------------------------------------------------------- /Lfz.Core/TcSoftVersion.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Lfz 3 | { 4 | /// 5 | /// 6 | /// 7 | public static class TcSoftVersion 8 | { 9 | /// 10 | /// Gets or sets the store version 11 | /// 12 | public static string CurrentVersion 13 | { 14 | get 15 | { 16 | return "3.0"; 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Lfz.MqListener.Service/MqVistor/SyncTable/ISyncTableComand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using Lfz.Data.RawSql; 5 | 6 | namespace Lfz.MqListener.MqVistor.SyncTable 7 | { 8 | public interface ISyncTableComand:IPerHttpRequestDependency 9 | { 10 | void InsertOrUpdate 11 | (string tablename, Guid storeId, IRawSqlSearchService service, DataTable table, List primaryKey); 12 | } 13 | } -------------------------------------------------------------------------------- /Lfz.Core/Enums/Hr/HrDepartmentType.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Lfz.Enums.Hr 3 | { 4 | /// 5 | /// 部门类别 6 | /// 7 | public enum HrDepartmentType 8 | { 9 | /// 10 | /// 分公司 11 | /// 12 | 分公司 = 1, 13 | /// 14 | /// 部门 15 | /// 16 | 部门 = 4, 17 | /// 18 | /// 组 19 | /// 20 | 组 = 5 21 | } 22 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/NhRepository.partial.cs: -------------------------------------------------------------------------------- 1 | using Lfz.Data.RawSql; 2 | using Lfz.Logging; 3 | 4 | namespace Lfz.Data.Nh 5 | { 6 | public partial class NhRepository : INhRepository where T : class 7 | { 8 | public NhRepository(IDbProviderConfig config) 9 | { 10 | _config = config; 11 | Logger = LoggerFactory.GetLog(); 12 | _sessionFactory = null; //.Current.Resolve(); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Lfz.Core/Config/EncryptContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Serialization; 3 | 4 | namespace Lfz.Config 5 | { 6 | /// 7 | /// 加密内容 8 | /// 9 | [Serializable] 10 | [XmlRoot("EncryptContent")] 11 | public class EncryptContent : IConfigInfo 12 | { 13 | /// 14 | /// 配置内容 15 | /// 16 | [XmlElement(ElementName = "Content")] 17 | public string Content { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Conventions/CascadeAllDeleteOrphanConvention.cs: -------------------------------------------------------------------------------- 1 | using FluentNHibernate.Conventions.Instances; 2 | 3 | namespace Lfz.Data.Nh.Conventions 4 | { 5 | public class CascadeAllDeleteOrphanConvention : 6 | AttributeCollectionConvention { 7 | 8 | protected override void Apply(CascadeAllDeleteOrphanAttribute attribute, ICollectionInstance instance) { 9 | instance.Cascade.AllDeleteOrphan(); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Providers/IDataServicesProviderFactory.cs: -------------------------------------------------------------------------------- 1 | namespace PMSoft.Data.Providers { 2 | /// 3 | /// 4 | /// 5 | public interface IDataServicesProviderFactory { 6 | /// 7 | /// 8 | /// 9 | /// 10 | /// 11 | IDataServicesProvider CreateProvider(DataServiceParameters sessionFactoryParameters); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/Models/QuqueName.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.MqListener.Shared.Models 2 | { 3 | /// 4 | /// 5 | /// 6 | public enum QuqueName 7 | { 8 | /// 9 | /// 10 | /// 11 | BusinessProcessing, 12 | /// 13 | /// 14 | /// 15 | StoreReportData, 16 | /// 17 | /// 18 | /// 19 | ClientHeart, 20 | } 21 | } -------------------------------------------------------------------------------- /Lfz.Core/Config/IConfigFileManager.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Config 2 | { 3 | /// 4 | /// 配置文件管理接口定义 5 | /// 6 | public interface IConfigFileManager 7 | { 8 | /// 9 | /// 加载配置文件 10 | /// 11 | /// 12 | IConfigInfo LoadConfig(); 13 | 14 | 15 | /// 16 | /// 保存配置文件 17 | /// 18 | /// 19 | bool SaveConfig(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Lfz.Core/Models/SearchHit.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Models 2 | { 3 | public class SearchHit : SearchHitBase 4 | { 5 | private string _searchKey; 6 | public string SearchKey 7 | { 8 | get 9 | { 10 | _searchKey = (_searchKey ?? string.Empty).Trim(); 11 | if (_searchKey == "请输入关键字") _searchKey = string.Empty; 12 | return _searchKey; 13 | } 14 | set { _searchKey = value; } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Conventions/StringLengthConvention.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using FluentNHibernate.Conventions; 3 | using FluentNHibernate.Conventions.Instances; 4 | 5 | namespace Lfz.Data.Nh.Conventions { 6 | public class StringLengthConvention : AttributePropertyConvention { 7 | protected override void Apply(StringLengthAttribute attribute, IPropertyInstance instance) { 8 | instance.Length(attribute.MaximumLength); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Lfz.MqListener.WindowService/Program.cs: -------------------------------------------------------------------------------- 1 | using System.ServiceProcess; 2 | 3 | namespace Lfz.MqListener.WindowService 4 | { 5 | static class Program 6 | { 7 | /// 8 | /// 应用程序的主入口点。 9 | /// 10 | static void Main() 11 | { 12 | ServiceBase[] ServicesToRun; 13 | ServicesToRun = new ServiceBase[] 14 | { 15 | new TCMqListener() 16 | }; 17 | ServiceBase.Run(ServicesToRun); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Lfz.Core/Commands/CommandHandlerNotFoundException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lfz.Commands 4 | { 5 | /// 6 | /// 7 | /// 8 | public class CommandHandlerNotFoundException : Exception 9 | { 10 | /// 11 | /// 12 | /// 13 | /// 14 | public CommandHandlerNotFoundException(Type type) : base(string.Format("Command handler not found for command type: {0}", type)) 15 | { 16 | } 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Lfz.MqListener.WindowService/ProjectInstaller.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Configuration.Install; 3 | 4 | namespace Lfz.MqListener.WindowService 5 | { 6 | [RunInstaller(true)] 7 | public partial class ProjectInstaller : System.Configuration.Install.Installer 8 | { 9 | public ProjectInstaller() 10 | { 11 | InitializeComponent(); 12 | } 13 | 14 | private void TCMqListener_AfterInstall(object sender, InstallEventArgs e) 15 | { 16 | 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Providers/SessionFactoryParameters.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace PMSoft.Data.Providers { 4 | /// 5 | /// 6 | /// 7 | public class SessionFactoryParameters : DataServiceParameters { 8 | /// 9 | /// 10 | /// 11 | public IEnumerable RecordDescriptors { get; set; } 12 | /// 13 | /// 14 | /// 15 | public bool CreateDatabase { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Lib/Excel导出模板工具/XmlGenerator.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Lfz.Core/Caching/Weak.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PMSoft.Caching { 4 | public class Weak { 5 | private readonly WeakReference _target; 6 | 7 | public Weak(T target) { 8 | _target = new WeakReference(target); 9 | } 10 | 11 | public Weak(T target, bool trackResurrection) { 12 | _target = new WeakReference(target, trackResurrection); 13 | } 14 | 15 | public T Target { 16 | get { return (T)_target.Target; } 17 | set { _target.Target = value; } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Lfz.Core/Commands/ValidationHandlerNotFoundException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lfz.Commands 4 | { 5 | /// 6 | /// 7 | /// 8 | public class ValidationHandlerNotFoundException : Exception 9 | { 10 | /// 11 | /// 12 | /// 13 | /// 14 | public ValidationHandlerNotFoundException(Type type) 15 | : base(string.Format("Validation handler not found for command type: {0}", type)) 16 | { 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Lfz.Core/Commands/DefaultCommandResult.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Commands 2 | { 3 | /// 4 | /// 5 | /// 6 | public class DefaultCommandResult : ICommandResult 7 | { 8 | /// 9 | /// 10 | /// 11 | /// 12 | public DefaultCommandResult(bool success) 13 | { 14 | this.Success = success; 15 | } 16 | 17 | /// 18 | /// 19 | /// 20 | public bool Success { get; private set; } 21 | } 22 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/KeyValueEntity.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace Lfz.Data 4 | { 5 | /// 6 | /// 键值数据实体 7 | /// 8 | [DataContract] 9 | public abstract class KeyValueEntity : EntityBase 10 | { 11 | /// 12 | /// 参数键 13 | /// 14 | [DataMember] 15 | public virtual string Key { get; set; } 16 | 17 | /// 18 | /// 参数键值 19 | /// 20 | [DataMember] 21 | public virtual string Value { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /Lfz.Core/Commands/IValidationHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Lfz.Validation; 3 | 4 | namespace Lfz.Commands 5 | { 6 | /// 7 | /// 8 | /// 9 | /// 10 | public interface IValidationHandler 11 | { 12 | /// 13 | /// 命令验证 14 | /// 15 | /// 16 | /// 17 | IEnumerable Validate(TCommand command); 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Infrastructure/BaseDataProviderManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using PMSoft.Config; 3 | 4 | namespace PMSoft.Data.Infrastructure 5 | { 6 | public abstract class BaseDataProviderManager 7 | { 8 | protected BaseDataProviderManager(DataSettings settings) 9 | { 10 | if (settings == null) 11 | throw new ArgumentNullException("settings"); 12 | this.Settings = settings; 13 | } 14 | protected DataSettings Settings { get; private set; } 15 | public abstract IDataProvider LoadDataProvider(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Lfz.Core/Redis/IRedisConfigService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Lfz.Redis 4 | { 5 | /// 6 | /// 7 | /// 8 | public interface IRedisConfigService : ISingletonDependency 9 | { 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | RedisConfig Get(string key); 16 | 17 | /// 18 | /// 19 | /// 20 | /// 21 | IEnumerable GetAll(); 22 | 23 | } 24 | } -------------------------------------------------------------------------------- /Lfz.Core/Enums/Hr/RightValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lfz.Enums.Hr 4 | { 5 | /// 6 | /// Ȩ��ֵ 7 | /// 8 | [Flags] 9 | public enum RightValue 10 | { 11 | None = 0, 12 | V1 = 1, 13 | V2 = 2, 14 | V4 = 4, 15 | V8 = 8, 16 | V16 = 16, 17 | V32 = 32, 18 | V64 = 64, 19 | V128 = 128, 20 | V256 = 256, 21 | V512 = 512, 22 | V1024 = 1024, 23 | V2048 = 2048, 24 | V4096 = 4096, 25 | V8192 = 8192, 26 | V16384 = 16384, 27 | V32768 = 32768 28 | } 29 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 高性能消息监控无服务器,使用ActiveMQ消息中间件实现,包括windows服务、控制台启动等多种启动方式 2 | 3 | ### 实现功能 4 | 5 | 1、消息订阅与发布 6 | 2、消息集群管理 7 | 3、Redis缓存管理 8 | 4、自动更新实现 9 | 5、在线客户端登记、查看 10 | 11 | 12 | ### 使用技术 13 | 14 | 1、activemq (Apache.NMS.ActiveMQ 1.7) 15 | 2、redis (ServiceStack.Redis 3.9) 16 | 3、Nlog 3.1 17 | 4、SharpCompress 1.2 18 | 5、Json.NET 6.0 19 | 6、NHibernate 4.0 20 | 21 | 22 | 使用Vistor模式处理客户端与服务器业务处理,消息以封装未不同的命令 23 | 24 | 25 | [github地址:https://github.com/lfz233002072/activemq](https://github.com/lfz233002072/activemq) 26 | 27 | [oschina地址:https://git.oschina.net/lfz/activemq](https://git.oschina.net/lfz/activemq) -------------------------------------------------------------------------------- /Lfz.Core/Data/RawSql/DbProviderConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lfz.Data.RawSql 4 | { 5 | /// 6 | /// 7 | /// 8 | public class DbProviderConfig : IDbProviderConfig 9 | { 10 | /// 11 | /// 12 | /// 13 | public virtual DbProvider DbProvider { get; set; } 14 | 15 | public Guid CustomerId { get; set; } 16 | 17 | public string DataFolder { get; set; } 18 | /// 19 | /// 数据库连接字符串 20 | /// 21 | public virtual string DbConnectionString { get; set; } 22 | 23 | } 24 | } -------------------------------------------------------------------------------- /Lfz.Core/Rest/RestContentBaseExtenstion.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Lfz.Rest 4 | { 5 | /// 6 | /// 7 | /// 8 | public static class JsonContentExtenstion 9 | { 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | public static string ToJsonString(this IJsonContent content, params JsonConverter[] converters) 17 | { 18 | return JsonUtils.SerializeObject(content, converters); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Rest/RestContentBaseExtenstion.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Lfz.AutoUpdater.Rest 4 | { 5 | /// 6 | /// 7 | /// 8 | internal static class JsonContentExtenstion 9 | { 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | public static string ToJsonString(this IJsonContent content, params JsonConverter[] converters) 17 | { 18 | return JsonUtils.SerializeObject(content, converters); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Lfz.Core/Network/TcpClientAsyncService.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :TcpClientAsyncService.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2015-05-30 11:39 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | namespace Lfz.Network 14 | { 15 | /// 16 | /// 17 | /// 18 | public class TcpClientAsyncService 19 | { 20 | 21 | } 22 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/Enums/CacheVersionType.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.MqListener.Shared.Enums 2 | { 3 | /// 4 | /// 5 | /// 6 | public enum CacheVersionType 7 | { 8 | /// 9 | /// 默认缓存版本(全局范围内只有一条记录) 10 | /// 11 | Default=0, 12 | 13 | /// 14 | /// 商家相关缓存版本(每个商家一条记录) 15 | /// 16 | Customer = 1, 17 | 18 | /// 19 | /// 门店相关缓存版本(每个门店一条记录) 20 | /// 21 | StoreInfo = 2, 22 | 23 | /// 24 | /// 用户相关缓存版本(每个用户一条记录) 25 | /// 26 | User=3 27 | } 28 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Infrastructure/IEfDataProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity.Infrastructure; 2 | 3 | namespace PMSoft.Data.Infrastructure 4 | { 5 | public interface IEfDataProvider: IDataProvider 6 | { 7 | /// 8 | /// Get connection factory 9 | /// 10 | /// Connection factory 11 | IDbConnectionFactory GetConnectionFactory(); 12 | 13 | /// 14 | /// Initialize connection factory 15 | /// 16 | void InitConnectionFactory(); 17 | 18 | /// 19 | /// Set database initializer 20 | /// 21 | void SetDatabaseInitializer(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Lfz.Core/Services/IInstallService.cs: -------------------------------------------------------------------------------- 1 | 2 | /*====================================================================== 3 | * 4 | * Copyright (C) 1996-2012 杭州品茗信息有限公司 5 | * All rights reserved 6 | * 7 | * Filename :InstallService.cs 8 | * DESCRIPTION : 9 | * 10 | * Created By 林芳崽 at 2013-05-08 14:41 11 | * http://www.pinming.cn/ 12 | * 13 | *======================================================================*/ 14 | using System; 15 | using System.Collections.Generic; 16 | using System.Linq; 17 | using System.Text; 18 | 19 | namespace PMSoft.Services 20 | { 21 | public interface IInstallService 22 | { 23 | //安装数据库 24 | bool Install(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Providers/DataServiceParameters.cs: -------------------------------------------------------------------------------- 1 | namespace PMSoft.Data.Providers { 2 | /// 3 | /// 数据服务参数 4 | /// 5 | public class DataServiceParameters { 6 | /// 7 | /// 数据库提供者(Sqlserver、MYsql、Sqlce等) 8 | /// 9 | public string Provider { get; set; } 10 | /// 11 | /// 数据文件夹 12 | /// 13 | public string DataFolder { get; set; } 14 | /// 15 | /// 数据表前缀 16 | /// 17 | public string TablePrefix { get; set; } 18 | /// 19 | /// 连接字符串 20 | /// 21 | public string ConnectionString { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /Lfz.Core/Enums/TreeLevel.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Enums 2 | { 3 | /// 4 | /// 树的层级(从1开始计算) 5 | /// 6 | public enum TreeLevel 7 | { 8 | /// 9 | /// 10 | /// 11 | One = 1, 12 | /// 13 | /// 14 | /// 15 | Two = 2, 16 | /// 17 | /// 18 | /// 19 | Three = 3, 20 | /// 21 | /// 22 | /// 23 | Four = 4, 24 | /// 25 | /// 26 | /// 27 | Five = 5, 28 | 29 | /// 30 | /// 默认层级为一级 31 | /// 32 | Default = One 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/INhTypeProvider.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :INhTypeProvider.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-14 10:12 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using System; 15 | using System.Collections.Generic; 16 | 17 | namespace Lfz.Data.Nh 18 | { 19 | /// 20 | /// 21 | /// 22 | public interface INhTypeProvider:ISingletonDependency 23 | { 24 | IEnumerable GetTypes(); 25 | } 26 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Providers/IDataServicesProvider.cs: -------------------------------------------------------------------------------- 1 | using FluentNHibernate.Cfg.Db; 2 | using NHibernate.Cfg; 3 | 4 | namespace PMSoft.Data.Providers { 5 | /// 6 | /// 7 | /// 8 | public interface IDataServicesProvider { 9 | /// 10 | /// 11 | /// 12 | /// 13 | /// 14 | Configuration BuildConfiguration(SessionFactoryParameters sessionFactoryParameters); 15 | /// 16 | /// 17 | /// 18 | /// 19 | /// 20 | IPersistenceConfigurer GetPersistenceConfigurer(bool createDatabase); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Conventions/CacheConvention.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using FluentNHibernate.Conventions; 4 | using FluentNHibernate.Conventions.AcceptanceCriteria; 5 | using FluentNHibernate.Conventions.Inspections; 6 | using FluentNHibernate.Conventions.Instances; 7 | 8 | namespace Lfz.Data.Nh.Conventions { 9 | public class CacheConvention : IClassConvention, IConventionAcceptance { 10 | 11 | public CacheConvention(IEnumerable types) 12 | { 13 | 14 | } 15 | 16 | public void Apply(IClassInstance instance) { 17 | instance.Cache.ReadWrite(); 18 | } 19 | 20 | public void Accept(IAcceptanceCriteria criteria) { 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Lfz.MqListener.WindowService/Service1.cs: -------------------------------------------------------------------------------- 1 | using System.ServiceProcess; 2 | using Lfz.AutoUpdater; 3 | using Lfz.MqListener.CacheShared; 4 | using Lfz.Redis; 5 | 6 | namespace Lfz.MqListener.WindowService 7 | { 8 | public partial class TCMqListener : ServiceBase 9 | { 10 | public TCMqListener() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | protected override void OnStart(string[] args) 16 | { 17 | CommonUnitity.Init(true,this.ServiceName); 18 | RedisBase.Initialize(new RedisConfigService()); 19 | TCSoftServiceBus.Current.Start(); 20 | } 21 | 22 | protected override void OnStop() 23 | { 24 | TCSoftServiceBus.Current.Stop(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Lfz.Core/Utitlies/Utils.Regex.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace Lfz.Utitlies 5 | { 6 | public partial class Utils 7 | { 8 | /// 9 | /// 使用正则查找,并安装replaceAction委托执行替换。 10 | /// 11 | /// 正则表达式 12 | /// 输入文本 13 | /// 替换行为委托。包括一个参数:匹配结果对象 14 | /// 15 | public static void ReplaceByRegexAction(string pattern, string inputText, Action replaceAction) 16 | { 17 | MatchCollection mcList = new Regex(pattern).Matches(inputText); 18 | foreach (Match ma in mcList) if (replaceAction != null) replaceAction.Invoke(ma); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Utitlies/Utils.Regex.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace Lfz.AutoUpdater.Utitlies 5 | { 6 | internal partial class Utils 7 | { 8 | /// 9 | /// 使用正则查找,并安装replaceAction委托执行替换。 10 | /// 11 | /// 正则表达式 12 | /// 输入文本 13 | /// 替换行为委托。包括一个参数:匹配结果对象 14 | /// 15 | public static void ReplaceByRegexAction(string pattern, string inputText, Action replaceAction) 16 | { 17 | MatchCollection mcList = new Regex(pattern).Matches(inputText); 18 | foreach (Match ma in mcList) if (replaceAction != null) replaceAction.Invoke(ma); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Config/AppSettingsHelperExtension.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :AppSettingsHelperExtension.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-27 13:25 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using Lfz.Config; 15 | 16 | namespace Lfz.MqListener.Config 17 | { 18 | public static class AppSettingsHelperExtension 19 | { 20 | public static string GetDomainAddress(this AppSettingsHelper helper) 21 | { 22 | return string.Empty; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Logging/LogLevel.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.AutoUpdater.Logging 2 | { 3 | /// 4 | /// 日志等级 Fatal > Error > Warning> Information > Debug > Trace 5 | /// 6 | internal enum LogLevel 7 | { 8 | /// 9 | /// 跟踪信息 10 | /// 11 | Trace, 12 | 13 | /// 14 | /// 调试 15 | /// 16 | Debug, 17 | /// 18 | /// 信息 19 | /// 20 | Information, 21 | /// 22 | /// 警报 23 | /// 24 | Warning, 25 | /// 26 | /// 错误 27 | /// 28 | Error, 29 | /// 30 | /// 致命错误 31 | /// 32 | Fatal, 33 | } 34 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Infrastructure/IDataProvider.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Data.Common; 3 | 4 | namespace PMSoft.Data.Infrastructure 5 | { 6 | /// 7 | /// Data provider interface 8 | /// 9 | public interface IDataProvider 10 | { 11 | /// 12 | /// Initialize database 13 | /// 14 | void InitDatabase(); 15 | 16 | /// 17 | /// A value indicating whether this data provider supports stored procedures 18 | /// 19 | bool StoredProceduredSupported { get; } 20 | 21 | /// 22 | /// Gets a support database parameter object (used by stored procedures) 23 | /// 24 | /// Parameter 25 | DbParameter GetParameter(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Conventions/CascadeAllDeleteOrphanAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using FluentNHibernate.Conventions.Instances; 3 | 4 | namespace PMSoft.Data.Conventions { 5 | 6 | /// 7 | /// 8 | /// 9 | public class CascadeAllDeleteOrphanAttribute : Attribute { 10 | } 11 | 12 | /// 13 | /// 14 | /// 15 | public class CascadeAllDeleteOrphanConvention : 16 | AttributeCollectionConvention { 17 | /// 18 | /// 19 | /// 20 | /// 21 | /// 22 | protected override void Apply(CascadeAllDeleteOrphanAttribute attribute, ICollectionInstance instance) { 23 | instance.Cascade.AllDeleteOrphan(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Lfz.Core/Data/DescriptionAttribute.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 杭州品茗信息有限公司 4 | * All rights reserved 5 | * 6 | * Filename :DescriptionAttribute.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2013-05-16 14:11 10 | * http://www.pinming.cn/ 11 | * 12 | *======================================================================*/ 13 | 14 | using System; 15 | 16 | namespace PMSoft.Data 17 | { 18 | [AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)] 19 | public class DescriptionAttribute : Attribute 20 | { 21 | public DescriptionAttribute(string description) 22 | { 23 | Description = description; 24 | } 25 | public string Description { get; set; } 26 | } 27 | 28 | 29 | } -------------------------------------------------------------------------------- /Lfz.Core/Commands/ICommandBus.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Lfz.Validation; 3 | 4 | namespace Lfz.Commands 5 | { 6 | /// 7 | /// 工作单元唯一的 8 | /// 9 | public interface ICommandBus where TResult : ICommandResult 10 | { 11 | /// 12 | /// 命令提交 13 | /// 14 | /// 15 | /// 16 | /// 17 | TResult Submit(TCommand command) ; 18 | 19 | /// 20 | /// 命令验证 21 | /// 22 | /// 23 | /// 24 | /// 25 | IEnumerable Validate(TCommand command) ; 26 | 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Lfz.Core/Collections/IPageOfItems.cs: -------------------------------------------------------------------------------- 1 | //====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename : CacheHelper 7 | // DESCRIPTION : 缓存辅助类 8 | // 9 | // Created By 林芳崽 at 2013-01-08 09:11:01 10 | // https://git.oschina.net/lfz 11 | // 12 | //====================================================================== 13 | 14 | using System.Collections.Generic; 15 | 16 | namespace Lfz.Collections 17 | { 18 | /// 19 | /// 分页数据列表 20 | /// 21 | /// 22 | public interface IPageOfItems : IList, IPagerInfo 23 | { 24 | /// 25 | /// 查询页面状态数据 26 | /// TODO 需要从但前页面移除 27 | /// 28 | string SearchHitViewState { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Lfz.Core/Collections/PageOfItemsExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace Lfz.Collections 4 | { 5 | public static class PageOfItemsExtension 6 | { 7 | /// 8 | /// 9 | /// 10 | /// 11 | /// 12 | /// 13 | public static IPageOfItems ToObjectsPageOfItems(this IPageOfItems pageOfItems) 14 | { 15 | var result = new PageOfItems(pageOfItems.Select(x => x as object)) 16 | { 17 | PageIndex = pageOfItems.PageIndex, 18 | PageSize = pageOfItems.PageSize, 19 | TotalItemCount = pageOfItems.TotalItemCount, 20 | SearchHitViewState = pageOfItems.SearchHitViewState 21 | }; 22 | return result; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Lfz.Core/Collections/IPagerInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Collections 2 | { 3 | /// 4 | /// 分页基本信息 5 | /// 6 | public interface IPagerInfo 7 | { 8 | /// 9 | /// 页码 页码序号从0开始 10 | /// 11 | int PageIndex { get; set; } 12 | 13 | /// 14 | /// 页面大小 15 | /// 16 | int PageSize { get; set; } 17 | /// 18 | /// 总记录数量[大于0的数字] 19 | /// 20 | int TotalItemCount { get; set; } 21 | /// 22 | /// 总页数[最少有一页,哪怕是没有记录,也会显示一页] 23 | /// 24 | int TotalPageCount { get; } 25 | /// 26 | /// 从0开始计数 27 | /// 28 | int StartIndex { get; } 29 | /// 30 | /// 最后条数 取值范围从0到TotalItemCount-1 31 | /// 32 | int EndIndex { get; } 33 | } 34 | } -------------------------------------------------------------------------------- /Lfz.Core/IO/IStorageFolder.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | 4 | namespace Lfz.IO 5 | { 6 | /// 7 | /// 文件夹信息 8 | /// 9 | public interface IStorageFolder 10 | { 11 | /// 12 | /// 路径 13 | /// 14 | /// 15 | string GetPath(); 16 | /// 17 | /// 文件夹名称 18 | /// 19 | /// 20 | string GetName(); 21 | /// 22 | /// 非隐藏文件数量 23 | /// 24 | /// 25 | long GetSize(); 26 | /// 27 | /// 最近修改时间 28 | /// 29 | /// 30 | DateTime GetLastUpdated(); 31 | /// 32 | /// 上级文件夹信息 33 | /// 34 | /// 35 | IStorageFolder GetParent(); 36 | } 37 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/IO/IStorageFolder.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | 4 | namespace Lfz.AutoUpdater.IO 5 | { 6 | /// 7 | /// 文件夹信息 8 | /// 9 | internal interface IStorageFolder 10 | { 11 | /// 12 | /// 路径 13 | /// 14 | /// 15 | string GetPath(); 16 | /// 17 | /// 文件夹名称 18 | /// 19 | /// 20 | string GetName(); 21 | /// 22 | /// 非隐藏文件数量 23 | /// 24 | /// 25 | long GetSize(); 26 | /// 27 | /// 最近修改时间 28 | /// 29 | /// 30 | DateTime GetLastUpdated(); 31 | /// 32 | /// 上级文件夹信息 33 | /// 34 | /// 35 | IStorageFolder GetParent(); 36 | } 37 | } -------------------------------------------------------------------------------- /Lfz.Core/Enums/BindingMoblieStatus.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :BindingMoblieStatus.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2015-05-18 16:30 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | namespace Lfz.Enums 14 | { 15 | /// 16 | /// 绑定手机号码状态 0 未绑定 1 绑定申请 2 绑定成功 17 | /// 18 | public enum BindingMoblieStatus 19 | { 20 | /// 21 | /// 为绑定 22 | /// 23 | None=0, 24 | 25 | /// 26 | /// 等待绑定中 27 | /// 28 | WaitBinding=1, 29 | 30 | /// 31 | /// 已经绑定 32 | /// 33 | HasBinding=2 34 | } 35 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/RawSql/TemplateColumnDataType.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :TemplateColumnDataType.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-05 15:56 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | namespace Lfz.Data.RawSql 14 | { 15 | /// 16 | /// 17 | /// 18 | public enum TemplateColumnDataType 19 | { 20 | [CustomDescription("整数")] 21 | TemplateInt, 22 | [CustomDescription("字符串")] 23 | TemplateString, 24 | [CustomDescription("时间")] 25 | TemplateDatetime, 26 | [CustomDescription("数字")] 27 | TemplateDecimal, 28 | [CustomDescription("文本")] 29 | TemplateText 30 | } 31 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.Objects; 3 | 4 | namespace PMSoft.Data 5 | { 6 | public static class Extensions 7 | { 8 | /// 9 | /// Get unproxied entity type 10 | /// 11 | /// If your Entity Framework context is proxy-enabled, 12 | /// the runtime will create a proxy instance of your entities, 13 | /// i.e. a dynamically generated class which inherits from your entity class 14 | /// and overrides its virtual properties by inserting specific code useful for example 15 | /// for tracking changes and lazy loading. 16 | /// 17 | /// 18 | /// 19 | public static Type GetUnproxiedEntityType(this EntityBase entity) 20 | { 21 | var userType = ObjectContext.GetObjectType(entity.GetType()); 22 | return userType; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Lfz.Core/Logging/NullLogger.cs: -------------------------------------------------------------------------------- 1 | //====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename : NullLogger 7 | // DESCRIPTION : 日志类型 8 | // 9 | // Created By 林芳崽 at 2013-01-04 09:11:01 10 | // https://git.oschina.net/lfz 11 | // 12 | //====================================================================== 13 | 14 | using System; 15 | 16 | namespace Lfz.Logging 17 | { 18 | /// 19 | /// 空日志 20 | /// 21 | public class NullLogger : LoggerBase 22 | { 23 | /// 24 | /// 空日志 25 | /// 26 | /// 27 | /// 28 | /// 29 | public override void Log(LogLevel level, string message, Exception exception) 30 | { 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Infrastructure/EfDataProviderManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using PMSoft.Config; 3 | 4 | namespace PMSoft.Data.Infrastructure 5 | { 6 | public partial class EfDataProviderManager : BaseDataProviderManager 7 | { 8 | public EfDataProviderManager(DataSettings settings):base(settings) 9 | { 10 | } 11 | 12 | public override IDataProvider LoadDataProvider() 13 | { 14 | 15 | var providerName = Settings.DataProvider; 16 | if (String.IsNullOrWhiteSpace(providerName)) 17 | throw new Exception("Data Settings doesn't contain a providerName"); 18 | 19 | switch (providerName.ToLowerInvariant()) 20 | { 21 | case "sqlserver": 22 | return new SqlServerDataProvider(); 23 | default: 24 | throw new Exception(string.Format("Not supported dataprovider name: {0}", providerName)); 25 | } 26 | } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Logging/NullLogger.cs: -------------------------------------------------------------------------------- 1 | //====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename : NullLogger 7 | // DESCRIPTION : 日志类型 8 | // 9 | // Created By 林芳崽 at 2013-01-04 09:11:01 10 | // https://git.oschina.net/lfz 11 | // 12 | //====================================================================== 13 | 14 | using System; 15 | 16 | namespace Lfz.AutoUpdater.Logging 17 | { 18 | /// 19 | /// 空日志 20 | /// 21 | internal class NullLogger : LoggerBase 22 | { 23 | /// 24 | /// 空日志 25 | /// 26 | /// 27 | /// 28 | /// 29 | public override void Log(LogLevel level, string message, Exception exception) 30 | { 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Lfz.Core/Data/RawSql/TemplateDataSourceType.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Data.RawSql 2 | { 3 | public enum TemplateDataSourceType 4 | { 5 | [CustomDescription("Sql查询")] 6 | SqlClause, 7 | 8 | [CustomDescription("枚举类型")] 9 | EnumType, 10 | 11 | /// 12 | /// 派送自定接口的类型解析 13 | /// 14 | [CustomDescription("Api接口")] 15 | Api, 16 | 17 | /// 18 | /// 派送自定接口的类型解析 19 | /// 20 | [CustomDescription("门店查询")] 21 | StoreInfo, 22 | 23 | /// 24 | /// 派送自定接口的类型解析 25 | /// 26 | [CustomDescription("支付方式")] 27 | PayMode, 28 | 29 | /// 30 | /// 使用,分割多种类型 31 | /// 32 | [CustomDescription("字符串列表")] 33 | StringList, 34 | 35 | /// 36 | /// 37 | /// 38 | [CustomDescription("字符串")] 39 | String , 40 | } 41 | } -------------------------------------------------------------------------------- /Lfz.Core/Logging/LoggerType.cs: -------------------------------------------------------------------------------- 1 | //====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename : LoggerType 7 | // DESCRIPTION : 日志类型,日志等级 8 | // 9 | // Created By 林芳崽 at 2013-01-04 09:11:01 10 | // https://git.oschina.net/lfz 11 | // 12 | //====================================================================== 13 | namespace Lfz.Logging 14 | { 15 | /// 16 | /// 日志类型 17 | /// 18 | public enum LoggerType 19 | { 20 | /// 21 | /// 空日志 22 | /// 23 | NullLog = 0, 24 | /// 25 | /// 控制台日志 26 | /// 27 | ConsoleLog = 1, 28 | /// 29 | /// Log4Net日志 30 | /// 31 | Log4Net = 2, 32 | /// 33 | /// NLog日志 34 | /// 35 | NLog = 3, 36 | } 37 | } -------------------------------------------------------------------------------- /Lfz.Core/Logging/LogLevel.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Logging 2 | { 3 | /// 4 | /// 日志等级 Fatal > Error > Warning> Information > Debug > Trace 5 | /// 6 | public enum LogLevel 7 | { 8 | /// 9 | /// 跟踪信息 10 | /// 11 | [CustomDescription("跟踪")] 12 | Trace, 13 | 14 | /// 15 | /// 调试 16 | /// 17 | [CustomDescription("调试")] 18 | Debug, 19 | /// 20 | /// 信息 21 | /// 22 | [CustomDescription("提示")] 23 | Information, 24 | /// 25 | /// 警报 26 | /// 27 | [CustomDescription("警报")] 28 | Warning, 29 | /// 30 | /// 错误 31 | /// 32 | [CustomDescription("错误")] 33 | Error, 34 | /// 35 | /// 致命错误 36 | /// 37 | [CustomDescription("致命")] 38 | Fatal, 39 | } 40 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Providers/DataServicesProviderFactory.cs: -------------------------------------------------------------------------------- 1 | using Lfz.Data.RawSql; 2 | 3 | namespace Lfz.Data.Nh.Providers { 4 | 5 | 6 | public class DataServicesProviderFactory : IDataServicesProviderFactory { 7 | 8 | 9 | public IDataServicesProvider CreateProvider(IDbProviderConfig parameters) 10 | { 11 | var providerName = parameters.DbProvider.ToString(); 12 | if(parameters.DbProvider==DbProvider.MySql) 13 | return new MySqlDataServicesProvider(parameters.DataFolder, parameters.DbConnectionString); 14 | else if(parameters.DbProvider==DbProvider.SqlServer) 15 | return new SqlServerDataServicesProvider(parameters.DataFolder, parameters.DbConnectionString); 16 | if (providerName == "SqlCe") 17 | { 18 | return new SqlCeDataServicesProvider(parameters.DataFolder, parameters.DbConnectionString); 19 | } 20 | return null; 21 | } 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Lfz.Core/Services/StringEventArgs.cs: -------------------------------------------------------------------------------- 1 | //====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename : StringEventArgs 7 | // DESCRIPTION : 包含字符串内容的事件参数 8 | // 9 | // Created By 林芳崽 at 2013-01-08 09:11:01 10 | // https://git.oschina.net/lfz 11 | // 12 | //====================================================================== 13 | 14 | using System; 15 | 16 | namespace Lfz.Services 17 | { 18 | /// 19 | /// 包含字符串内容的事件参数 20 | /// 21 | public class StringEventArgs : EventArgs 22 | { 23 | /// 24 | /// 25 | /// 26 | /// 27 | public StringEventArgs(string str) 28 | { 29 | Content = str; 30 | } 31 | 32 | /// 33 | /// 内容 34 | /// 35 | public string Content { get; set; } 36 | } 37 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Logging/LoggerType.cs: -------------------------------------------------------------------------------- 1 | //====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename : LoggerType 7 | // DESCRIPTION : 日志类型,日志等级 8 | // 9 | // Created By 林芳崽 at 2013-01-04 09:11:01 10 | // https://git.oschina.net/lfz 11 | // 12 | //====================================================================== 13 | namespace Lfz.AutoUpdater.Logging 14 | { 15 | /// 16 | /// 日志类型 17 | /// 18 | internal enum LoggerType 19 | { 20 | /// 21 | /// 空日志 22 | /// 23 | NullLog = 0, 24 | /// 25 | /// 控制台日志 26 | /// 27 | ConsoleLog = 1, 28 | /// 29 | /// Log4Net日志 30 | /// 31 | Log4Net = 2, 32 | /// 33 | /// NLog日志 34 | /// 35 | NLog = 3, 36 | } 37 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/MqVistor/IMqCommandTopicVistor.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :IMqCommandVistor.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-20 17:17 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using Lfz.MqListener.Mq; 15 | using Lfz.MqListener.Shared.Models; 16 | 17 | namespace Lfz.MqListener.MqVistor 18 | { 19 | /// 20 | /// 单例模式命令访问器 21 | /// 22 | public interface IMqCommandTopicVistor : ISingletonDependency 23 | { 24 | /// 25 | /// 主题处理程序 26 | /// 27 | /// 28 | /// 29 | void Vistor(TopicName topicName, MqCommandInfo commandInfo); 30 | } 31 | } -------------------------------------------------------------------------------- /Lfz.Core/Security/AuthorizationManager.cs: -------------------------------------------------------------------------------- 1 | using System.Security.Principal; 2 | using System.ServiceModel; 3 | using System.ServiceModel.Channels; 4 | 5 | namespace Lfz.Security 6 | { 7 | /// 8 | /// 身份认证管理器 9 | /// 10 | public class AuthorizationManager : ServiceAuthorizationManager 11 | { 12 | /// 13 | /// 14 | /// 15 | /// 16 | /// 17 | /// 18 | public override bool CheckAccess(OperationContext operationContext, ref Message message) 19 | { 20 | //此模式并不提供消息的完整性和保密性,而是仅提供基于 HTTP 的客户端身份验证。 21 | return base.CheckAccess(operationContext, ref message); 22 | } 23 | 24 | private IPrincipal GetPrincipal(OperationContext operationContext) 25 | { 26 | return operationContext.ServiceSecurityContext.AuthorizationContext.Properties["Principal"] as IPrincipal; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Lfz.Core/Enums/AttachmentType.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 lfz 4 | * All rights reserved 5 | * 6 | * Filename :AttachmentType.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2014-04-04 10:57 10 | * https://git.oschina.net/lfz 11 | * 12 | *======================================================================*/ 13 | namespace Lfz.Enums 14 | { 15 | 16 | 17 | /// 18 | /// 附件类型 19 | /// 20 | public enum AttachmentType 21 | { 22 | /// 23 | /// 文档=401 24 | /// 25 | Documents = 401, 26 | 27 | /// 28 | /// 店铺Logo 29 | /// 30 | ShopLogo = 402, 31 | 32 | /// 33 | /// 图片 34 | /// 35 | Images = 403, 36 | 37 | /// 38 | /// 图片 39 | /// 40 | WxNewsImages = 404, 41 | } 42 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Conventions/AttributeCollectionConvention.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using FluentNHibernate.Conventions; 3 | using FluentNHibernate.Conventions.AcceptanceCriteria; 4 | using FluentNHibernate.Conventions.Inspections; 5 | using FluentNHibernate.Conventions.Instances; 6 | 7 | namespace Lfz.Data.Nh.Conventions { 8 | public abstract class AttributeCollectionConvention : ICollectionConvention, ICollectionConventionAcceptance where T : Attribute { 9 | public void Accept(IAcceptanceCriteria criteria) { 10 | criteria.Expect(inspector => GetAttribute(inspector) != null); 11 | } 12 | 13 | public void Apply(ICollectionInstance instance) { 14 | Apply(GetAttribute(instance), instance); 15 | } 16 | 17 | protected abstract void Apply(T attribute, ICollectionInstance instance); 18 | 19 | private static T GetAttribute(ICollectionInspector inspector) { 20 | return Attribute.GetCustomAttribute(inspector.Member, typeof(T)) as T; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Lfz.Core/Enums/UserDataStatus.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Enums 2 | { 3 | /// 4 | /// 系统用户状态 5 | /// 6 | public enum UserDataStatus 7 | { 8 | 9 | /// 10 | /// 正常 11 | /// 12 | 13 | [CustomDescription("正常")] 14 | Normarl=0, 15 | 16 | /// 17 | /// 已经锁住 18 | /// 19 | [CustomDescription("已经锁住")] 20 | Locked =-1, 21 | 22 | /// 23 | /// 已经提交单未验证 24 | /// 25 | [CustomDescription("未验证")] 26 | UnVerify=-2, 27 | 28 | /// 29 | /// 未设置账户基本信息 30 | /// 31 | [CustomDescription("未设置账户基本信息")] 32 | UnInitAccount = -3, 33 | 34 | /// 35 | /// 微信账号解除绑定 36 | /// 37 | [CustomDescription("微信账号解除绑定")] 38 | WxAccountUnBinding = -4, 39 | 40 | /// 41 | /// 已经删除 42 | /// 43 | [CustomDescription("已经删除")] 44 | Deleted= -9 45 | } 46 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Lfz.AutoUpdater.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Providers/SqlServerDataServicesProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using FluentNHibernate.Cfg.Db; 3 | 4 | namespace Lfz.Data.Nh.Providers { 5 | public class SqlServerDataServicesProvider : AbstractDataServicesProvider { 6 | private readonly string _dataFolder; 7 | private readonly string _connectionString; 8 | 9 | public SqlServerDataServicesProvider(string dataFolder, string connectionString) { 10 | _dataFolder = dataFolder; 11 | _connectionString = connectionString; 12 | } 13 | 14 | public static string ProviderName { 15 | get { return "SqlServer"; } 16 | } 17 | 18 | public override IPersistenceConfigurer GetPersistenceConfigurer(bool createDatabase) { 19 | var persistence = MsSqlConfiguration.MsSql2008; 20 | if (string.IsNullOrEmpty(_connectionString)) { 21 | throw new ArgumentException("The connection string is empty"); 22 | } 23 | persistence = persistence.ConnectionString(_connectionString); 24 | return persistence; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Lfz.MqListener.WindowService/Service1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.MqListener.WindowService 2 | { 3 | partial class TCMqListener 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 false。 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region 组件设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | // 32 | // TCMqListener 33 | // 34 | this.ServiceName = "TCMqListener"; 35 | 36 | } 37 | 38 | #endregion 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Lfz.Core/Models/PropertyTrackInfo.cs: -------------------------------------------------------------------------------- 1 | // ====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename :DemoController.cs 7 | // DESCRIPTION : 8 | // 9 | // Created By Administrator at 2014-04-30 14:40 10 | // https://git.oschina.net/lfz 11 | // 12 | // ======================================================================*/ 13 | namespace Lfz.Models 14 | { 15 | /// 16 | /// 属性修改跟踪信息 17 | /// 18 | public class PropertyTrackInfo 19 | { 20 | 21 | /// 22 | /// 属性跟踪状态 23 | /// 24 | public PropertyTrackStatus Status { get; set; } 25 | 26 | /// 27 | /// 属性名称 28 | /// 29 | public string PropertyName { get; set; } 30 | 31 | /// 32 | /// 修改前值 33 | /// 34 | public string OldValue { get; set; } 35 | 36 | /// 37 | /// 修改后值 38 | /// 39 | public string NewValue { get; set; } 40 | } 41 | } -------------------------------------------------------------------------------- /Lfz.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过下列属性集 6 | // 控制。更改这些属性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("lfz基础框架库")] 9 | [assembly: AssemblyDescription("基础框架库-林芳崽")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("lfz")] 12 | [assembly: AssemblyProduct("基础框架库")] 13 | [assembly: AssemblyCopyright("Copyright © China 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 属性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("f60de9ba-1ecc-4adb-9144-98407c407d5c")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 内部版本号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2.0.0.0")] 36 | [assembly: AssemblyFileVersion("2.0.0.0")] 37 | -------------------------------------------------------------------------------- /Lfz.MqListener/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("消息调度程序")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Lfz.MqListener")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("907291f4-6294-4149-9474-a9783fde317e")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2.0.0.0")] 36 | [assembly: AssemblyFileVersion("2.0.0.0")] 37 | -------------------------------------------------------------------------------- /Lfz.Core/Data/RawSql/IDbProviderConfig.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :DbConfig.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-04 15:59 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using System; 15 | 16 | namespace Lfz.Data.RawSql 17 | { 18 | /// 19 | /// 20 | /// 21 | public interface IDbProviderConfig 22 | { 23 | /// 24 | /// 25 | /// 26 | Guid CustomerId { get; set; } 27 | 28 | /// 29 | /// 30 | /// 31 | string DataFolder { get; set; } 32 | /// 33 | /// 34 | /// 35 | DbProvider DbProvider { get; } 36 | 37 | /// 38 | /// 数据库连接字符串 39 | /// 40 | string DbConnectionString { get; } 41 | } 42 | } -------------------------------------------------------------------------------- /Lfz.Core/DataAnnotations/CustomRequiredAttribute.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 lfz 4 | * All rights reserved 5 | * 6 | * Filename :CustomRequiredAttribute.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2013-09-09 15:06 10 | * https://git.oschina.net/lfz 11 | * 12 | *======================================================================*/ 13 | 14 | using System; 15 | 16 | namespace Lfz.DataAnnotations 17 | { 18 | /// 19 | /// 需要做隐藏控制的类中添加属性控制 20 | /// 21 | [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] 22 | public class DynamicHidenAttribute : Attribute 23 | { 24 | /// 25 | /// 26 | /// 27 | /// 企业类型依赖的属性 28 | public DynamicHidenAttribute(string corpTypeProperty = "") 29 | { 30 | CorpTypeProperty = corpTypeProperty; 31 | } 32 | 33 | public string CorpTypeProperty { get; private set; } 34 | } 35 | } -------------------------------------------------------------------------------- /Lfz.MqListener.WindowService/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("消息调度服务")] 9 | [assembly: AssemblyDescription("消息调度服务")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("lfz")] 12 | [assembly: AssemblyProduct("消息调度服务")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("4444445a-8d9e-4677-8c8e-d9d7d90f344f")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("Lfz.AutoUpdater")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("TCSoft.AutoUpdater")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("66d9e0b5-9081-485e-9505-90a01c27c8a8")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Lfz.Core/Commands/ICommandHandler.cs: -------------------------------------------------------------------------------- 1 | using Lfz.Logging; 2 | 3 | namespace Lfz.Commands 4 | { 5 | /// 6 | /// 命令控制器 7 | /// 8 | /// 9 | public interface ICommandHandler where TResult : ICommandResult 10 | { 11 | /// 12 | /// 日志 13 | /// 14 | ILogger Logger { get; set; } 15 | 16 | /// 17 | /// 18 | /// 19 | /// 20 | /// 21 | TResult Execute( object command); 22 | } 23 | 24 | /// 25 | /// 命令控制器 26 | /// 27 | /// 28 | /// 29 | public interface ICommandHandler : ICommandHandler where TResult : ICommandResult 30 | { 31 | /// 32 | /// 33 | /// 34 | /// 35 | /// 36 | TResult Execute(TCommand command); 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /Lfz.Core/Data/EntityMappingBase.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 杭州品茗信息有限公司 4 | * All rights reserved 5 | * 6 | * Filename :EntityBase.cs 7 | * DESCRIPTION :Base class for entities 8 | * 9 | * Created By 林芳崽 at 2013-05-08 18:47 10 | * http://www.pinming.cn/ 11 | * 12 | *======================================================================*/ 13 | 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Data.Entity.ModelConfiguration; 16 | 17 | namespace PMSoft.Data 18 | { 19 | /// 20 | /// 21 | /// 22 | /// 23 | /// 24 | public abstract class EntityMapping : EntityTypeConfiguration 25 | where T : EntityBase 26 | { 27 | /// 28 | /// 29 | /// 30 | protected EntityMapping() 31 | { 32 | HasKey(x => x.Id); 33 | Property(x => x.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None); 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("Lfz.MqListener.Service")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Lfz.MqListener.Service")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("1ae57613-5d4b-4d33-b972-15743818c3db")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Lfz.MqListener.DlqConsole/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("Lfz.MqListener.DlqConsole")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Lfz.MqListener.DlqConsole")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("36552838-6c28-470b-a42d-98f1b931e075")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Models/ConfigCenter/ConfigCenter_ModuleSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using Lfz.Data; 5 | 6 | namespace Lfz.MqListener.Models.ConfigCenter 7 | { 8 | /// 9 | /// 10 | /// 11 | [Table("ConfigCenter_ModuleSettings")] 12 | [Serializable] 13 | public partial class ConfigCenter_ModuleSettings : EntityBase 14 | { 15 | 16 | /// 17 | /// 18 | /// 19 | public Guid CustomerId { get; set; } 20 | /// 21 | /// 22 | /// 23 | [Key] 24 | public Guid ModuleId { get; set; } 25 | 26 | /// 27 | /// 28 | /// 29 | [Column(TypeName = "ntext")] 30 | public string JsonContent { get; set; } 31 | 32 | /// 33 | /// 34 | /// 35 | public DateTime CreateTime { get; set; } 36 | 37 | public override Guid GetKeyValue() 38 | { 39 | return ModuleId; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Lfz.MqListener/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Lfz.MqListener.DlqConsole/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/SysConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations.Schema; 3 | using Lfz.Config; 4 | using Lfz.MqListener.Shared.Enums; 5 | using Newtonsoft.Json; 6 | 7 | namespace Lfz.MqListener.Shared 8 | { 9 | /// 10 | /// 系统配置 11 | /// 12 | [Table("Sys_Config")] 13 | public class SysConfig : ISysConfig 14 | { 15 | /// 16 | /// 17 | /// 18 | public int Id { get; set; } 19 | 20 | /// 21 | /// 缓存版本号 22 | /// 23 | [JsonProperty("V")] 24 | public int CacheVersion { get; set; } 25 | 26 | /// 27 | /// 28 | /// 29 | [JsonProperty("T")] 30 | public CacheVersionType? CacheVersionType { get; set; } 31 | 32 | /// 33 | /// 缓存关联实体ID 34 | /// 35 | [JsonProperty("eid")] 36 | public Guid? CacheEntityId { get; set; } 37 | 38 | /// 39 | /// 关联商家ID 40 | /// 41 | [JsonProperty("cid")] 42 | public Guid? CustomerId { get; set; } 43 | 44 | } 45 | } -------------------------------------------------------------------------------- /Lfz.MqListener.WindowService/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Conventions/StringLengthConvention.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using FluentNHibernate.Conventions; 3 | using FluentNHibernate.Conventions.Instances; 4 | 5 | namespace PMSoft.Data.Conventions { 6 | /// 7 | /// 8 | /// 9 | public class StringLengthMaxAttribute : StringLengthAttribute { 10 | /// 11 | /// 12 | /// 13 | public StringLengthMaxAttribute() : base(10000) { 14 | // 10000 is an arbitrary number large enough to be in the nvarchar(max) range 15 | } 16 | } 17 | 18 | /// 19 | /// 20 | /// 21 | public class StringLengthConvention : AttributePropertyConvention { 22 | /// 23 | /// Apply changes to a property with an attribute matching T. 24 | /// 25 | /// Instance of attribute found on property.Property with attribute 26 | protected override void Apply(StringLengthAttribute attribute, IPropertyInstance instance) { 27 | instance.Length(attribute.MaximumLength); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Conventions/ReferenceConvention.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using FluentNHibernate.Conventions; 3 | using FluentNHibernate.Conventions.AcceptanceCriteria; 4 | using FluentNHibernate.Conventions.Inspections; 5 | using FluentNHibernate.Conventions.Instances; 6 | 7 | namespace Lfz.Data.Nh.Conventions 8 | { 9 | public class ReferenceConvention : IReferenceConvention, IReferenceConventionAcceptance, IHasManyConvention, IHasManyConventionAcceptance { 10 | public void Apply(IManyToOneInstance instance) { 11 | instance.Fetch.Join(); 12 | } 13 | 14 | public void Accept(IAcceptanceCriteria criteria) { 15 | criteria.Expect(x => x.Property != null && x.Property.MemberInfo.GetCustomAttributes(typeof(AggregateAttribute), false).Any()); 16 | } 17 | 18 | public void Apply(IOneToManyCollectionInstance instance) { 19 | instance.Fetch.Select(); 20 | instance.Cache.ReadWrite(); 21 | } 22 | 23 | public void Accept(IAcceptanceCriteria criteria) { 24 | criteria.Expect(x => x.Member != null && x.Member.IsDefined(typeof(AggregateAttribute), false)); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Providers/MySqlDataServicesProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using FluentNHibernate.Cfg.Db; 3 | using NHibernate.Dialect; 4 | 5 | namespace Lfz.Data.Nh.Providers 6 | { 7 | public class MySqlDataServicesProvider : AbstractDataServicesProvider 8 | { 9 | private readonly string _dataFolder; 10 | private readonly string _connectionString; 11 | 12 | public MySqlDataServicesProvider(string dataFolder, string connectionString) 13 | { 14 | _dataFolder = dataFolder; 15 | _connectionString = connectionString; 16 | } 17 | 18 | public static string ProviderName 19 | { 20 | get { return "MySql"; } 21 | } 22 | 23 | public override IPersistenceConfigurer GetPersistenceConfigurer(bool createDatabase) 24 | { 25 | var persistence = MySQLConfiguration.Standard.Dialect(); 26 | if (string.IsNullOrEmpty(_connectionString)) 27 | { 28 | throw new ArgumentException("The connection string is empty"); 29 | } 30 | persistence = persistence.ConnectionString(_connectionString); 31 | return persistence; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Lfz.Core/IO/IStorageFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace Lfz.IO 5 | { 6 | /// 7 | /// 文件信息 8 | /// 9 | public interface IStorageFile 10 | { 11 | /// 12 | /// 文件路径 13 | /// 14 | /// 15 | string GetPath(); 16 | /// 17 | /// 文件名称 18 | /// 19 | /// 20 | string GetName(); 21 | /// 22 | /// 文件大小 23 | /// 24 | /// 25 | long GetSize(); 26 | /// 27 | /// 最近修改时间 28 | /// 29 | /// 30 | DateTime GetLastUpdated(); 31 | /// 32 | /// 文件类型 33 | /// 34 | /// 35 | string GetFileType(); 36 | 37 | /// 38 | /// Creates a stream for reading from the file. 39 | /// 40 | Stream OpenRead(); 41 | 42 | /// 43 | /// Creates a stream for writing to the file. 44 | /// 45 | Stream OpenWrite(); 46 | } 47 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using Lfz.AutoUpdater.Config; 4 | using Lfz.AutoUpdater.Logging; 5 | using Lfz.AutoUpdater.Service; 6 | using Lfz.AutoUpdater.Utitlies; 7 | 8 | namespace Lfz.AutoUpdater 9 | { 10 | static class Program 11 | { 12 | /// 13 | /// 应用程序的主入口点。 14 | /// 15 | [STAThread] 16 | static void Main(params string[] args) 17 | { 18 | Application.EnableVisualStyles(); 19 | Application.SetCompatibleTextRenderingDefault(false); 20 | bool flag = false; 21 | if (args != null && args.Length > 0) 22 | { 23 | flag = TypeParse.StrToBool(args[0]); 24 | } 25 | var logger = LoggerFactory.GetLog(RunConfig.Current.LoggerType); 26 | if (flag) 27 | { 28 | logger.Information("启动自动更新程序(后台程序,不可见)"); 29 | AutoUpdateBackgroupService.RunAutoUpdate(); 30 | } 31 | else 32 | { 33 | logger.Information("启动更新程序(需要手动操作)"); 34 | Application.Run(new FrmUpdateCheck()); 35 | } 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Lfz.AutoUpdater/IO/IStorageFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace Lfz.AutoUpdater.IO 5 | { 6 | /// 7 | /// 文件信息 8 | /// 9 | internal interface IStorageFile 10 | { 11 | /// 12 | /// 文件路径 13 | /// 14 | /// 15 | string GetPath(); 16 | /// 17 | /// 文件名称 18 | /// 19 | /// 20 | string GetName(); 21 | /// 22 | /// 文件大小 23 | /// 24 | /// 25 | long GetSize(); 26 | /// 27 | /// 最近修改时间 28 | /// 29 | /// 30 | DateTime GetLastUpdated(); 31 | /// 32 | /// 文件类型 33 | /// 34 | /// 35 | string GetFileType(); 36 | 37 | /// 38 | /// Creates a stream for reading from the file. 39 | /// 40 | Stream OpenRead(); 41 | 42 | /// 43 | /// Creates a stream for writing to the file. 44 | /// 45 | Stream OpenWrite(); 46 | } 47 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/Enums/ClusterComputerType.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :ClusterComputerType.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2015-12-23 11:01 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | namespace Lfz.MqListener.Shared.Enums 15 | { 16 | /// 17 | /// 18 | /// 19 | public enum ClusterComputerType 20 | { 21 | /// 22 | /// 消息队列 23 | /// 24 | [CustomDescription("消息主机")] 25 | MessageQueue = 0, 26 | /// 27 | /// Redis缓存 28 | /// 29 | [CustomDescription("Redis主机")] 30 | Redis = 1, 31 | /// 32 | /// Mysql数据库 33 | /// 34 | [CustomDescription("Mysql主机")] 35 | Mysql = 2, 36 | 37 | /// 38 | /// Sqlserver数据库 39 | /// 40 | [CustomDescription("Sqlserver主机")] 41 | Sqlserver=3 42 | 43 | } 44 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/SelectTreeListItem.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Data 2 | { 3 | public class SelectTreeListItem 4 | { 5 | public string Id { get; set; } 6 | public string VisitPath { get; set; } 7 | public string Name { get; set; } 8 | public bool Selected { get; set; } 9 | public object OptionsHtmlAttributes { get; set; } 10 | } 11 | 12 | 13 | /// 14 | /// 15 | /// 16 | public class ComboxListItem : System.Object 17 | { 18 | private string _Value = string.Empty; 19 | private string _Text = string.Empty; 20 | 21 | /// 22 | /// 值 23 | /// 24 | public string Value 25 | { 26 | get { return this._Value; } 27 | set { this._Value = value; } 28 | } 29 | /// 30 | /// 显示的文本 31 | /// 32 | public string Text 33 | { 34 | get { return this._Text; } 35 | set { this._Text = value; } 36 | } 37 | 38 | public ComboxListItem(string value, string text) 39 | { 40 | this._Value = value; 41 | this._Text = text; 42 | } 43 | public override string ToString() 44 | { 45 | return this._Text; 46 | } 47 | 48 | } 49 | } -------------------------------------------------------------------------------- /Lfz.Core/Caching/CacheModule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Autofac; 4 | 5 | namespace PMSoft.Caching { 6 | public class CacheModule : Module { 7 | protected override void Load(ContainerBuilder builder) { 8 | 9 | builder.RegisterType() 10 | .As() 11 | .InstancePerDependency(); 12 | } 13 | 14 | protected override void AttachToComponentRegistration(Autofac.Core.IComponentRegistry componentRegistry, Autofac.Core.IComponentRegistration registration) { 15 | var needsCacheManager = registration.Activator.LimitType 16 | .GetConstructors() 17 | .Any(x => x.GetParameters() 18 | .Any(xx => xx.ParameterType == typeof(ICacheManager))); 19 | 20 | if (needsCacheManager) { 21 | registration.Preparing += (sender, e) => { 22 | var parameter = new TypedParameter( 23 | typeof(ICacheManager), 24 | e.Context.Resolve(new TypedParameter(typeof(Type), registration.Activator.LimitType))); 25 | e.Parameters = e.Parameters.Concat(new[] { parameter }); 26 | }; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Lfz.Core/Rest/RestResolverFilterAttribute.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 lfz 4 | * All rights reserved 5 | * 6 | * Filename :RestResolverFilterAttribute.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2013-07-22 13:41 10 | * https://git.oschina.net/lfz 11 | * 12 | *======================================================================*/ 13 | 14 | using System; 15 | 16 | namespace Lfz.Rest 17 | { 18 | /// 19 | /// Json属性解析过滤器。主要用于某些抽象类反序列化化查找具体实现类。 20 | /// 反序列化时,需要调用类对象的默认构造函数,所以需要一个包含默认函数的具体实现类。 21 | /// 22 | [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)] 23 | public class RestResolverFilterAttribute : Attribute 24 | { 25 | 26 | /// 27 | /// 28 | /// 29 | /// 过滤器唯一键值 30 | public RestResolverFilterAttribute(JsonPropertyFilterEnum uniqueKey) 31 | { 32 | UniqueKey = uniqueKey; 33 | } 34 | 35 | 36 | /// 37 | /// 过滤器唯一键值 38 | /// 39 | public JsonPropertyFilterEnum UniqueKey { get; set; } 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /Lfz.Core/Config/RunConfig.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :RunConfig.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-29 11:00 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using Lfz.Logging; 15 | 16 | namespace Lfz.Config 17 | { 18 | public partial class RunConfig : JsonConfigBase 19 | { 20 | /// 21 | /// Gets the singleton Nop engine used to access Nop services. 22 | /// 23 | public static RunConfig Current 24 | { 25 | get 26 | { 27 | return Load() ?? new RunConfig(); 28 | } 29 | } 30 | 31 | public LoggerType LoggerType { get; set; } 32 | 33 | public string ApiDomainUrl { get; set; } 34 | 35 | /// 36 | /// 配置项是否加密启动 37 | /// 38 | public bool EnabledEncrypt { get; set; } 39 | 40 | public override string GetConfigFile() 41 | { 42 | return "~/Config/RunConfig.json"; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Rest/RestResolverFilterAttribute.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 lfz 4 | * All rights reserved 5 | * 6 | * Filename :RestResolverFilterAttribute.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2013-07-22 13:41 10 | * https://git.oschina.net/lfz 11 | * 12 | *======================================================================*/ 13 | 14 | using System; 15 | 16 | namespace Lfz.AutoUpdater.Rest 17 | { 18 | /// 19 | /// Json属性解析过滤器。主要用于某些抽象类反序列化化查找具体实现类。 20 | /// 反序列化时,需要调用类对象的默认构造函数,所以需要一个包含默认函数的具体实现类。 21 | /// 22 | [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)] 23 | internal class RestResolverFilterAttribute : Attribute 24 | { 25 | 26 | /// 27 | /// 28 | /// 29 | /// 过滤器唯一键值 30 | public RestResolverFilterAttribute(JsonPropertyFilterEnum uniqueKey) 31 | { 32 | UniqueKey = uniqueKey; 33 | } 34 | 35 | 36 | /// 37 | /// 过滤器唯一键值 38 | /// 39 | public JsonPropertyFilterEnum UniqueKey { get; set; } 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/MqVistor/Heartbeat/DeviceHeatbeatCommandVistor.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :HeartbeatCommandVistor.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-27 16:01 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using Lfz.Logging; 15 | using Lfz.MqListener.Mq; 16 | using Lfz.MqListener.Shared.Models; 17 | 18 | namespace Lfz.MqListener.MqVistor.Heartbeat 19 | { 20 | public class DeviceHeatbeatCommandVistor : IMqCommandQuqueVistor 21 | { 22 | 23 | public DeviceHeatbeatCommandVistor() 24 | { 25 | } 26 | 27 | public void Vistor(QuqueName queueName, MqCommandInfo commandInfo) 28 | { 29 | if (queueName != QuqueName.ClientHeart 30 | && commandInfo.MessageType != NMSMessageType.Heart 31 | && !commandInfo.Properties.ContainsKey(MqConsts.MqDevice)) return; 32 | var deviceType = commandInfo.Properties[MqConsts.MqDevice]; 33 | LoggerFactory.GetLog().Error(string.Format("{0}设备心跳包处理", deviceType)); 34 | 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/Enums/StoreStatus.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.MqListener.Shared.Enums 2 | { 3 | /// 4 | /// 5 | /// 6 | public enum StoreStatus 7 | { 8 | 9 | 10 | /// 11 | ///失联 1 12 | /// 13 | [CustomDescription("失联")] 14 | Offline = 0, 15 | 16 | /// 17 | ///失联 1 18 | /// 19 | [CustomDescription("连接中")] 20 | InConnection = 1, 21 | 22 | /// 23 | ///在线 2 24 | /// 25 | [CustomDescription("在线")] 26 | Online = 2, 27 | 28 | 29 | } 30 | 31 | /// 32 | /// 门店审批状态 33 | /// 34 | public enum StoreAuditStatus 35 | { 36 | /// 37 | ///未提交 0 38 | /// 39 | [CustomDescription("未提交")] 40 | Normal = 0, 41 | 42 | /// 43 | ///审批中 0 44 | /// 45 | [CustomDescription("审批中")] 46 | Auditing = 1, 47 | 48 | /// 49 | /// 50 | /// 51 | [CustomDescription("通过")] 52 | Passing = 2, 53 | 54 | /// 55 | /// 56 | /// 57 | [CustomDescription("不通过")] 58 | Unpass = -1, 59 | 60 | } 61 | 62 | 63 | } -------------------------------------------------------------------------------- /Lfz.Core/Enums/Hr/InternalUserRoleType.cs: -------------------------------------------------------------------------------- 1 | // ====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename :InternalUserRoleType.cs 7 | // DESCRIPTION :内置角色类型 8 | // 9 | // Created By 林芳崽 at 2014-04-30 14:40 10 | // https://git.oschina.net/lfz 11 | // 12 | // ======================================================================*/ 13 | 14 | using System; 15 | 16 | namespace Lfz.Enums.Hr 17 | { 18 | /// 19 | /// 内置角色类型 20 | /// 21 | [Flags] 22 | public enum InternalUserRoleType 23 | { 24 | /// 25 | /// 系统超级管理员 26 | /// 27 | [CustomDescription("系统管理员")] 28 | InternalSupperAdmin=2, 29 | 30 | /// 31 | /// 商家管理员 32 | /// 33 | [CustomDescription("商家管理员")] 34 | InternalCustomerAdmin=4, 35 | 36 | /// 37 | /// 商家员工 38 | /// 39 | [CustomDescription("商家员工")] 40 | InternalCustomerEmployee=8, 41 | 42 | /// 43 | /// 注册用户 44 | /// 45 | [CustomDescription("注册用户")] 46 | RegisterUser =16, 47 | 48 | /// 49 | /// 50 | /// 51 | None =0, 52 | } 53 | } -------------------------------------------------------------------------------- /Lfz.Core/Mq/IMqConfigService.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :IConfigCenterService.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2015-11-16 15:58 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using System; 15 | using System.Collections.Generic; 16 | 17 | namespace Lfz.Mq 18 | { 19 | /// 20 | /// 21 | /// 22 | public interface IMqConfigService : IPerHttpRequestDependency 23 | { 24 | /// 25 | /// 26 | /// 27 | /// 28 | MqClientConfigInfo GetMqConfig(Guid storeId,bool useLanIpAddress); 29 | 30 | /// 31 | /// 32 | /// 33 | /// 34 | IEnumerable GetAll(); 35 | 36 | /// 37 | /// 38 | /// 39 | void Reset(); 40 | 41 | /// 42 | /// 43 | /// 44 | /// 45 | /// 46 | bool Delete(IEnumerable idlist); 47 | 48 | } 49 | } -------------------------------------------------------------------------------- /Lfz.Core/Logging/ConsoleLoger.cs: -------------------------------------------------------------------------------- 1 | //====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename : ConsoleLoger 7 | // DESCRIPTION : 控制台日志 8 | // 9 | // Created By 林芳崽 at 2013-01-04 09:11:01 10 | // https://git.oschina.net/lfz 11 | // 12 | //====================================================================== 13 | 14 | using System; 15 | 16 | namespace Lfz.Logging 17 | { 18 | /// 19 | /// 控制台日志 20 | /// 21 | public class ConsoleLoger : LoggerBase 22 | { 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | public override bool IsEnabled(LogLevel level) 29 | { 30 | return true; 31 | } 32 | 33 | /// 34 | /// summary 35 | /// 36 | /// 37 | /// 38 | /// 39 | public override void Log(LogLevel level, string message, Exception exception) 40 | { 41 | Console.WriteLine("Level:{0} {1} {2} ", level.ToString(), message, exception != null ? exception.StackTrace : null); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Logging/ConsoleLoger.cs: -------------------------------------------------------------------------------- 1 | //====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename : ConsoleLoger 7 | // DESCRIPTION : 控制台日志 8 | // 9 | // Created By 林芳崽 at 2013-01-04 09:11:01 10 | // https://git.oschina.net/lfz 11 | // 12 | //====================================================================== 13 | 14 | using System; 15 | 16 | namespace Lfz.AutoUpdater.Logging 17 | { 18 | /// 19 | /// 控制台日志 20 | /// 21 | internal class ConsoleLoger : LoggerBase 22 | { 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | public override bool IsEnabled(LogLevel level) 29 | { 30 | return true; 31 | } 32 | 33 | /// 34 | /// summary 35 | /// 36 | /// 37 | /// 38 | /// 39 | public override void Log(LogLevel level, string message, Exception exception) 40 | { 41 | Console.WriteLine("Level:{0} {1} {2} ", level.ToString(), message, exception != null ? exception.StackTrace : null); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Lfz.Core/Commands/CommandHandlerBase.cs: -------------------------------------------------------------------------------- 1 | using Lfz.Logging; 2 | 3 | namespace Lfz.Commands 4 | { 5 | /// 6 | /// 7 | /// 8 | /// 9 | public abstract class CommandHandlerBase : ICommandHandler 10 | where TResult : ICommandResult 11 | { 12 | /// 13 | /// 14 | /// 15 | protected CommandHandlerBase() 16 | { 17 | Logger = LoggerFactory.GetLog(); 18 | } 19 | 20 | public ILogger Logger { get; set; } 21 | 22 | /// 23 | /// 可以重载的方法 24 | /// 25 | /// 26 | /// 27 | public abstract TResult Execute( object command); 28 | } 29 | 30 | /// 31 | /// 32 | /// 33 | /// 34 | /// 35 | public abstract class CommandHandlerBase : CommandHandlerBase, ICommandHandler 36 | where TResult : ICommandResult 37 | { 38 | 39 | /// 40 | /// 可以重载的方法 41 | /// 42 | /// 43 | /// 44 | public abstract TResult Execute(TCommand command); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Lfz.Core/Caching/IParallelCacheContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace PMSoft.Caching { 5 | /// 6 | /// Provides services to enable parallel tasks aware of the current cache context. 7 | /// 8 | public interface IParallelCacheContext { 9 | /// 10 | /// Create a task that wraps some piece of code that implictly depends on the cache context. 11 | /// The return task can be used in any execution thread (e.g. System.Threading.Tasks). 12 | /// 13 | ITask CreateContextAwareTask(Func function); 14 | 15 | IEnumerable RunInParallel(IEnumerable source, Func selector); 16 | } 17 | 18 | public interface ITask : IDisposable { 19 | /// 20 | /// Execute task and collect eventual volatile tokens 21 | /// 22 | T Execute(); 23 | 24 | /// 25 | /// Return tokens collected during task execution. May be empty if nothing collected, 26 | /// or if the task was executed in the same context as the current 27 | /// ICacheContextAccessor.Current. 28 | /// 29 | IEnumerable Tokens { get; } 30 | 31 | /// 32 | /// Forward collected tokens to current cache context 33 | /// 34 | void Finish(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Access/ConfigCenterRedisCacheKeyAccess.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :ConfigCenterRedisCacheKeyAccess.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-26 15:53 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using Lfz.Data.RawSql; 15 | using Lfz.MqListener.Models.ConfigCenter; 16 | 17 | namespace Lfz.MqListener.Access 18 | { 19 | public class ConfigCenterRedisCacheKeyAccess: BusinessService 20 | { 21 | 22 | public ConfigCenterRedisCacheKeyAccess(IDbProviderConfig providerConfig) 23 | : base(providerConfig) 24 | { 25 | } 26 | 27 | public ConfigCenterRedisCacheKey GetByCacheKey(string key) 28 | { 29 | return Get(string.Format("CacheKey='{0}'", key)); 30 | } 31 | 32 | public override bool IsIdentity() 33 | { 34 | return false; 35 | } 36 | 37 | public override string TableName 38 | { 39 | get { return "ConfigCenter_RedisCacheKey"; } 40 | } 41 | 42 | public override string PrimaryKey 43 | { 44 | get { return "CacheKey"; } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/Models/MqConsts.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :MqConsumerService.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2015-11-09 17:26 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | namespace Lfz.MqListener.Shared.Models 15 | { 16 | /// 17 | /// 消息队列常量 18 | /// 19 | public class MqConsts 20 | { 21 | /// 22 | /// 过滤字段名称(门店ID) 23 | /// 24 | public const string ClientId = "clientid"; 25 | 26 | /// 27 | /// 商家ID 28 | /// 29 | public const string MqInstanceId = "mqid"; 30 | 31 | /// 32 | /// 商家All 33 | /// 34 | public const string MqInstanceAll = "mqall"; 35 | 36 | /// 37 | /// App类型 38 | /// 39 | public const string MqAppType = "mat"; 40 | 41 | /// 42 | /// 设备类型 43 | /// 44 | public const string MqDevice = "mdt"; 45 | /// 46 | /// 消息传递是否压缩 47 | /// 48 | public const string IsZipCompress = "iszip"; 49 | 50 | } 51 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/ITreeContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lfz.MqListener.Shared 4 | { 5 | /// 6 | /// 树形节点 7 | /// 8 | public interface ITreeContent 9 | { 10 | System.Guid Id { get; set; } 11 | /// 12 | /// 13 | /// 14 | Guid? ParentId { get; set; } 15 | 16 | /// 17 | /// 根路径,为0表示一级 18 | /// 19 | Guid? RootId { get; set; } 20 | 21 | /// 22 | /// 访问路径 树形节点路径就,使用逗号分割 23 | /// 24 | string VisitPath { get; set; } 25 | 26 | /// 27 | /// 28 | /// 29 | int? VisitLevel { get; set; } 30 | 31 | } 32 | 33 | /// 34 | /// 35 | /// 36 | public interface IDepartmentContent 37 | { 38 | /// 39 | /// 客户ID 40 | /// 41 | Guid CustomerId { get; set; } 42 | } 43 | /// 44 | /// 45 | /// 46 | public interface ICustomerContent 47 | { 48 | /// 49 | /// 客户ID 50 | /// 51 | Guid? CustomerId { get; set; } 52 | } 53 | 54 | /// 55 | /// 有记录孩子节点是否存在属性的树 56 | /// 57 | public interface IHasChildTreeContent : ITreeContent 58 | { 59 | /// 60 | /// 是否具有孩子节点 61 | /// 62 | bool? HasChild { get; set; } 63 | } 64 | } -------------------------------------------------------------------------------- /Lfz.Core/Security/CustomX509Validator.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 lfz 4 | * All rights reserved 5 | * 6 | * Filename :CustomX509Validator.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2013-05-23 16:39 10 | * https://git.oschina.net/lfz 11 | * 12 | *======================================================================*/ 13 | 14 | using System; 15 | using System.Configuration; 16 | using System.IdentityModel.Selectors; 17 | using System.IdentityModel.Tokens; 18 | using System.Security.Cryptography.X509Certificates; 19 | 20 | namespace Lfz.Security 21 | { 22 | /// 23 | /// X509认证验证器 24 | /// 25 | public class CustomX509Validator : X509CertificateValidator 26 | { 27 | /// 28 | /// Validates a certificate. 29 | /// 30 | /// The certificate the validate. 31 | public override void Validate(X509Certificate2 certificate) 32 | { 33 | // validate argument 34 | if (certificate == null) 35 | throw new ArgumentNullException("X509认证证书为空!"); 36 | // check if the name of the certifcate matches 37 | if (certificate.SubjectName.Name != ConfigurationManager.AppSettings["CertName"]) 38 | throw new SecurityTokenValidationException("Certificated was not issued by thrusted issuer"); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Lfz.Core/IDependency.cs: -------------------------------------------------------------------------------- 1 | // ====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename :DemoController.cs 7 | // DESCRIPTION : 8 | // 9 | // Created By Administrator at 2014-04-30 14:40 10 | // https://git.oschina.net/lfz 11 | // 12 | // ======================================================================*/ 13 | 14 | namespace Lfz 15 | { 16 | /// 17 | /// Base interface for services that are instantiated per unit of work (i.e. web request). 18 | /// 19 | public interface IDependency 20 | { 21 | } 22 | 23 | /// 24 | /// Base interface for services that are instantiated per shell/tenant. 25 | /// 26 | public interface ISingletonDependency : IDependency 27 | { 28 | } 29 | 30 | /// 31 | /// Base interface for services that are instantiated per shell/tenant. 32 | /// 33 | public interface IPerHttpRequestDependency : IDependency 34 | { 35 | } 36 | 37 | /// 38 | /// Base interface for services that may *only* be instantiated in a unit of work. 39 | /// This interface is used to guarantee they are not accidentally referenced by a singleton dependency. 40 | /// 41 | public interface IUnitOfWorkDependency : IDependency 42 | { 43 | } 44 | 45 | /// 46 | /// 不参与依赖注入 47 | /// 48 | public interface INonDependency 49 | { 50 | } 51 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Conventions/CacheConvention.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using FluentNHibernate.Conventions; 4 | using FluentNHibernate.Conventions.AcceptanceCriteria; 5 | using FluentNHibernate.Conventions.Inspections; 6 | using FluentNHibernate.Conventions.Instances; 7 | 8 | namespace PMSoft.Data.Conventions { 9 | /// 10 | /// 11 | /// 12 | public class CacheConvention : IClassConvention, IConventionAcceptance { 13 | private readonly IEnumerable _descriptors; 14 | 15 | /// 16 | /// 17 | /// 18 | /// 19 | public CacheConvention(IEnumerable descriptors) { 20 | _descriptors = descriptors; 21 | } 22 | 23 | /// 24 | /// Apply changes to the target 25 | /// 26 | public void Apply(IClassInstance instance) { 27 | instance.Cache.ReadWrite(); 28 | } 29 | 30 | /// 31 | /// Whether this convention will be applied to the target. 32 | /// 33 | /// Instace that could be supplied 34 | /// 35 | /// Apply on this target? 36 | /// 37 | public void Accept(IAcceptanceCriteria criteria) { 38 | criteria.Expect(x => _descriptors.Any(d => d.Type.Name == x.EntityType.Name)); 39 | } 40 | } 41 | 42 | 43 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Providers/MySqlDataServicesProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using FluentNHibernate.Cfg.Db; 3 | 4 | namespace PMSoft.Data.Providers 5 | { 6 | /// 7 | /// 8 | /// 9 | public class MySqlDataServicesProvider : AbstractDataServicesProvider 10 | { 11 | private readonly string _dataFolder; 12 | private readonly string _connectionString; 13 | 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | public MySqlDataServicesProvider(string dataFolder, string connectionString) 20 | { 21 | _dataFolder = dataFolder; 22 | _connectionString = connectionString; 23 | } 24 | 25 | /// 26 | /// 27 | /// 28 | public static string ProviderName 29 | { 30 | get { return "MySql"; } 31 | } 32 | 33 | /// 34 | /// 35 | /// 36 | /// 37 | /// 38 | public override IPersistenceConfigurer GetPersistenceConfigurer(bool createDatabase) 39 | { 40 | var persistence = MySQLConfiguration.Standard; 41 | if (string.IsNullOrEmpty(_connectionString)) 42 | { 43 | throw new ArgumentException("The connection string is empty"); 44 | } 45 | persistence = persistence.ConnectionString(_connectionString); 46 | return persistence; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/Enums/CustomerInfoStatus.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :CustomerInfoStatus.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2015-12-16 17:40 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | namespace Lfz.MqListener.Shared.Enums 15 | { 16 | /// 17 | /// 18 | /// 19 | public enum DataAuditingStatus 20 | { 21 | 22 | /// 23 | /// 24 | /// 25 | [CustomDescription("正常")] 26 | Normal = 0, 27 | 28 | /// 29 | /// 待审批 30 | /// 31 | [CustomDescription("待审批")] 32 | Auditing = 1, 33 | 34 | /// 35 | /// 通过 36 | /// 37 | [CustomDescription("通过")] 38 | Pass = 2, 39 | 40 | 41 | /// 42 | /// 不通过 43 | /// 44 | [CustomDescription("不通过")] 45 | Unpass = -1 46 | 47 | } 48 | 49 | /// 50 | /// 51 | /// 52 | public enum TradeStatus 53 | { 54 | /// 55 | /// 56 | /// 57 | [CustomDescription("正常")] 58 | Normal = 0, 59 | 60 | /// 61 | /// 不通过 62 | /// 63 | [CustomDescription("暂停")] 64 | Stop = -1 65 | 66 | } 67 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Infrastructure/SqlCeDataProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Common; 2 | using System.Data.Entity; 3 | using System.Data.Entity.Infrastructure; 4 | using System.Data.SqlClient; 5 | using PMSoft.Data.Initializers; 6 | 7 | namespace PMSoft.Data.Infrastructure 8 | { 9 | public class SqlCeDataProvider : BaseEfDataProvider 10 | { 11 | /// 12 | /// Get connection factory 13 | /// 14 | /// Connection factory 15 | public override IDbConnectionFactory GetConnectionFactory() 16 | { 17 | return new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0"); 18 | } 19 | 20 | /// 21 | /// Set database initializer 22 | /// 23 | public override void SetDatabaseInitializer() 24 | { 25 | //var initializer = new CreateDatabaseIfNotExists(); 26 | var initializer = new CreateCeDatabaseIfNotExists(); 27 | Database.SetInitializer(initializer); 28 | } 29 | 30 | /// 31 | /// A value indicating whether this data provider supports stored procedures 32 | /// 33 | public override bool StoredProceduredSupported 34 | { 35 | get { return false; } 36 | } 37 | 38 | /// 39 | /// Gets a support database parameter object (used by stored procedures) 40 | /// 41 | /// Parameter 42 | public override DbParameter GetParameter() 43 | { 44 | return new SqlParameter(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Access/DeviceAccess.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :DeviceAccess.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-29 9:54 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using System.Collections.Generic; 15 | using System.Data; 16 | using Lfz.Data.RawSql; 17 | using Lfz.MqListener.Models.Device; 18 | 19 | namespace Lfz.MqListener.Access 20 | { 21 | public class DeviceAccess:BusinessService 22 | { 23 | public DeviceAccess(IDbProviderConfig providerConfig) 24 | : base(providerConfig) 25 | { 26 | } 27 | 28 | public override bool IsIdentity() 29 | { 30 | return false; 31 | } 32 | public override string TableName 33 | { 34 | get { return "Device_BasicInfo"; } 35 | } 36 | 37 | public override string PrimaryKey 38 | { 39 | get { return "Id"; } 40 | } 41 | 42 | public override IDictionary GetDictionary(DeviceBasicInfo model) 43 | { 44 | var dic = base.GetDictionary(model); 45 | return dic; 46 | } 47 | 48 | public override DeviceBasicInfo Format(DataRow row, DataColumnCollection columns = null) 49 | { 50 | var item = base.Format(row, columns); 51 | return item; 52 | } 53 | 54 | } 55 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Infrastructure/BaseEfDataProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Common; 2 | using System.Data.Entity; 3 | using System.Data.Entity.Infrastructure; 4 | using PMSoft.Config; 5 | 6 | namespace PMSoft.Data.Infrastructure 7 | { 8 | public abstract class BaseEfDataProvider : IEfDataProvider 9 | { 10 | /// 11 | /// Get connection factory 12 | /// 13 | /// Connection factory 14 | public abstract IDbConnectionFactory GetConnectionFactory(); 15 | 16 | /// 17 | /// Initialize connection factory 18 | /// 19 | public void InitConnectionFactory() 20 | { 21 | Database.DefaultConnectionFactory = GetConnectionFactory(); 22 | } 23 | 24 | /// 25 | /// Set database initializer 26 | /// 27 | public abstract void SetDatabaseInitializer(); 28 | 29 | /// 30 | /// Initialize database 31 | /// 32 | public virtual void InitDatabase() 33 | { 34 | InitConnectionFactory(); 35 | SetDatabaseInitializer(); 36 | DataSettingsHelper.Installed(); 37 | } 38 | 39 | /// 40 | /// A value indicating whether this data provider supports stored procedures 41 | /// 42 | public abstract bool StoredProceduredSupported { get; } 43 | 44 | /// 45 | /// Gets a support database parameter object (used by stored procedures) 46 | /// 47 | /// Parameter 48 | public abstract DbParameter GetParameter(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Lfz.Core/Services/IService.cs: -------------------------------------------------------------------------------- 1 | //====================================================================== 2 | // 3 | // Copyright (C) 1996-2012 lfz 4 | // All rights reserved 5 | // 6 | // Filename : IService 7 | // DESCRIPTION : 服务基类(提供服务启动、停止、是否正在运行以及日志等功能) 8 | // 9 | // Created By 林芳崽 at 2013-01-08 09:11:01 10 | // https://git.oschina.net/lfz 11 | // 12 | //====================================================================== 13 | 14 | using System; 15 | using Lfz.Logging; 16 | 17 | namespace Lfz.Services 18 | { 19 | /// 20 | /// 服务基类(提供服务启动、停止、是否正在运行以及日志等功能) 21 | /// 22 | public interface IService : IDisposable 23 | { 24 | /// 25 | /// 线程是否在运行 26 | /// 27 | bool IsRunning { get; } 28 | 29 | /// 30 | /// 启动服务 31 | /// 32 | void Start(); 33 | 34 | /// 35 | /// 停止服务 36 | /// 37 | void Stop(); 38 | 39 | /// 40 | /// 日志 41 | /// 42 | ILogger Logger { get; set; } 43 | 44 | /// 45 | /// 服务名称 46 | /// 47 | string ServiceName { get; } 48 | 49 | 50 | /// 51 | /// 服务是否启动 52 | /// 53 | bool Enabled { get; set; } 54 | 55 | /// 56 | /// 重启服务 57 | /// 58 | /// 59 | bool Restart(); 60 | 61 | /// 62 | /// 63 | /// 64 | ServiceStatus Status { get; } 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Schema/StringLengthAttribute.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :Class1.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-27 13:41 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | // ReSharper disable once CheckNamespace 14 | namespace System.ComponentModel.DataAnnotations.Schema 15 | { 16 | //[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] 17 | // class StringLengthAttribute : ValidationAttribute 18 | //{ 19 | // public StringLengthAttribute(int maximumLength) 20 | // { 21 | // MaximumLength = maximumLength; 22 | // } 23 | 24 | // // 摘要: 25 | // // Gets or sets the maximum length of a string. 26 | // // 27 | // // 返回结果: 28 | // // The maximum length a string. 29 | // public int MaximumLength { get; set; } 30 | // // 31 | // // 摘要: 32 | // // Gets or sets the minimum length of a string. 33 | // // 34 | // // 返回结果: 35 | // // The minimum length of a string. 36 | // public int MinimumLength { get; set; } 37 | 38 | // public override string FormatErrorMessage(string name) 39 | // { 40 | // return string.Format("{0}长度无效", name); 41 | // } 42 | 43 | // public override bool IsValid(object value) 44 | // { 45 | // return true; 46 | // } 47 | //} 48 | } -------------------------------------------------------------------------------- /Lfz.Core/CustomDescriptionAttribute.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 lfz 4 | * All rights reserved 5 | * 6 | * Filename :DescriptionAttribute.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2013-05-16 14:11 10 | * https://git.oschina.net/lfz 11 | * 12 | *======================================================================*/ 13 | 14 | using System; 15 | 16 | namespace Lfz 17 | { 18 | 19 | /// 20 | /// 21 | /// 22 | [AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)] 23 | public class CustomTableNameAttribute : Attribute 24 | { 25 | /// 26 | /// 27 | /// 28 | /// 29 | public CustomTableNameAttribute(string tableName) 30 | { 31 | TableName = tableName; 32 | } 33 | /// 34 | /// 35 | /// 36 | public string TableName { get; set; } 37 | } 38 | /// 39 | /// 40 | /// 41 | [AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)] 42 | public class CustomDescriptionAttribute : Attribute 43 | { 44 | /// 45 | /// 46 | /// 47 | /// 48 | public CustomDescriptionAttribute(string description) 49 | { 50 | Description = description; 51 | } 52 | /// 53 | /// 54 | /// 55 | public string Description { get; set; } 56 | } 57 | 58 | 59 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/CustomDescriptionAttribute.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 lfz 4 | * All rights reserved 5 | * 6 | * Filename :DescriptionAttribute.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2013-05-16 14:11 10 | * https://git.oschina.net/lfz 11 | * 12 | *======================================================================*/ 13 | 14 | using System; 15 | 16 | namespace Lfz.AutoUpdater 17 | { 18 | 19 | /// 20 | /// 21 | /// 22 | [AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)] 23 | public class CustomTableNameAttribute : Attribute 24 | { 25 | /// 26 | /// 27 | /// 28 | /// 29 | public CustomTableNameAttribute(string tableName) 30 | { 31 | TableName = tableName; 32 | } 33 | /// 34 | /// 35 | /// 36 | public string TableName { get; set; } 37 | } 38 | /// 39 | /// 40 | /// 41 | [AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)] 42 | public class CustomDescriptionAttribute : Attribute 43 | { 44 | /// 45 | /// 46 | /// 47 | /// 48 | public CustomDescriptionAttribute(string description) 49 | { 50 | Description = description; 51 | } 52 | /// 53 | /// 54 | /// 55 | public string Description { get; set; } 56 | } 57 | 58 | 59 | } -------------------------------------------------------------------------------- /Lfz.AutoUpdater/Config/RunConfig.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :RunConfig.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-29 11:00 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using System; 15 | using System.Xml.Serialization; 16 | using Lfz.AutoUpdater.Logging; 17 | 18 | namespace Lfz.AutoUpdater.Config 19 | { /// 20 | /// 加密内容 21 | /// 22 | [Serializable] 23 | [XmlRoot("EncryptContent")] 24 | internal class EncryptContent : IConfigInfo 25 | { 26 | /// 27 | /// 配置内容 28 | /// 29 | [XmlElement(ElementName = "Content")] 30 | public string Content { get; set; } 31 | } 32 | internal partial class RunConfig : JsonConfigBase 33 | { 34 | /// 35 | /// Gets the singleton Nop engine used to access Nop services. 36 | /// 37 | public static RunConfig Current 38 | { 39 | get 40 | { 41 | return Load() ?? new RunConfig(); 42 | } 43 | } 44 | 45 | public LoggerType LoggerType { get; set; } 46 | 47 | public string ApiDomainUrl { get; set; } 48 | 49 | /// 50 | /// 配置项是否加密启动 51 | /// 52 | public bool EnabledEncrypt { get; set; } 53 | 54 | public override string GetConfigFile() 55 | { 56 | return "~/Config/RunConfig.json"; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Shared/App/MqAutoUpdateInfo.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :MqAutoUpdateInfo.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-27 16:44 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using System; 15 | using Lfz.MqListener.Shared.Enums; 16 | 17 | namespace Lfz.MqListener.Shared.App 18 | { 19 | /// 20 | /// 21 | /// 22 | public class MqAutoUpdateInfo 23 | { 24 | /// 25 | /// 最新版本号 26 | /// 27 | public string Version { get; set; } 28 | 29 | /// 30 | /// 更新包下载地址 31 | /// 32 | public string Url { get; set; } 33 | 34 | 35 | /// 36 | /// 接收的AppId 37 | /// 38 | public string AppId { get; set; } 39 | 40 | /// 41 | /// 发布时间 42 | /// 43 | public DateTime PublishTime { get; set; } 44 | 45 | /// 46 | /// 作者 47 | /// 48 | public string Author { get; set; } 49 | 50 | /// 51 | /// 说明 52 | /// 53 | public string Remark { get; set; } 54 | 55 | /// 56 | /// app类型 57 | /// 58 | public AppType AppType { get; set; } 59 | 60 | /// 61 | /// 强制更新为指定版本 62 | /// 63 | public bool ForceUpdate { get; set; } 64 | 65 | } 66 | } -------------------------------------------------------------------------------- /Lfz.Core/Validation/ValidationResult.cs: -------------------------------------------------------------------------------- 1 | namespace Lfz.Validation 2 | { 3 | /// 4 | /// Describes the result of a validation of a potential change through a business service. 5 | /// 6 | public class ValidationResult 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | public ValidationResult() 12 | { 13 | } 14 | 15 | 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | /// The message. 20 | public ValidationResult(string message) 21 | : this(string.Empty, message) 22 | { 23 | } 24 | 25 | /// 26 | /// Initializes a new instance of the class. 27 | /// 28 | /// Name of the memeber. 29 | /// The message. 30 | public ValidationResult(string memeberName, string message) 31 | { 32 | this.MemberName = memeberName; 33 | this.Message = message; 34 | } 35 | 36 | /// 37 | /// Gets or sets the name of the member. 38 | /// 39 | /// 40 | /// The name of the member. May be null for general validation issues. 41 | /// 42 | public string MemberName { get; set; } 43 | 44 | /// 45 | /// Gets or sets the message. 46 | /// 47 | /// 48 | /// The message. 49 | /// 50 | public string Message { get; set; } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Lfz.Core/Services/InstallService.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 杭州品茗信息有限公司 4 | * All rights reserved 5 | * 6 | * Filename :InstallService.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2013-05-08 14:41 10 | * http://www.pinming.cn/ 11 | * 12 | *======================================================================*/ 13 | 14 | using System; 15 | using System.Runtime.CompilerServices; 16 | using PMSoft.Config; 17 | 18 | namespace PMSoft.Services 19 | { 20 | public class InstallService : IInstallService 21 | { 22 | 23 | public InstallService( ) 24 | { 25 | } 26 | 27 | [MethodImpl(MethodImplOptions.Synchronized)] 28 | public bool Install() 29 | { 30 | bool flag = false; 31 | if (DataSettingsHelper.DatabaseIsInstalled()) return flag; 32 | try 33 | { 34 | //init data provider 35 | /* var dataProviderInstance = _providerManager.LoadDataProvider(); 36 | dataProviderInstance.InitDatabase();*/ 37 | //now resolve installation service 38 | //var installationService = ContainerContext.Resolve(); 39 | //installationService.InstallData(model.AdminEmail, model.AdminPassword, model.InstallSampleData); 40 | //TODO 初始化数据 41 | //reset cache 42 | DataSettingsHelper.Installed(); 43 | flag = true; 44 | } 45 | catch (Exception exception) 46 | { 47 | //reset cache 48 | DataSettingsHelper.ResetCache(); 49 | } 50 | return flag; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Conventions/AttributeCollectionConvention.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using FluentNHibernate.Conventions; 3 | using FluentNHibernate.Conventions.AcceptanceCriteria; 4 | using FluentNHibernate.Conventions.Inspections; 5 | using FluentNHibernate.Conventions.Instances; 6 | 7 | namespace PMSoft.Data.Conventions { 8 | /// 9 | /// 10 | /// 11 | /// 12 | public abstract class AttributeCollectionConvention : ICollectionConvention, ICollectionConventionAcceptance where T : Attribute { 13 | /// 14 | /// Whether this convention will be applied to the target. 15 | /// 16 | /// Instace that could be supplied 17 | /// 18 | /// Apply on this target? 19 | /// 20 | public void Accept(IAcceptanceCriteria criteria) { 21 | criteria.Expect(inspector => GetAttribute(inspector) != null); 22 | } 23 | 24 | /// 25 | /// Apply changes to the target 26 | /// 27 | public void Apply(ICollectionInstance instance) { 28 | Apply(GetAttribute(instance), instance); 29 | } 30 | 31 | /// 32 | /// 33 | /// 34 | /// 35 | /// 36 | protected abstract void Apply(T attribute, ICollectionInstance instance); 37 | 38 | /// 39 | /// 40 | /// 41 | /// 42 | /// 43 | private static T GetAttribute(ICollectionInspector inspector) { 44 | return Attribute.GetCustomAttribute(inspector.Member, typeof(T)) as T; 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/MqVistor/Heartbeat/DeviceRegisterCommandVistor.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :HeartbeatCommandVistor.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-27 16:01 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using Lfz.MqListener.Access; 15 | using Lfz.MqListener.Mq; 16 | using Lfz.MqListener.Shared.App; 17 | using Lfz.MqListener.Shared.Models; 18 | using Lfz.Rest; 19 | using Lfz.Utitlies; 20 | 21 | namespace Lfz.MqListener.MqVistor.Heartbeat 22 | { 23 | public class DeviceRegisterCommandVistor : IMqCommandQuqueVistor 24 | { 25 | private readonly DeviceAccess _deviceAccess; 26 | 27 | public DeviceRegisterCommandVistor() 28 | { 29 | _deviceAccess = new DeviceAccess(DbConfigHelper.GetConfig()); 30 | } 31 | 32 | public void Vistor(QuqueName queueName, MqCommandInfo commandInfo) 33 | { 34 | if (queueName != QuqueName.BusinessProcessing 35 | && commandInfo.MessageType != NMSMessageType.None 36 | && !commandInfo.Properties.ContainsKey(MqConsts.MqDevice)) return; 37 | var deviceType = TypeParse.StrToInt(commandInfo.Properties[MqConsts.MqAppType]); 38 | if (deviceType == 0) 39 | { 40 | //不是有效的app类型 41 | return; 42 | } 43 | var data = JsonUtils.Deserialize(commandInfo.Body); 44 | if (data == null) return; 45 | //App心跳 46 | //_deviceAccess.Exists(string.Format("StoreId='{0}' AND ", commandInfo.StoreId)); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Nh/Providers/MsSqlCeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using System.Reflection; 3 | using FluentNHibernate.Cfg.Db; 4 | using NHibernate.Dialect; 5 | using NHibernate.Driver; 6 | using NHibernate.SqlTypes; 7 | 8 | namespace Lfz.Data.Nh.Providers 9 | { 10 | public class MsSqlCeConfiguration : PersistenceConfiguration { 11 | protected MsSqlCeConfiguration() { 12 | Driver(); 13 | } 14 | 15 | public static MsSqlCeConfiguration MsSqlCe40 { 16 | get { return new MsSqlCeConfiguration().Dialect(); } 17 | 18 | } 19 | 20 | /// 21 | /// Custom driver so that Text/NText fields are not truncated at 4000 characters 22 | /// 23 | public class CustomSqlServerCeDriver : SqlServerCeDriver { 24 | protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType) { 25 | base.InitializeParameter(dbParam, name, sqlType); 26 | 27 | PropertyInfo dbParamSqlDbTypeProperty = dbParam.GetType().GetProperty("SqlDbType"); 28 | 29 | if (sqlType.Length <= 4000) { 30 | return; 31 | } 32 | 33 | switch (sqlType.DbType) { 34 | case DbType.String: 35 | dbParamSqlDbTypeProperty.SetValue(dbParam, SqlDbType.NText, null); 36 | break; 37 | case DbType.AnsiString: 38 | dbParamSqlDbTypeProperty.SetValue(dbParam, SqlDbType.Text, null); 39 | break; 40 | } 41 | } 42 | } 43 | 44 | public class CustomMsSqlCe40Dialect : MsSqlCe40Dialect { 45 | public override bool SupportsVariableLimit { 46 | get { return true; } 47 | } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/MqVistor/Heartbeat/AppHeartbeatCommandVistor.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :HeartbeatCommandVistor.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-27 16:01 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using Lfz.MqListener.Mq; 15 | using Lfz.MqListener.Service; 16 | using Lfz.MqListener.Shared.App; 17 | using Lfz.MqListener.Shared.Enums; 18 | using Lfz.MqListener.Shared.Models; 19 | using Lfz.Rest; 20 | using Lfz.Utitlies; 21 | 22 | namespace Lfz.MqListener.MqVistor.Heartbeat 23 | { 24 | public class AppHeartbeatCommandVistor : IMqCommandQuqueVistor 25 | { 26 | private readonly IConfigCenterMqListenerService _listenerService; 27 | 28 | public AppHeartbeatCommandVistor(IConfigCenterMqListenerService listenerService) 29 | { 30 | _listenerService = listenerService; 31 | } 32 | 33 | public void Vistor(QuqueName queueName, MqCommandInfo commandInfo) 34 | { 35 | if (queueName != QuqueName.ClientHeart 36 | && commandInfo.MessageType != NMSMessageType.Heart 37 | && !commandInfo.Properties.ContainsKey(MqConsts.MqAppType)) return; 38 | var appType = Utils.GetEnum(commandInfo.Properties[MqConsts.MqAppType]); 39 | if (appType == AppType.Empty) 40 | { 41 | //不是有效的app类型 42 | return; 43 | } 44 | var data = JsonUtils.Deserialize(commandInfo.Body); 45 | if (data == null) return; 46 | //App心跳 47 | _listenerService.Heartbeat(commandInfo.StoreId, appType, data); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Initializers/DropCreateCeDatabaseAlways.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.Entity; 3 | 4 | namespace PMSoft.Data.Initializers 5 | { 6 | /// 7 | /// An implementation of IDatabaseInitializer that will always recreate and optionally re-seed the 8 | /// database the first time that a context is used in the app domain. 9 | /// To seed the database, create a derived class and override the Seed method. 10 | /// 11 | /// The type of the context. 12 | public class DropCreateCeDatabaseAlways : SqlCeInitializer where TContext : DbContext 13 | { 14 | #region Strategy implementation 15 | 16 | /// 17 | /// Executes the strategy to initialize the database for the given context. 18 | /// 19 | /// The context. 20 | public override void InitializeDatabase(TContext context) 21 | { 22 | if (context == null) 23 | { 24 | throw new ArgumentNullException("context"); 25 | } 26 | var replacedContext = ReplaceSqlCeConnection(context); 27 | 28 | if (replacedContext.Database.Exists()) 29 | { 30 | replacedContext.Database.Delete(); 31 | } 32 | context.Database.Create(); 33 | Seed(context); 34 | context.SaveChanges(); 35 | } 36 | 37 | #endregion 38 | 39 | #region Seeding methods 40 | 41 | /// 42 | /// A that should be overridden to actually add data to the context for seeding. 43 | /// The default implementation does nothing. 44 | /// 45 | /// The context to seed. 46 | protected virtual void Seed(TContext context) 47 | { 48 | } 49 | 50 | #endregion 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Lfz.MqListener.Service/MqVistor/Heartbeat/AppRegisterCommandVistor.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :HeartbeatCommandVistor.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-27 16:01 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using Lfz.MqListener.Mq; 15 | using Lfz.MqListener.Service; 16 | using Lfz.MqListener.Shared.App; 17 | using Lfz.MqListener.Shared.Enums; 18 | using Lfz.MqListener.Shared.Models; 19 | using Lfz.Rest; 20 | using Lfz.Utitlies; 21 | 22 | namespace Lfz.MqListener.MqVistor.Heartbeat 23 | { 24 | public class AppRegisterCommandVistor : IMqCommandQuqueVistor 25 | { 26 | private readonly IConfigCenterMqListenerService _listenerService; 27 | 28 | public AppRegisterCommandVistor(IConfigCenterMqListenerService listenerService) 29 | { 30 | _listenerService = listenerService; 31 | } 32 | 33 | public void Vistor(QuqueName queueName, MqCommandInfo commandInfo) 34 | { 35 | if (queueName != QuqueName.BusinessProcessing 36 | && commandInfo.MessageType != NMSMessageType.None 37 | && !commandInfo.Properties.ContainsKey(MqConsts.MqAppType)) return; 38 | var appType = Utils.GetEnum(commandInfo.Properties[MqConsts.MqAppType]); 39 | if (appType == AppType.Empty) 40 | { 41 | //不是有效的app类型 42 | return; 43 | } 44 | var data = JsonUtils.Deserialize(commandInfo.Body); 45 | if (data == null) return; 46 | //App心跳 47 | _listenerService.Initialize(commandInfo.StoreId, appType, data); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /Lfz.Core/Config/AppSettingsHelper.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 lfz 4 | * All rights reserved 5 | * 6 | * Filename :AppSettingsHelper.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2013-09-26 16:06 10 | * https://git.oschina.net/lfz 11 | * 12 | *======================================================================*/ 13 | 14 | using System.Configuration; 15 | using Lfz.Enums; 16 | 17 | namespace Lfz.Config 18 | { 19 | /// 20 | /// AppSettings值获取 21 | /// 22 | public partial class AppSettingsHelper 23 | { 24 | public static string CacheItemPrefix 25 | { 26 | get { return ConfigurationManager.AppSettings["CacheItemPrefix"]; } 27 | } 28 | 29 | 30 | /// 31 | /// 主域名 32 | /// 33 | public static string DomainAddress 34 | { 35 | get 36 | { 37 | return ConfigurationManager.AppSettings["DomainAddress"] ?? string.Empty; 38 | } 39 | } 40 | } 41 | 42 | 43 | /// 44 | /// 附件信息 45 | /// 46 | public class AttachmentInfo 47 | { 48 | private int _maxFileSize; 49 | 50 | /// 51 | /// 上传附件最大限制(MB) 52 | /// 53 | public int MaxFileSize 54 | { 55 | get 56 | { 57 | if (_maxFileSize < 0) _maxFileSize = 2; 58 | return _maxFileSize; 59 | } 60 | set { _maxFileSize = value; } 61 | } 62 | 63 | /// 64 | /// 附件允许类型,例如:*.jpg;*.gif;*.png;*.jpeg; 65 | /// 66 | public string AttachmentExtension { get; set; } 67 | 68 | /// 69 | /// 附件类型 70 | /// 71 | public AttachmentType AttachmentType { get; set; } 72 | } 73 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/DataModule.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using Autofac; 3 | using PMSoft.Data.Providers; 4 | using Module = Autofac.Module; 5 | 6 | namespace PMSoft.Data { 7 | /// 8 | /// 数据模块,提供Autofac依赖注入实现 9 | /// 10 | public class DataModule : Module { 11 | /// 12 | /// Override to add registrations to the container. 13 | /// 14 | /// 15 | /// Note that the ContainerBuilder parameter is unique to this module. 16 | /// 17 | /// The builder through which components can be 18 | /// registered. 19 | protected override void Load(ContainerBuilder builder) { 20 | builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)).InstancePerDependency(); 21 | } 22 | 23 | /// 24 | /// Override to attach module-specific functionality to a 25 | /// component registration. 26 | /// 27 | /// 28 | /// This method will be called for all existing and future component 29 | /// registrations - ordering is not important. 30 | /// 31 | /// The component registry.The registration to attach functionality to. 32 | protected override void AttachToComponentRegistration(Autofac.Core.IComponentRegistry componentRegistry, Autofac.Core.IComponentRegistration registration) { 33 | if (typeof(IDataServicesProvider).IsAssignableFrom(registration.Activator.LimitType)) { 34 | var propertyInfo = registration.Activator.LimitType.GetProperty("ProviderName", BindingFlags.Static | BindingFlags.Public); 35 | if (propertyInfo != null) { 36 | registration.Metadata["ProviderName"] = propertyInfo.GetValue(null, null); 37 | } 38 | } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Lfz.Core/Data/Providers/DataServicesProviderFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Autofac.Features.Metadata; 4 | 5 | namespace PMSoft.Data.Providers { 6 | 7 | /// 8 | /// 9 | /// 10 | /// 11 | /// 12 | public delegate IDataServicesProvider CreateDataServicesProvider(string dataFolder, string connectionString); 13 | 14 | /// 15 | /// 16 | /// 17 | public class DataServicesProviderFactory : IDataServicesProviderFactory { 18 | private readonly IEnumerable> _providers; 19 | 20 | /// 21 | /// 22 | /// 23 | /// 24 | public DataServicesProviderFactory(IEnumerable> providers) { 25 | _providers = providers; 26 | } 27 | 28 | /// 29 | /// 30 | /// 31 | /// 32 | /// 33 | public IDataServicesProvider CreateProvider(DataServiceParameters parameters) { 34 | var factory = GetProviderFactory(parameters.Provider) ?? GetProviderFactory("SqlServer"); 35 | 36 | return factory != null ? factory(parameters.DataFolder, parameters.ConnectionString) : null; 37 | } 38 | 39 | CreateDataServicesProvider GetProviderFactory(string providerName) { 40 | foreach (var providerMeta in _providers) { 41 | object name; 42 | if (!providerMeta.Metadata.TryGetValue("ProviderName", out name)) { 43 | continue; 44 | } 45 | if (string.Equals(Convert.ToString(name), providerName, StringComparison.OrdinalIgnoreCase)) { 46 | return providerMeta.Value; 47 | } 48 | } 49 | return null; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Mq/MqCommandInfo.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :MqCommandInfo.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-20 16:54 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using System; 15 | using System.Collections.Generic; 16 | using Lfz.MqListener.Shared.Models; 17 | 18 | namespace Lfz.MqListener.Mq 19 | { 20 | /// 21 | /// 22 | /// 23 | public class MqCommandInfo 24 | { 25 | /// 26 | /// 消息类型 27 | /// 28 | public NMSMessageType MessageType { get; set; } 29 | 30 | /// 31 | /// 消息类型原始字符串 32 | /// 33 | public string RawNMSType { get; set; } 34 | 35 | 36 | /// 37 | /// 消息来源门店ID(或客户端ID) 38 | /// 39 | public Guid StoreId { get; set; } 40 | 41 | /// 42 | /// 消息内容体 43 | /// 44 | public string Body { get; set; } 45 | 46 | /// 47 | /// 48 | /// 49 | public int Length { get; set; } 50 | 51 | /// 52 | /// 执行次数 53 | /// 54 | public int ExcuteCount { get; set; } 55 | 56 | /// 57 | /// 58 | /// 59 | public string NMSMessageId { get; set; } 60 | 61 | /// 62 | /// 63 | /// 64 | public string ClientId { get; set; } 65 | 66 | /// 67 | /// 68 | /// 69 | public int MqInstancId { get; set; } 70 | 71 | /// 72 | /// 属性列表 73 | /// 74 | public IDictionary Properties { get; set; } 75 | } 76 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/Service/IConfigCenterMqListenerService.cs: -------------------------------------------------------------------------------- 1 | // /*====================================================================== 2 | // * 3 | // * Copyright (C) 1996-2012 lfz 4 | // * All rights reserved 5 | // * 6 | // * Filename :IConfigCenterMqListenerService.cs 7 | // * DESCRIPTION : 8 | // * 9 | // * Created By 林芳崽 at 2016-01-26 13:54 10 | // * https://git.oschina.net/lfz 11 | // * 12 | // *======================================================================*/ 13 | 14 | using System; 15 | using Lfz.MqListener.Shared.App; 16 | using Lfz.MqListener.Shared.Enums; 17 | 18 | namespace Lfz.MqListener.Service 19 | { 20 | /// 21 | /// 22 | /// 23 | public interface IConfigCenterMqListenerService : IPerHttpRequestDependency 24 | { 25 | /// 26 | /// 开始部署 27 | /// 28 | /// 29 | void Deploy(string clientid); 30 | 31 | void UpdateStatus(string clientid, AppStatus status); 32 | 33 | /// 34 | /// 初始化监听程序(MqListener) 35 | /// 36 | /// 37 | void MqListenerInitialize(string clientid); 38 | 39 | /// 40 | /// 初始化App程序(远程客户端) 41 | /// 42 | /// 43 | /// 44 | /// 45 | void Initialize(Guid storeId, AppType appType, MqAppRegisterInfo info); 46 | 47 | /// 48 | /// 49 | /// 50 | /// 51 | bool MqListenerHeartbeat(string clientid, int totalCount, long totalMsgSize); 52 | 53 | /// 54 | /// 检测一次服务状态(做不做线清理) 55 | /// 56 | void VerifyListenStatus(AppType appType); 57 | 58 | void DownLown(string clientid); 59 | 60 | bool Heartbeat(Guid storeId, AppType appType, MqHeartbeatInfo beatinfo); 61 | 62 | } 63 | } -------------------------------------------------------------------------------- /Lfz.MqListener.Service/MqVistor/SyncTable/ComandHandler/SyncChargeCommandHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Linq; 5 | using Lfz.Data.RawSql; 6 | 7 | namespace Lfz.MqListener.MqVistor.SyncTable.ComandHandler 8 | { 9 | /// 10 | /// 11 | /// 12 | public class SyncChargeCommandHandler : ISyncTableComand 13 | { 14 | 15 | private string GetChargeNoList(DataTable table) 16 | { 17 | string result = ""; 18 | foreach (DataRow dataRow in table.Rows) 19 | { 20 | result += "," + dataRow["ChargeNo"]; 21 | } 22 | return result.Trim(','); 23 | } 24 | 25 | public void InsertOrUpdate(string tablename, Guid storeId, IRawSqlSearchService service, DataTable table, List primaryKey) 26 | { 27 | string chargeIdList = GetChargeNoList(table); 28 | var whereClause = string.Format(" WHERE ChargeNo IN({0}) and StoreId='{1}'", chargeIdList, storeId); 29 | var existsData = service.GetListWithSingleValue(tablename, whereClause, "ChargeNo", string.Empty, short.MaxValue) 30 | .Select(x => Convert.ToString(x).ToLower()).ToList(); 31 | if (!table.Columns.Contains("ChargeNo")) return; 32 | List willRemoveIndexs = new List(); 33 | for (int i = 0; i < table.Rows.Count; i++) 34 | { 35 | var item = table.Rows[i]; 36 | var chargeNo = item["ChargeNo"].ToString().ToLower(); 37 | if (existsData.Contains(chargeNo)) 38 | { 39 | willRemoveIndexs.Add(item); 40 | continue; 41 | } 42 | } 43 | foreach (var row in willRemoveIndexs) 44 | { 45 | table.Rows.Remove(row); 46 | } 47 | if (table.Rows.Count > 0) 48 | { 49 | SyncBigDataServiceHelper.BatchInsert(service.DbProviderConfig.DbConnectionString, tablename, table, table.Rows.Count); 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Lfz.Core/Data/CommandInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.SqlClient; 3 | 4 | namespace Lfz.Data 5 | { 6 | public enum EffentNextType 7 | { 8 | /// 9 | /// 对其他语句无任何影响 10 | /// 11 | None, 12 | /// 13 | /// 当前语句必须为"select count(1) from .."格式,如果存在则继续执行,不存在回滚事务 14 | /// 15 | WhenHaveContine, 16 | /// 17 | /// 当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务 18 | /// 19 | WhenNoHaveContine, 20 | /// 21 | /// 当前语句影响到的行数必须大于0,否则回滚事务 22 | /// 23 | ExcuteEffectRows, 24 | /// 25 | /// 引发事件-当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务 26 | /// 27 | SolicitationEvent 28 | } 29 | public class CommandInfo 30 | { 31 | public object ShareObject = null; 32 | public object OriginalData = null; 33 | event EventHandler _solicitationEvent; 34 | public event EventHandler SolicitationEvent 35 | { 36 | add 37 | { 38 | _solicitationEvent += value; 39 | } 40 | remove 41 | { 42 | _solicitationEvent -= value; 43 | } 44 | } 45 | public void OnSolicitationEvent() 46 | { 47 | if (_solicitationEvent != null) 48 | { 49 | _solicitationEvent(this,new EventArgs()); 50 | } 51 | } 52 | public string CommandText; 53 | public System.Data.Common.DbParameter[] Parameters; 54 | public EffentNextType EffentNextType = EffentNextType.None; 55 | public CommandInfo() 56 | { 57 | 58 | } 59 | public CommandInfo(string sqlText, SqlParameter[] para) 60 | { 61 | this.CommandText = sqlText; 62 | this.Parameters = para; 63 | } 64 | public CommandInfo(string sqlText, SqlParameter[] para, EffentNextType type) 65 | { 66 | this.CommandText = sqlText; 67 | this.Parameters = para; 68 | this.EffentNextType = type; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Lfz.Core/Security/UserNamePasswordCustomValidator.cs: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | * 3 | * Copyright (C) 1996-2012 lfz 4 | * All rights reserved 5 | * 6 | * Filename :UserNamePasswordValidator.cs 7 | * DESCRIPTION : 8 | * 9 | * Created By 林芳崽 at 2013-05-23 16:03 10 | * https://git.oschina.net/lfz 11 | * 12 | *======================================================================*/ 13 | 14 | using System.IdentityModel.Selectors; 15 | using System.IdentityModel.Tokens; 16 | 17 | namespace Lfz.Security 18 | { 19 | /// 20 | /// 授权服务 21 | /// 22 | public interface IAuthenticationService 23 | { 24 | /// 25 | /// 验证用户是否有效 26 | /// 27 | /// 28 | /// 29 | /// 30 | bool Login(string userName, string password); 31 | 32 | } 33 | 34 | public class NullAuthenticationService : IAuthenticationService 35 | { 36 | public bool Login(string userName, string password) 37 | { 38 | return true; 39 | } 40 | } 41 | 42 | /// 43 | /// 自定义用户名、密码验证器 44 | /// 45 | public class UserNamePasswordCustomValidator : UserNamePasswordValidator 46 | { 47 | private readonly IAuthenticationService _authenticationService; 48 | 49 | public UserNamePasswordCustomValidator() 50 | : this(new NullAuthenticationService()) 51 | { 52 | } 53 | 54 | public UserNamePasswordCustomValidator(IAuthenticationService authenticationService) 55 | { 56 | _authenticationService = authenticationService; 57 | } 58 | 59 | /// 60 | /// Validates the user name and password combination. 61 | /// 62 | /// The user name. 63 | /// The password. 64 | public override void Validate(string userName, string password) 65 | { 66 | if (_authenticationService.Login(userName, password)) return; 67 | throw new SecurityTokenException("用户名或者密码错误!"); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Lfz.Core/Data/Conventions/AggregateAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using FluentNHibernate.Conventions; 4 | using FluentNHibernate.Conventions.AcceptanceCriteria; 5 | using FluentNHibernate.Conventions.Inspections; 6 | using FluentNHibernate.Conventions.Instances; 7 | 8 | namespace PMSoft.Data.Conventions { 9 | /// 10 | /// This attribute is used to mark relationships which need to be eagerly fetched with the parent object, 11 | /// thus defining an aggregate in terms of DDD 12 | /// 13 | public class AggregateAttribute : Attribute { 14 | } 15 | 16 | /// 17 | /// 18 | /// 19 | public class ReferenceConvention : IReferenceConvention, IReferenceConventionAcceptance, IHasManyConvention, IHasManyConventionAcceptance { 20 | /// 21 | /// Apply changes to the target 22 | /// 23 | public void Apply(IManyToOneInstance instance) { 24 | instance.Fetch.Join(); 25 | } 26 | 27 | /// 28 | /// Whether this convention will be applied to the target. 29 | /// 30 | /// Instace that could be supplied 31 | /// 32 | /// Apply on this target? 33 | /// 34 | public void Accept(IAcceptanceCriteria criteria) { 35 | criteria.Expect(x => x.Property != null && x.Property.MemberInfo.GetCustomAttributes(typeof(AggregateAttribute), false).Any()); 36 | } 37 | 38 | /// 39 | /// Apply changes to the target 40 | /// 41 | public void Apply(IOneToManyCollectionInstance instance) { 42 | instance.Fetch.Select(); 43 | instance.Cache.ReadWrite(); 44 | } 45 | 46 | /// 47 | /// Whether this convention will be applied to the target. 48 | /// 49 | /// Instace that could be supplied 50 | /// 51 | /// Apply on this target? 52 | /// 53 | public void Accept(IAcceptanceCriteria criteria) { 54 | criteria.Expect(x => x.Member != null && x.Member.IsDefined(typeof(AggregateAttribute), false)); 55 | } 56 | } 57 | } 58 | 59 | --------------------------------------------------------------------------------