'init'
This commit is contained in:
commit
8b968e1c25
|
|
@ -0,0 +1,400 @@
|
|||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2022 cache/options directory
|
||||
.vs/
|
||||
packages/
|
||||
/.svn
|
||||
/Core.Web/Export
|
||||
/Core.Web/LogError
|
||||
LogError/
|
||||
logs/
|
||||
/Core.AuditService/Core.AuditService_TemporaryKey.pfx
|
||||
UploadFile/
|
||||
/Core.Web/logs
|
||||
/Core.Web/App_Data
|
||||
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.tlog
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
|
||||
*.vbp
|
||||
|
||||
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
|
||||
*.dsw
|
||||
*.dsp
|
||||
|
||||
# Visual Studio 6 technical files
|
||||
*.ncb
|
||||
*.aps
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# Visual Studio History (VSHistory) files
|
||||
.vshistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
|
||||
# VS Code files for those working on multiple tools
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# Windows Installer files from build outputs
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# JetBrains Rider
|
||||
*.sln.im
|
||||
.idea/
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"dotnet.preferCSharpExtension": true
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public enum Action {
|
||||
CommitMessage,
|
||||
ReconsumeLater
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{0C206585-91F4-47B1-80A6-C6B10DC5E8B2}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>AliYunSub.Common</RootNamespace>
|
||||
<AssemblyName>AliYunSub.Common</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Action.cs" />
|
||||
<Compile Include="ConsumeContext.cs" />
|
||||
<Compile Include="ConsumeOrderContext.cs" />
|
||||
<Compile Include="LocalTransactionChecker.cs" />
|
||||
<Compile Include="LocalTransactionExecuter.cs" />
|
||||
<Compile Include="Message.cs" />
|
||||
<Compile Include="MessageListener.cs" />
|
||||
<Compile Include="MessageOrderListener.cs" />
|
||||
<Compile Include="MessageQueueONS.cs" />
|
||||
<Compile Include="ONSChannel.cs" />
|
||||
<Compile Include="ONSClient4CPP.cs" />
|
||||
<Compile Include="ONSClient4CPPPINVOKE.cs" />
|
||||
<Compile Include="ONSClientException.cs" />
|
||||
<Compile Include="ONSFactory.cs" />
|
||||
<Compile Include="ONSFactoryAPI.cs" />
|
||||
<Compile Include="ONSFactoryProperty.cs" />
|
||||
<Compile Include="ONSPullStatus.cs" />
|
||||
<Compile Include="OrderAction.cs" />
|
||||
<Compile Include="OrderConsumer.cs" />
|
||||
<Compile Include="OrderProducer.cs" />
|
||||
<Compile Include="Producer.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PullConsumer.cs" />
|
||||
<Compile Include="PullResultONS.cs" />
|
||||
<Compile Include="PushConsumer.cs" />
|
||||
<Compile Include="SendResultONS.cs" />
|
||||
<Compile Include="SWIGTYPE_p_CONSTSTRING.cs" />
|
||||
<Compile Include="SWIGTYPE_p_ConsumeContext.cs" />
|
||||
<Compile Include="SWIGTYPE_p_ConsumeOrderContext.cs" />
|
||||
<Compile Include="SWIGTYPE_p_LocalTransactionChecker.cs" />
|
||||
<Compile Include="SWIGTYPE_p_Message.cs" />
|
||||
<Compile Include="SWIGTYPE_p_MessageOrderListener.cs" />
|
||||
<Compile Include="SWIGTYPE_p_MessageQueueONS.cs" />
|
||||
<Compile Include="SWIGTYPE_p_MQException.cs" />
|
||||
<Compile Include="SWIGTYPE_p_ONSClientException.cs" />
|
||||
<Compile Include="SWIGTYPE_p_ONSCLIENT_API.cs" />
|
||||
<Compile Include="SWIGTYPE_p_ons__LocalTransactionChecker.cs" />
|
||||
<Compile Include="SWIGTYPE_p_ons__OrderConsumer.cs" />
|
||||
<Compile Include="SWIGTYPE_p_ons__OrderProducer.cs" />
|
||||
<Compile Include="SWIGTYPE_p_ons__PullConsumer.cs" />
|
||||
<Compile Include="SWIGTYPE_p_ons__PushConsumer.cs" />
|
||||
<Compile Include="SWIGTYPE_p_ons__TransactionProducer.cs" />
|
||||
<Compile Include="SWIGTYPE_p_OrderConsumer.cs" />
|
||||
<Compile Include="SWIGTYPE_p_OrderProducer.cs" />
|
||||
<Compile Include="SWIGTYPE_p_PushConsumer.cs" />
|
||||
<Compile Include="SWIGTYPE_p_SendResult.cs" />
|
||||
<Compile Include="SWIGTYPE_p_SendResultONS.cs" />
|
||||
<Compile Include="SWIGTYPE_p_std__mapT_std__string_std__string_t.cs" />
|
||||
<Compile Include="SWIGTYPE_p_std__string.cs" />
|
||||
<Compile Include="SWIGTYPE_p_std__vectorT_ons__MessageQueueONS_t.cs" />
|
||||
<Compile Include="SWIGTYPE_p_std__vectorT_ons__Message_t.cs" />
|
||||
<Compile Include="SWIGTYPE_p_TransactionProducer.cs" />
|
||||
<Compile Include="SWIGTYPE_p_TransactionStatus.cs" />
|
||||
<Compile Include="SWIGTYPE_p_unsigned_char.cs" />
|
||||
<Compile Include="SystemPropKey.cs" />
|
||||
<Compile Include="TransactionProducer.cs" />
|
||||
<Compile Include="TransactionStatus.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="阿里云订阅控制台.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class ConsumeContext : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal ConsumeContext(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ConsumeContext obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~ConsumeContext() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_ConsumeContext(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public ConsumeContext() : this(ONSClient4CPPPINVOKE.new_ConsumeContext(), true) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class ConsumeOrderContext : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal ConsumeOrderContext(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ConsumeOrderContext obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~ConsumeOrderContext() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_ConsumeOrderContext(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public ConsumeOrderContext() : this(ONSClient4CPPPINVOKE.new_ConsumeOrderContext(), true) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class LocalTransactionChecker : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal LocalTransactionChecker(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LocalTransactionChecker obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~LocalTransactionChecker() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_LocalTransactionChecker(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public LocalTransactionChecker() : this(ONSClient4CPPPINVOKE.new_LocalTransactionChecker(), true) {
|
||||
SwigDirectorConnect();
|
||||
}
|
||||
|
||||
public virtual TransactionStatus check(Message msg) {
|
||||
TransactionStatus ret = (TransactionStatus)ONSClient4CPPPINVOKE.LocalTransactionChecker_check(swigCPtr, Message.getCPtr(msg));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void SwigDirectorConnect() {
|
||||
if (SwigDerivedClassHasMethod("check", swigMethodTypes0))
|
||||
swigDelegate0 = new SwigDelegateLocalTransactionChecker_0(SwigDirectorcheck);
|
||||
ONSClient4CPPPINVOKE.LocalTransactionChecker_director_connect(swigCPtr, swigDelegate0);
|
||||
}
|
||||
|
||||
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
|
||||
global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
|
||||
bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(LocalTransactionChecker));
|
||||
return hasDerivedMethod;
|
||||
}
|
||||
|
||||
private int SwigDirectorcheck(global::System.IntPtr msg) {
|
||||
return (int)check(new Message(msg, false));
|
||||
}
|
||||
|
||||
public delegate int SwigDelegateLocalTransactionChecker_0(global::System.IntPtr msg);
|
||||
|
||||
private SwigDelegateLocalTransactionChecker_0 swigDelegate0;
|
||||
|
||||
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(Message) };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class LocalTransactionExecuter : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal LocalTransactionExecuter(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LocalTransactionExecuter obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~LocalTransactionExecuter() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_LocalTransactionExecuter(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public LocalTransactionExecuter() : this(ONSClient4CPPPINVOKE.new_LocalTransactionExecuter(), true) {
|
||||
SwigDirectorConnect();
|
||||
}
|
||||
|
||||
public virtual TransactionStatus execute(Message msg) {
|
||||
TransactionStatus ret = (TransactionStatus)ONSClient4CPPPINVOKE.LocalTransactionExecuter_execute(swigCPtr, Message.getCPtr(msg));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void SwigDirectorConnect() {
|
||||
if (SwigDerivedClassHasMethod("execute", swigMethodTypes0))
|
||||
swigDelegate0 = new SwigDelegateLocalTransactionExecuter_0(SwigDirectorexecute);
|
||||
ONSClient4CPPPINVOKE.LocalTransactionExecuter_director_connect(swigCPtr, swigDelegate0);
|
||||
}
|
||||
|
||||
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
|
||||
global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
|
||||
bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(LocalTransactionExecuter));
|
||||
return hasDerivedMethod;
|
||||
}
|
||||
|
||||
private int SwigDirectorexecute(global::System.IntPtr msg) {
|
||||
return (int)execute(new Message(msg, false));
|
||||
}
|
||||
|
||||
public delegate int SwigDelegateLocalTransactionExecuter_0(global::System.IntPtr msg);
|
||||
|
||||
private SwigDelegateLocalTransactionExecuter_0 swigDelegate0;
|
||||
|
||||
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(Message) };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class Message : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal Message(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Message obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~Message() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_Message(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public Message() : this(ONSClient4CPPPINVOKE.new_Message__SWIG_0(), true) {
|
||||
}
|
||||
|
||||
public Message(string topic, string tags, string byte_body) : this(ONSClient4CPPPINVOKE.new_Message__SWIG_1(topic, tags, byte_body), true) {
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public Message(string topic, uint topic_size, string tags, uint tags_size, string body, uint body_size) : this(ONSClient4CPPPINVOKE.new_Message__SWIG_3(topic, topic_size, tags, tags_size, body, body_size), true) {
|
||||
}
|
||||
|
||||
public Message(string topic, string tags, string keys, string body) : this(ONSClient4CPPPINVOKE.new_Message__SWIG_4(topic, tags, keys, body), true) {
|
||||
}
|
||||
|
||||
public Message(Message other) : this(ONSClient4CPPPINVOKE.new_Message__SWIG_5(Message.getCPtr(other)), true) {
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public void putUserProperties(string key, string value) {
|
||||
ONSClient4CPPPINVOKE.Message_putUserProperties(swigCPtr, key, value);
|
||||
}
|
||||
|
||||
public string getUserProperties(string key) {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_getUserProperties__SWIG_0(swigCPtr, key);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setUserProperties(SWIGTYPE_p_std__mapT_std__string_std__string_t userProperty) {
|
||||
ONSClient4CPPPINVOKE.Message_setUserProperties(swigCPtr, SWIGTYPE_p_std__mapT_std__string_std__string_t.getCPtr(userProperty));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_std__mapT_std__string_std__string_t getUserProperties() {
|
||||
SWIGTYPE_p_std__mapT_std__string_std__string_t ret = new SWIGTYPE_p_std__mapT_std__string_std__string_t(ONSClient4CPPPINVOKE.Message_getUserProperties__SWIG_1(swigCPtr), true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void putSystemProperties(string key, string value) {
|
||||
ONSClient4CPPPINVOKE.Message_putSystemProperties(swigCPtr, key, value);
|
||||
}
|
||||
|
||||
public string getSystemProperties(string key) {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_getSystemProperties__SWIG_0(swigCPtr, key);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setSystemProperties(SWIGTYPE_p_std__mapT_std__string_std__string_t systemProperty) {
|
||||
ONSClient4CPPPINVOKE.Message_setSystemProperties(swigCPtr, SWIGTYPE_p_std__mapT_std__string_std__string_t.getCPtr(systemProperty));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_std__mapT_std__string_std__string_t getSystemProperties() {
|
||||
SWIGTYPE_p_std__mapT_std__string_std__string_t ret = new SWIGTYPE_p_std__mapT_std__string_std__string_t(ONSClient4CPPPINVOKE.Message_getSystemProperties__SWIG_1(swigCPtr), true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getTopic() {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_getTopic(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setTopic(string topic) {
|
||||
ONSClient4CPPPINVOKE.Message_setTopic(swigCPtr, topic);
|
||||
}
|
||||
|
||||
public string getTag() {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_getTag(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setTag(string tags) {
|
||||
ONSClient4CPPPINVOKE.Message_setTag(swigCPtr, tags);
|
||||
}
|
||||
|
||||
public string getKey() {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_getKey(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setKey(string keys) {
|
||||
ONSClient4CPPPINVOKE.Message_setKey(swigCPtr, keys);
|
||||
}
|
||||
|
||||
public string getMsgID() {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_getMsgID(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setMsgID(string msgId) {
|
||||
ONSClient4CPPPINVOKE.Message_setMsgID(swigCPtr, msgId);
|
||||
}
|
||||
|
||||
public long getStartDeliverTime() {
|
||||
long ret = ONSClient4CPPPINVOKE.Message_getStartDeliverTime(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setStartDeliverTime(long level) {
|
||||
ONSClient4CPPPINVOKE.Message_setStartDeliverTime(swigCPtr, level);
|
||||
}
|
||||
|
||||
public string getBody() {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_getBody(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getMsgBody() {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_getMsgBody(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setMsgBody(string msgbody) {
|
||||
ONSClient4CPPPINVOKE.Message_setMsgBody(swigCPtr, msgbody);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public void setBody(byte[] byte_msgbody, int len) {
|
||||
ONSClient4CPPPINVOKE.Message_setBody(swigCPtr, byte_msgbody, len);
|
||||
}
|
||||
|
||||
public int getReconsumeTimes() {
|
||||
int ret = ONSClient4CPPPINVOKE.Message_getReconsumeTimes(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setReconsumeTimes(int reconsumeTimes) {
|
||||
ONSClient4CPPPINVOKE.Message_setReconsumeTimes(swigCPtr, reconsumeTimes);
|
||||
}
|
||||
|
||||
public long getStoreTimestamp() {
|
||||
long ret = ONSClient4CPPPINVOKE.Message_getStoreTimestamp(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setStoreTimestamp(long storeTimestamp) {
|
||||
ONSClient4CPPPINVOKE.Message_setStoreTimestamp(swigCPtr, storeTimestamp);
|
||||
}
|
||||
|
||||
public string toString() {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_toString(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string toSystemString() {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_toSystemString(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string toUserString() {
|
||||
string ret = ONSClient4CPPPINVOKE.Message_toUserString(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public long getQueueOffset() {
|
||||
long ret = ONSClient4CPPPINVOKE.Message_getQueueOffset(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setQueueOffset(long queueOffset) {
|
||||
ONSClient4CPPPINVOKE.Message_setQueueOffset(swigCPtr, queueOffset);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class MessageListener : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal MessageListener(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(MessageListener obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~MessageListener() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_MessageListener(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public MessageListener() : this(ONSClient4CPPPINVOKE.new_MessageListener(), true) {
|
||||
SwigDirectorConnect();
|
||||
}
|
||||
|
||||
public virtual Action consume(Message message, ConsumeContext context) {
|
||||
Action ret = (Action)ONSClient4CPPPINVOKE.MessageListener_consume(swigCPtr, Message.getCPtr(message), ConsumeContext.getCPtr(context));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void SwigDirectorConnect() {
|
||||
if (SwigDerivedClassHasMethod("consume", swigMethodTypes0))
|
||||
swigDelegate0 = new SwigDelegateMessageListener_0(SwigDirectorconsume);
|
||||
ONSClient4CPPPINVOKE.MessageListener_director_connect(swigCPtr, swigDelegate0);
|
||||
}
|
||||
|
||||
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
|
||||
global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
|
||||
bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(MessageListener));
|
||||
return hasDerivedMethod;
|
||||
}
|
||||
|
||||
private int SwigDirectorconsume(global::System.IntPtr message, global::System.IntPtr context) {
|
||||
return (int)consume(new Message(message, false), new ConsumeContext(context, false));
|
||||
}
|
||||
|
||||
public delegate int SwigDelegateMessageListener_0(global::System.IntPtr message, global::System.IntPtr context);
|
||||
|
||||
private SwigDelegateMessageListener_0 swigDelegate0;
|
||||
|
||||
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(Message), typeof(ConsumeContext) };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class MessageOrderListener : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal MessageOrderListener(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(MessageOrderListener obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~MessageOrderListener() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_MessageOrderListener(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public MessageOrderListener() : this(ONSClient4CPPPINVOKE.new_MessageOrderListener(), true) {
|
||||
SwigDirectorConnect();
|
||||
}
|
||||
|
||||
public virtual OrderAction consume(Message message, ConsumeOrderContext context) {
|
||||
OrderAction ret = (OrderAction)ONSClient4CPPPINVOKE.MessageOrderListener_consume(swigCPtr, Message.getCPtr(message), ConsumeOrderContext.getCPtr(context));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void SwigDirectorConnect() {
|
||||
if (SwigDerivedClassHasMethod("consume", swigMethodTypes0))
|
||||
swigDelegate0 = new SwigDelegateMessageOrderListener_0(SwigDirectorconsume);
|
||||
ONSClient4CPPPINVOKE.MessageOrderListener_director_connect(swigCPtr, swigDelegate0);
|
||||
}
|
||||
|
||||
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
|
||||
global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
|
||||
bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(MessageOrderListener));
|
||||
return hasDerivedMethod;
|
||||
}
|
||||
|
||||
private int SwigDirectorconsume(global::System.IntPtr message, global::System.IntPtr context) {
|
||||
return (int)consume(new Message(message, false), new ConsumeOrderContext(context, false));
|
||||
}
|
||||
|
||||
public delegate int SwigDelegateMessageOrderListener_0(global::System.IntPtr message, global::System.IntPtr context);
|
||||
|
||||
private SwigDelegateMessageOrderListener_0 swigDelegate0;
|
||||
|
||||
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(Message), typeof(ConsumeOrderContext) };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class MessageQueueONS : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal MessageQueueONS(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(MessageQueueONS obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~MessageQueueONS() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_MessageQueueONS(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public MessageQueueONS() : this(ONSClient4CPPPINVOKE.new_MessageQueueONS__SWIG_0(), true) {
|
||||
}
|
||||
|
||||
public MessageQueueONS(string topic, string brokerName, int queueId) : this(ONSClient4CPPPINVOKE.new_MessageQueueONS__SWIG_1(topic, brokerName, queueId), true) {
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public MessageQueueONS(MessageQueueONS other) : this(ONSClient4CPPPINVOKE.new_MessageQueueONS__SWIG_2(MessageQueueONS.getCPtr(other)), true) {
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public string getTopic() {
|
||||
string ret = ONSClient4CPPPINVOKE.MessageQueueONS_getTopic(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setTopic(string topic) {
|
||||
ONSClient4CPPPINVOKE.MessageQueueONS_setTopic(swigCPtr, topic);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public string getBrokerName() {
|
||||
string ret = ONSClient4CPPPINVOKE.MessageQueueONS_getBrokerName(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setBrokerName(string brokerName) {
|
||||
ONSClient4CPPPINVOKE.MessageQueueONS_setBrokerName(swigCPtr, brokerName);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public int getQueueId() {
|
||||
int ret = ONSClient4CPPPINVOKE.MessageQueueONS_getQueueId(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setQueueId(int queueId) {
|
||||
ONSClient4CPPPINVOKE.MessageQueueONS_setQueueId(swigCPtr, queueId);
|
||||
}
|
||||
|
||||
public int compareTo(MessageQueueONS mq) {
|
||||
int ret = ONSClient4CPPPINVOKE.MessageQueueONS_compareTo(swigCPtr, MessageQueueONS.getCPtr(mq));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public enum ONSChannel {
|
||||
CLOUD,
|
||||
ALIYUN,
|
||||
ALL
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class ONSClient4CPP {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,873 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
class ONSClient4CPPPINVOKE {
|
||||
|
||||
protected class SWIGExceptionHelper {
|
||||
|
||||
public delegate void ExceptionDelegate(string message);
|
||||
public delegate void ExceptionArgumentDelegate(string message, string paramName);
|
||||
|
||||
static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException);
|
||||
static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException);
|
||||
static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException);
|
||||
static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException);
|
||||
static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException);
|
||||
static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException);
|
||||
static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException);
|
||||
static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException);
|
||||
static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException);
|
||||
static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException);
|
||||
static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException);
|
||||
|
||||
static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException);
|
||||
static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException);
|
||||
static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="SWIGRegisterExceptionCallbacks_ONSClient4CPP")]
|
||||
public static extern void SWIGRegisterExceptionCallbacks_ONSClient4CPP(
|
||||
ExceptionDelegate applicationDelegate,
|
||||
ExceptionDelegate arithmeticDelegate,
|
||||
ExceptionDelegate divideByZeroDelegate,
|
||||
ExceptionDelegate indexOutOfRangeDelegate,
|
||||
ExceptionDelegate invalidCastDelegate,
|
||||
ExceptionDelegate invalidOperationDelegate,
|
||||
ExceptionDelegate ioDelegate,
|
||||
ExceptionDelegate nullReferenceDelegate,
|
||||
ExceptionDelegate outOfMemoryDelegate,
|
||||
ExceptionDelegate overflowDelegate,
|
||||
ExceptionDelegate systemExceptionDelegate);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_ONSClient4CPP")]
|
||||
public static extern void SWIGRegisterExceptionCallbacksArgument_ONSClient4CPP(
|
||||
ExceptionArgumentDelegate argumentDelegate,
|
||||
ExceptionArgumentDelegate argumentNullDelegate,
|
||||
ExceptionArgumentDelegate argumentOutOfRangeDelegate);
|
||||
|
||||
static void SetPendingApplicationException(string message) {
|
||||
SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingArithmeticException(string message) {
|
||||
SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingDivideByZeroException(string message) {
|
||||
SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingIndexOutOfRangeException(string message) {
|
||||
SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingInvalidCastException(string message) {
|
||||
SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingInvalidOperationException(string message) {
|
||||
SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingIOException(string message) {
|
||||
SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingNullReferenceException(string message) {
|
||||
SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingOutOfMemoryException(string message) {
|
||||
SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingOverflowException(string message) {
|
||||
SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingSystemException(string message) {
|
||||
SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
|
||||
static void SetPendingArgumentException(string message, string paramName) {
|
||||
SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
|
||||
}
|
||||
static void SetPendingArgumentNullException(string message, string paramName) {
|
||||
global::System.Exception e = SWIGPendingException.Retrieve();
|
||||
if (e != null) message = message + " Inner Exception: " + e.Message;
|
||||
SWIGPendingException.Set(new global::System.ArgumentNullException(paramName, message));
|
||||
}
|
||||
static void SetPendingArgumentOutOfRangeException(string message, string paramName) {
|
||||
global::System.Exception e = SWIGPendingException.Retrieve();
|
||||
if (e != null) message = message + " Inner Exception: " + e.Message;
|
||||
SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message));
|
||||
}
|
||||
|
||||
static SWIGExceptionHelper() {
|
||||
SWIGRegisterExceptionCallbacks_ONSClient4CPP(
|
||||
applicationDelegate,
|
||||
arithmeticDelegate,
|
||||
divideByZeroDelegate,
|
||||
indexOutOfRangeDelegate,
|
||||
invalidCastDelegate,
|
||||
invalidOperationDelegate,
|
||||
ioDelegate,
|
||||
nullReferenceDelegate,
|
||||
outOfMemoryDelegate,
|
||||
overflowDelegate,
|
||||
systemDelegate);
|
||||
|
||||
SWIGRegisterExceptionCallbacksArgument_ONSClient4CPP(
|
||||
argumentDelegate,
|
||||
argumentNullDelegate,
|
||||
argumentOutOfRangeDelegate);
|
||||
}
|
||||
}
|
||||
|
||||
protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
|
||||
|
||||
public class SWIGPendingException {
|
||||
[global::System.ThreadStatic]
|
||||
private static global::System.Exception pendingException = null;
|
||||
private static int numExceptionsPending = 0;
|
||||
|
||||
public static bool Pending {
|
||||
get {
|
||||
bool pending = false;
|
||||
if (numExceptionsPending > 0)
|
||||
if (pendingException != null)
|
||||
pending = true;
|
||||
return pending;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Set(global::System.Exception e) {
|
||||
if (pendingException != null)
|
||||
throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e);
|
||||
pendingException = e;
|
||||
lock(typeof(ONSClient4CPPPINVOKE)) {
|
||||
numExceptionsPending++;
|
||||
}
|
||||
}
|
||||
|
||||
public static global::System.Exception Retrieve() {
|
||||
global::System.Exception e = null;
|
||||
if (numExceptionsPending > 0) {
|
||||
if (pendingException != null) {
|
||||
e = pendingException;
|
||||
pendingException = null;
|
||||
lock(typeof(ONSClient4CPPPINVOKE)) {
|
||||
numExceptionsPending--;
|
||||
}
|
||||
}
|
||||
}
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected class SWIGStringHelper {
|
||||
|
||||
public delegate string SWIGStringDelegate(string message);
|
||||
static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="SWIGRegisterStringCallback_ONSClient4CPP")]
|
||||
public static extern void SWIGRegisterStringCallback_ONSClient4CPP(SWIGStringDelegate stringDelegate);
|
||||
|
||||
static string CreateString(string cString) {
|
||||
return cString;
|
||||
}
|
||||
|
||||
static SWIGStringHelper() {
|
||||
SWIGRegisterStringCallback_ONSClient4CPP(stringDelegate);
|
||||
}
|
||||
}
|
||||
|
||||
static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();
|
||||
|
||||
|
||||
static ONSClient4CPPPINVOKE() {
|
||||
}
|
||||
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_SystemPropKey")]
|
||||
public static extern global::System.IntPtr new_SystemPropKey();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_SystemPropKey")]
|
||||
public static extern void delete_SystemPropKey(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SystemPropKey_TAG_set")]
|
||||
public static extern void SystemPropKey_TAG_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SystemPropKey_TAG_get")]
|
||||
public static extern string SystemPropKey_TAG_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SystemPropKey_KEY_set")]
|
||||
public static extern void SystemPropKey_KEY_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SystemPropKey_KEY_get")]
|
||||
public static extern string SystemPropKey_KEY_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SystemPropKey_MSGID_set")]
|
||||
public static extern void SystemPropKey_MSGID_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SystemPropKey_MSGID_get")]
|
||||
public static extern string SystemPropKey_MSGID_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SystemPropKey_RECONSUMETIMES_set")]
|
||||
public static extern void SystemPropKey_RECONSUMETIMES_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SystemPropKey_RECONSUMETIMES_get")]
|
||||
public static extern string SystemPropKey_RECONSUMETIMES_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SystemPropKey_STARTDELIVERTIME_set")]
|
||||
public static extern void SystemPropKey_STARTDELIVERTIME_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SystemPropKey_STARTDELIVERTIME_get")]
|
||||
public static extern string SystemPropKey_STARTDELIVERTIME_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_Message__SWIG_0")]
|
||||
public static extern global::System.IntPtr new_Message__SWIG_0();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_Message__SWIG_1")]
|
||||
public static extern global::System.IntPtr new_Message__SWIG_1(string jarg1, string jarg2, string jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_Message__SWIG_3")]
|
||||
public static extern global::System.IntPtr new_Message__SWIG_3(string jarg1, uint jarg2, string jarg3, uint jarg4, string jarg5, uint jarg6);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_Message__SWIG_4")]
|
||||
public static extern global::System.IntPtr new_Message__SWIG_4(string jarg1, string jarg2, string jarg3, string jarg4);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_Message")]
|
||||
public static extern void delete_Message(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_Message__SWIG_5")]
|
||||
public static extern global::System.IntPtr new_Message__SWIG_5(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_putUserProperties")]
|
||||
public static extern void Message_putUserProperties(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getUserProperties__SWIG_0")]
|
||||
public static extern string Message_getUserProperties__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setUserProperties")]
|
||||
public static extern void Message_setUserProperties(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getUserProperties__SWIG_1")]
|
||||
public static extern global::System.IntPtr Message_getUserProperties__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_putSystemProperties")]
|
||||
public static extern void Message_putSystemProperties(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getSystemProperties__SWIG_0")]
|
||||
public static extern string Message_getSystemProperties__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setSystemProperties")]
|
||||
public static extern void Message_setSystemProperties(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getSystemProperties__SWIG_1")]
|
||||
public static extern global::System.IntPtr Message_getSystemProperties__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getTopic")]
|
||||
public static extern string Message_getTopic(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setTopic")]
|
||||
public static extern void Message_setTopic(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getTag")]
|
||||
public static extern string Message_getTag(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setTag")]
|
||||
public static extern void Message_setTag(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getKey")]
|
||||
public static extern string Message_getKey(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setKey")]
|
||||
public static extern void Message_setKey(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getMsgID")]
|
||||
public static extern string Message_getMsgID(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setMsgID")]
|
||||
public static extern void Message_setMsgID(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getStartDeliverTime")]
|
||||
public static extern long Message_getStartDeliverTime(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setStartDeliverTime")]
|
||||
public static extern void Message_setStartDeliverTime(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getBody")]
|
||||
public static extern string Message_getBody(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getMsgBody")]
|
||||
public static extern string Message_getMsgBody(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setMsgBody")]
|
||||
public static extern void Message_setMsgBody(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setBody")]
|
||||
public static extern void Message_setBody(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]byte[] jarg2, int jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getReconsumeTimes")]
|
||||
public static extern int Message_getReconsumeTimes(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setReconsumeTimes")]
|
||||
public static extern void Message_setReconsumeTimes(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getStoreTimestamp")]
|
||||
public static extern long Message_getStoreTimestamp(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setStoreTimestamp")]
|
||||
public static extern void Message_setStoreTimestamp(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_toString")]
|
||||
public static extern string Message_toString(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_toSystemString")]
|
||||
public static extern string Message_toSystemString(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_toUserString")]
|
||||
public static extern string Message_toUserString(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_getQueueOffset")]
|
||||
public static extern long Message_getQueueOffset(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Message_setQueueOffset")]
|
||||
public static extern void Message_setQueueOffset(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_MessageQueueONS__SWIG_0")]
|
||||
public static extern global::System.IntPtr new_MessageQueueONS__SWIG_0();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_MessageQueueONS__SWIG_1")]
|
||||
public static extern global::System.IntPtr new_MessageQueueONS__SWIG_1(string jarg1, string jarg2, int jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_MessageQueueONS__SWIG_2")]
|
||||
public static extern global::System.IntPtr new_MessageQueueONS__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageQueueONS_getTopic")]
|
||||
public static extern string MessageQueueONS_getTopic(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageQueueONS_setTopic")]
|
||||
public static extern void MessageQueueONS_setTopic(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageQueueONS_getBrokerName")]
|
||||
public static extern string MessageQueueONS_getBrokerName(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageQueueONS_setBrokerName")]
|
||||
public static extern void MessageQueueONS_setBrokerName(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageQueueONS_getQueueId")]
|
||||
public static extern int MessageQueueONS_getQueueId(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageQueueONS_setQueueId")]
|
||||
public static extern void MessageQueueONS_setQueueId(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageQueueONS_compareTo")]
|
||||
public static extern int MessageQueueONS_compareTo(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_MessageQueueONS")]
|
||||
public static extern void delete_MessageQueueONS(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_ONSClientException__SWIG_0")]
|
||||
public static extern global::System.IntPtr new_ONSClientException__SWIG_0();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_ONSClientException")]
|
||||
public static extern void delete_ONSClientException(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_ONSClientException__SWIG_1")]
|
||||
public static extern global::System.IntPtr new_ONSClientException__SWIG_1(string jarg1, int jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSClientException_GetMsg")]
|
||||
public static extern string ONSClientException_GetMsg(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSClientException_what")]
|
||||
public static extern string ONSClientException_what(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSClientException_GetError")]
|
||||
public static extern int ONSClientException_GetError(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_SendResultONS")]
|
||||
public static extern global::System.IntPtr new_SendResultONS();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_SendResultONS")]
|
||||
public static extern void delete_SendResultONS(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SendResultONS_setMessageId")]
|
||||
public static extern void SendResultONS_setMessageId(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_SendResultONS_getMessageId")]
|
||||
public static extern string SendResultONS_getMessageId(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_PullResultONS__SWIG_0")]
|
||||
public static extern global::System.IntPtr new_PullResultONS__SWIG_0(int jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_PullResultONS__SWIG_1")]
|
||||
public static extern global::System.IntPtr new_PullResultONS__SWIG_1(int jarg1, long jarg2, long jarg3, long jarg4);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_PullResultONS")]
|
||||
public static extern void delete_PullResultONS(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullResultONS_pullStatus_set")]
|
||||
public static extern void PullResultONS_pullStatus_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullResultONS_pullStatus_get")]
|
||||
public static extern int PullResultONS_pullStatus_get(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullResultONS_nextBeginOffset_set")]
|
||||
public static extern void PullResultONS_nextBeginOffset_set(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullResultONS_nextBeginOffset_get")]
|
||||
public static extern long PullResultONS_nextBeginOffset_get(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullResultONS_minOffset_set")]
|
||||
public static extern void PullResultONS_minOffset_set(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullResultONS_minOffset_get")]
|
||||
public static extern long PullResultONS_minOffset_get(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullResultONS_maxOffset_set")]
|
||||
public static extern void PullResultONS_maxOffset_set(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullResultONS_maxOffset_get")]
|
||||
public static extern long PullResultONS_maxOffset_get(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullResultONS_msgFoundList_set")]
|
||||
public static extern void PullResultONS_msgFoundList_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullResultONS_msgFoundList_get")]
|
||||
public static extern global::System.IntPtr PullResultONS_msgFoundList_get(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_ConsumeContext")]
|
||||
public static extern global::System.IntPtr new_ConsumeContext();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_ConsumeContext")]
|
||||
public static extern void delete_ConsumeContext(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_ConsumeOrderContext")]
|
||||
public static extern global::System.IntPtr new_ConsumeOrderContext();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_ConsumeOrderContext")]
|
||||
public static extern void delete_ConsumeOrderContext(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_MessageOrderListener")]
|
||||
public static extern global::System.IntPtr new_MessageOrderListener();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_MessageOrderListener")]
|
||||
public static extern void delete_MessageOrderListener(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageOrderListener_consume")]
|
||||
public static extern int MessageOrderListener_consume(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageOrderListener_director_connect")]
|
||||
public static extern void MessageOrderListener_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, MessageOrderListener.SwigDelegateMessageOrderListener_0 delegate0);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_MessageListener")]
|
||||
public static extern global::System.IntPtr new_MessageListener();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_MessageListener")]
|
||||
public static extern void delete_MessageListener(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageListener_consume")]
|
||||
public static extern int MessageListener_consume(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_MessageListener_director_connect")]
|
||||
public static extern void MessageListener_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, MessageListener.SwigDelegateMessageListener_0 delegate0);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_LocalTransactionChecker")]
|
||||
public static extern global::System.IntPtr new_LocalTransactionChecker();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_LocalTransactionChecker_check")]
|
||||
public static extern int LocalTransactionChecker_check(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_LocalTransactionChecker")]
|
||||
public static extern void delete_LocalTransactionChecker(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_LocalTransactionChecker_director_connect")]
|
||||
public static extern void LocalTransactionChecker_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, LocalTransactionChecker.SwigDelegateLocalTransactionChecker_0 delegate0);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_LocalTransactionExecuter")]
|
||||
public static extern global::System.IntPtr new_LocalTransactionExecuter();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_LocalTransactionExecuter_execute")]
|
||||
public static extern int LocalTransactionExecuter_execute(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_LocalTransactionExecuter")]
|
||||
public static extern void delete_LocalTransactionExecuter(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_LocalTransactionExecuter_director_connect")]
|
||||
public static extern void LocalTransactionExecuter_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, LocalTransactionExecuter.SwigDelegateLocalTransactionExecuter_0 delegate0);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_Producer")]
|
||||
public static extern global::System.IntPtr new_Producer();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_Producer")]
|
||||
public static extern void delete_Producer(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Producer_start")]
|
||||
public static extern void Producer_start(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Producer_shutdown")]
|
||||
public static extern void Producer_shutdown(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Producer_send__SWIG_0")]
|
||||
public static extern global::System.IntPtr Producer_send__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Producer_send__SWIG_1")]
|
||||
public static extern global::System.IntPtr Producer_send__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Producer_sendOneway")]
|
||||
public static extern void Producer_sendOneway(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_Producer_director_connect")]
|
||||
public static extern void Producer_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, Producer.SwigDelegateProducer_0 delegate0, Producer.SwigDelegateProducer_1 delegate1, Producer.SwigDelegateProducer_2 delegate2, Producer.SwigDelegateProducer_3 delegate3, Producer.SwigDelegateProducer_4 delegate4);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_OrderConsumer")]
|
||||
public static extern global::System.IntPtr new_OrderConsumer();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_OrderConsumer")]
|
||||
public static extern void delete_OrderConsumer(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_OrderConsumer_start")]
|
||||
public static extern void OrderConsumer_start(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_OrderConsumer_shutdown")]
|
||||
public static extern void OrderConsumer_shutdown(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_OrderConsumer_subscribe")]
|
||||
public static extern void OrderConsumer_subscribe(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, global::System.Runtime.InteropServices.HandleRef jarg4);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_OrderConsumer_director_connect")]
|
||||
public static extern void OrderConsumer_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, OrderConsumer.SwigDelegateOrderConsumer_0 delegate0, OrderConsumer.SwigDelegateOrderConsumer_1 delegate1, OrderConsumer.SwigDelegateOrderConsumer_2 delegate2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_OrderProducer")]
|
||||
public static extern global::System.IntPtr new_OrderProducer();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_OrderProducer")]
|
||||
public static extern void delete_OrderProducer(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_OrderProducer_start")]
|
||||
public static extern void OrderProducer_start(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_OrderProducer_shutdown")]
|
||||
public static extern void OrderProducer_shutdown(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_OrderProducer_send")]
|
||||
public static extern global::System.IntPtr OrderProducer_send(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, string jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_OrderProducer_director_connect")]
|
||||
public static extern void OrderProducer_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, OrderProducer.SwigDelegateOrderProducer_0 delegate0, OrderProducer.SwigDelegateOrderProducer_1 delegate1, OrderProducer.SwigDelegateOrderProducer_2 delegate2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_PushConsumer")]
|
||||
public static extern global::System.IntPtr new_PushConsumer();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_PushConsumer")]
|
||||
public static extern void delete_PushConsumer(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PushConsumer_start")]
|
||||
public static extern void PushConsumer_start(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PushConsumer_shutdown")]
|
||||
public static extern void PushConsumer_shutdown(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PushConsumer_subscribe")]
|
||||
public static extern void PushConsumer_subscribe(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, global::System.Runtime.InteropServices.HandleRef jarg4);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PushConsumer_director_connect")]
|
||||
public static extern void PushConsumer_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, PushConsumer.SwigDelegatePushConsumer_0 delegate0, PushConsumer.SwigDelegatePushConsumer_1 delegate1, PushConsumer.SwigDelegatePushConsumer_2 delegate2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_PullConsumer")]
|
||||
public static extern global::System.IntPtr new_PullConsumer();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_PullConsumer")]
|
||||
public static extern void delete_PullConsumer(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_start")]
|
||||
public static extern void PullConsumer_start(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_shutdown")]
|
||||
public static extern void PullConsumer_shutdown(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_fetchSubscribeMessageQueues")]
|
||||
public static extern void PullConsumer_fetchSubscribeMessageQueues(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_pull")]
|
||||
public static extern global::System.IntPtr PullConsumer_pull(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, string jarg3, long jarg4, int jarg5);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_searchOffset")]
|
||||
public static extern long PullConsumer_searchOffset(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, long jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_maxOffset")]
|
||||
public static extern long PullConsumer_maxOffset(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_minOffset")]
|
||||
public static extern long PullConsumer_minOffset(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_updateConsumeOffset")]
|
||||
public static extern void PullConsumer_updateConsumeOffset(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, long jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_removeConsumeOffset")]
|
||||
public static extern void PullConsumer_removeConsumeOffset(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_fetchConsumeOffset")]
|
||||
public static extern long PullConsumer_fetchConsumeOffset(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, bool jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_persistConsumerOffset4PullConsumer")]
|
||||
public static extern void PullConsumer_persistConsumerOffset4PullConsumer(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_PullConsumer_director_connect")]
|
||||
public static extern void PullConsumer_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, PullConsumer.SwigDelegatePullConsumer_0 delegate0, PullConsumer.SwigDelegatePullConsumer_1 delegate1, PullConsumer.SwigDelegatePullConsumer_2 delegate2, PullConsumer.SwigDelegatePullConsumer_3 delegate3, PullConsumer.SwigDelegatePullConsumer_4 delegate4, PullConsumer.SwigDelegatePullConsumer_5 delegate5, PullConsumer.SwigDelegatePullConsumer_6 delegate6, PullConsumer.SwigDelegatePullConsumer_7 delegate7, PullConsumer.SwigDelegatePullConsumer_8 delegate8, PullConsumer.SwigDelegatePullConsumer_9 delegate9, PullConsumer.SwigDelegatePullConsumer_10 delegate10);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_TransactionProducer")]
|
||||
public static extern void delete_TransactionProducer(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_TransactionProducer_start")]
|
||||
public static extern void TransactionProducer_start(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_TransactionProducer_shutdown")]
|
||||
public static extern void TransactionProducer_shutdown(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_TransactionProducer_send")]
|
||||
public static extern global::System.IntPtr TransactionProducer_send(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_ONSFactoryProperty")]
|
||||
public static extern global::System.IntPtr new_ONSFactoryProperty();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_ONSFactoryProperty")]
|
||||
public static extern void delete_ONSFactoryProperty(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_checkValidityOfFactoryProperties")]
|
||||
public static extern bool ONSFactoryProperty_checkValidityOfFactoryProperties(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getLogPath")]
|
||||
public static extern string ONSFactoryProperty_getLogPath(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_setSendMsgTimeout")]
|
||||
public static extern void ONSFactoryProperty_setSendMsgTimeout(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_setSendMsgRetryTimes")]
|
||||
public static extern void ONSFactoryProperty_setSendMsgRetryTimes(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_setMaxMsgCacheSize")]
|
||||
public static extern void ONSFactoryProperty_setMaxMsgCacheSize(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_setOnsTraceSwitch")]
|
||||
public static extern void ONSFactoryProperty_setOnsTraceSwitch(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_setOnsChannel")]
|
||||
public static extern void ONSFactoryProperty_setOnsChannel(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_setFactoryProperty")]
|
||||
public static extern void ONSFactoryProperty_setFactoryProperty(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_setFactoryProperties")]
|
||||
public static extern void ONSFactoryProperty_setFactoryProperties(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getFactoryProperties")]
|
||||
public static extern global::System.IntPtr ONSFactoryProperty_getFactoryProperties(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getProducerId")]
|
||||
public static extern string ONSFactoryProperty_getProducerId(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getConsumerId")]
|
||||
public static extern string ONSFactoryProperty_getConsumerId(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getPublishTopics")]
|
||||
public static extern string ONSFactoryProperty_getPublishTopics(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getMessageModel")]
|
||||
public static extern string ONSFactoryProperty_getMessageModel(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getSendMsgTimeout")]
|
||||
public static extern int ONSFactoryProperty_getSendMsgTimeout(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getSendMsgRetryTimes")]
|
||||
public static extern int ONSFactoryProperty_getSendMsgRetryTimes(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getConsumeThreadNums")]
|
||||
public static extern int ONSFactoryProperty_getConsumeThreadNums(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getMaxMsgCacheSize")]
|
||||
public static extern int ONSFactoryProperty_getMaxMsgCacheSize(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getOnsChannel")]
|
||||
public static extern int ONSFactoryProperty_getOnsChannel(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getChannel")]
|
||||
public static extern string ONSFactoryProperty_getChannel(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getMessageContent")]
|
||||
public static extern string ONSFactoryProperty_getMessageContent(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getNameSrvAddr")]
|
||||
public static extern string ONSFactoryProperty_getNameSrvAddr(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getNameSrvDomain")]
|
||||
public static extern string ONSFactoryProperty_getNameSrvDomain(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getAccessKey")]
|
||||
public static extern string ONSFactoryProperty_getAccessKey(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getSecretKey")]
|
||||
public static extern string ONSFactoryProperty_getSecretKey(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getConsumerInstanceName")]
|
||||
public static extern string ONSFactoryProperty_getConsumerInstanceName(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getOnsTraceSwitch")]
|
||||
public static extern bool ONSFactoryProperty_getOnsTraceSwitch(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_getNameSpace")]
|
||||
public static extern string ONSFactoryProperty_getNameSpace(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_LogPath_set")]
|
||||
public static extern void ONSFactoryProperty_LogPath_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_LogPath_get")]
|
||||
public static extern string ONSFactoryProperty_LogPath_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_ProducerId_set")]
|
||||
public static extern void ONSFactoryProperty_ProducerId_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_ProducerId_get")]
|
||||
public static extern string ONSFactoryProperty_ProducerId_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_ConsumerId_set")]
|
||||
public static extern void ONSFactoryProperty_ConsumerId_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_ConsumerId_get")]
|
||||
public static extern string ONSFactoryProperty_ConsumerId_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_PublishTopics_set")]
|
||||
public static extern void ONSFactoryProperty_PublishTopics_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_PublishTopics_get")]
|
||||
public static extern string ONSFactoryProperty_PublishTopics_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_MsgContent_set")]
|
||||
public static extern void ONSFactoryProperty_MsgContent_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_MsgContent_get")]
|
||||
public static extern string ONSFactoryProperty_MsgContent_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_ONSAddr_set")]
|
||||
public static extern void ONSFactoryProperty_ONSAddr_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_ONSAddr_get")]
|
||||
public static extern string ONSFactoryProperty_ONSAddr_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_AccessKey_set")]
|
||||
public static extern void ONSFactoryProperty_AccessKey_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_AccessKey_get")]
|
||||
public static extern string ONSFactoryProperty_AccessKey_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_SecretKey_set")]
|
||||
public static extern void ONSFactoryProperty_SecretKey_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_SecretKey_get")]
|
||||
public static extern string ONSFactoryProperty_SecretKey_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_MessageModel_set")]
|
||||
public static extern void ONSFactoryProperty_MessageModel_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_MessageModel_get")]
|
||||
public static extern string ONSFactoryProperty_MessageModel_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_BROADCASTING_set")]
|
||||
public static extern void ONSFactoryProperty_BROADCASTING_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_BROADCASTING_get")]
|
||||
public static extern string ONSFactoryProperty_BROADCASTING_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_CLUSTERING_set")]
|
||||
public static extern void ONSFactoryProperty_CLUSTERING_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_CLUSTERING_get")]
|
||||
public static extern string ONSFactoryProperty_CLUSTERING_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_SendMsgTimeoutMillis_set")]
|
||||
public static extern void ONSFactoryProperty_SendMsgTimeoutMillis_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_SendMsgTimeoutMillis_get")]
|
||||
public static extern string ONSFactoryProperty_SendMsgTimeoutMillis_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_NAMESRV_ADDR_set")]
|
||||
public static extern void ONSFactoryProperty_NAMESRV_ADDR_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_NAMESRV_ADDR_get")]
|
||||
public static extern string ONSFactoryProperty_NAMESRV_ADDR_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_ConsumeThreadNums_set")]
|
||||
public static extern void ONSFactoryProperty_ConsumeThreadNums_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_ConsumeThreadNums_get")]
|
||||
public static extern string ONSFactoryProperty_ConsumeThreadNums_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_OnsChannel_set")]
|
||||
public static extern void ONSFactoryProperty_OnsChannel_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_OnsChannel_get")]
|
||||
public static extern string ONSFactoryProperty_OnsChannel_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_MaxMsgCacheSize_set")]
|
||||
public static extern void ONSFactoryProperty_MaxMsgCacheSize_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_MaxMsgCacheSize_get")]
|
||||
public static extern string ONSFactoryProperty_MaxMsgCacheSize_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_OnsTraceSwitch_set")]
|
||||
public static extern void ONSFactoryProperty_OnsTraceSwitch_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_OnsTraceSwitch_get")]
|
||||
public static extern string ONSFactoryProperty_OnsTraceSwitch_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_SendMsgRetryTimes_set")]
|
||||
public static extern void ONSFactoryProperty_SendMsgRetryTimes_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_SendMsgRetryTimes_get")]
|
||||
public static extern string ONSFactoryProperty_SendMsgRetryTimes_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_ConsumerInstanceName_set")]
|
||||
public static extern void ONSFactoryProperty_ConsumerInstanceName_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_ConsumerInstanceName_get")]
|
||||
public static extern string ONSFactoryProperty_ConsumerInstanceName_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_InstanceId_set")]
|
||||
public static extern void ONSFactoryProperty_InstanceId_set(string jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryProperty_InstanceId_get")]
|
||||
public static extern string ONSFactoryProperty_InstanceId_get();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_new_ONSFactoryAPI")]
|
||||
public static extern global::System.IntPtr new_ONSFactoryAPI();
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_ONSFactoryAPI")]
|
||||
public static extern void delete_ONSFactoryAPI(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryAPI_createProducer")]
|
||||
public static extern global::System.IntPtr ONSFactoryAPI_createProducer(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryAPI_createOrderProducer")]
|
||||
public static extern global::System.IntPtr ONSFactoryAPI_createOrderProducer(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryAPI_createOrderConsumer")]
|
||||
public static extern global::System.IntPtr ONSFactoryAPI_createOrderConsumer(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryAPI_createTransactionProducer")]
|
||||
public static extern global::System.IntPtr ONSFactoryAPI_createTransactionProducer(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryAPI_createPullConsumer")]
|
||||
public static extern global::System.IntPtr ONSFactoryAPI_createPullConsumer(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactoryAPI_createPushConsumer")]
|
||||
public static extern global::System.IntPtr ONSFactoryAPI_createPushConsumer(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_delete_ONSFactory")]
|
||||
public static extern void delete_ONSFactory(global::System.Runtime.InteropServices.HandleRef jarg1);
|
||||
|
||||
[global::System.Runtime.InteropServices.DllImport("ONSClient4CPP", EntryPoint="CSharp_ons_ONSFactory_getInstance")]
|
||||
public static extern global::System.IntPtr ONSFactory_getInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class ONSClientException : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal ONSClientException(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ONSClientException obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~ONSClientException() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_ONSClientException(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public ONSClientException() : this(ONSClient4CPPPINVOKE.new_ONSClientException__SWIG_0(), true) {
|
||||
}
|
||||
|
||||
public ONSClientException(string msg, int error) : this(ONSClient4CPPPINVOKE.new_ONSClientException__SWIG_1(msg, error), true) {
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public string GetMsg() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSClientException_GetMsg(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string what() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSClientException_what(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int GetError() {
|
||||
int ret = ONSClient4CPPPINVOKE.ONSClientException_GetError(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class ONSFactory : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal ONSFactory(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ONSFactory obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~ONSFactory() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_ONSFactory(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public static ONSFactoryAPI getInstance() {
|
||||
global::System.IntPtr cPtr = ONSClient4CPPPINVOKE.ONSFactory_getInstance();
|
||||
ONSFactoryAPI ret = (cPtr == global::System.IntPtr.Zero) ? null : new ONSFactoryAPI(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class ONSFactoryAPI : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal ONSFactoryAPI(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ONSFactoryAPI obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~ONSFactoryAPI() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_ONSFactoryAPI(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public ONSFactoryAPI() : this(ONSClient4CPPPINVOKE.new_ONSFactoryAPI(), true) {
|
||||
}
|
||||
|
||||
public virtual Producer createProducer(ONSFactoryProperty factoryProperty) {
|
||||
global::System.IntPtr cPtr = ONSClient4CPPPINVOKE.ONSFactoryAPI_createProducer(swigCPtr, ONSFactoryProperty.getCPtr(factoryProperty));
|
||||
Producer ret = (cPtr == global::System.IntPtr.Zero) ? null : new Producer(cPtr, false);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual OrderProducer createOrderProducer(ONSFactoryProperty factoryProperty) {
|
||||
global::System.IntPtr cPtr = ONSClient4CPPPINVOKE.ONSFactoryAPI_createOrderProducer(swigCPtr, ONSFactoryProperty.getCPtr(factoryProperty));
|
||||
OrderProducer ret = (cPtr == global::System.IntPtr.Zero) ? null : new OrderProducer(cPtr, false);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual OrderConsumer createOrderConsumer(ONSFactoryProperty factoryProperty) {
|
||||
global::System.IntPtr cPtr = ONSClient4CPPPINVOKE.ONSFactoryAPI_createOrderConsumer(swigCPtr, ONSFactoryProperty.getCPtr(factoryProperty));
|
||||
OrderConsumer ret = (cPtr == global::System.IntPtr.Zero) ? null : new OrderConsumer(cPtr, false);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual TransactionProducer createTransactionProducer(ONSFactoryProperty factoryProperty, LocalTransactionChecker checker) {
|
||||
global::System.IntPtr cPtr = ONSClient4CPPPINVOKE.ONSFactoryAPI_createTransactionProducer(swigCPtr, ONSFactoryProperty.getCPtr(factoryProperty), LocalTransactionChecker.getCPtr(checker));
|
||||
TransactionProducer ret = (cPtr == global::System.IntPtr.Zero) ? null : new TransactionProducer(cPtr, false);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual PullConsumer createPullConsumer(ONSFactoryProperty factoryProperty) {
|
||||
global::System.IntPtr cPtr = ONSClient4CPPPINVOKE.ONSFactoryAPI_createPullConsumer(swigCPtr, ONSFactoryProperty.getCPtr(factoryProperty));
|
||||
PullConsumer ret = (cPtr == global::System.IntPtr.Zero) ? null : new PullConsumer(cPtr, false);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual PushConsumer createPushConsumer(ONSFactoryProperty factoryProperty) {
|
||||
global::System.IntPtr cPtr = ONSClient4CPPPINVOKE.ONSFactoryAPI_createPushConsumer(swigCPtr, ONSFactoryProperty.getCPtr(factoryProperty));
|
||||
PushConsumer ret = (cPtr == global::System.IntPtr.Zero) ? null : new PushConsumer(cPtr, false);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,385 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class ONSFactoryProperty : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal ONSFactoryProperty(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ONSFactoryProperty obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~ONSFactoryProperty() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_ONSFactoryProperty(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public ONSFactoryProperty() : this(ONSClient4CPPPINVOKE.new_ONSFactoryProperty(), true) {
|
||||
}
|
||||
|
||||
public bool checkValidityOfFactoryProperties(string key, string value) {
|
||||
bool ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_checkValidityOfFactoryProperties(swigCPtr, key, value);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getLogPath() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getLogPath(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setSendMsgTimeout(int value) {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_setSendMsgTimeout(swigCPtr, value);
|
||||
}
|
||||
|
||||
public void setSendMsgRetryTimes(int value) {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_setSendMsgRetryTimes(swigCPtr, value);
|
||||
}
|
||||
|
||||
public void setMaxMsgCacheSize(int size) {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_setMaxMsgCacheSize(swigCPtr, size);
|
||||
}
|
||||
|
||||
public void setOnsTraceSwitch(bool onswitch) {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_setOnsTraceSwitch(swigCPtr, onswitch);
|
||||
}
|
||||
|
||||
public void setOnsChannel(ONSChannel onsChannel) {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_setOnsChannel(swigCPtr, (int)onsChannel);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public void setFactoryProperty(string key, string value) {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_setFactoryProperty(swigCPtr, key, value);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public void setFactoryProperties(SWIGTYPE_p_std__mapT_std__string_std__string_t factoryProperties) {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_setFactoryProperties(swigCPtr, SWIGTYPE_p_std__mapT_std__string_std__string_t.getCPtr(factoryProperties));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_std__mapT_std__string_std__string_t getFactoryProperties() {
|
||||
SWIGTYPE_p_std__mapT_std__string_std__string_t ret = new SWIGTYPE_p_std__mapT_std__string_std__string_t(ONSClient4CPPPINVOKE.ONSFactoryProperty_getFactoryProperties(swigCPtr), true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getProducerId() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getProducerId(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getConsumerId() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getConsumerId(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getPublishTopics() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getPublishTopics(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getMessageModel() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getMessageModel(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int getSendMsgTimeout() {
|
||||
int ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getSendMsgTimeout(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int getSendMsgRetryTimes() {
|
||||
int ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getSendMsgRetryTimes(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int getConsumeThreadNums() {
|
||||
int ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getConsumeThreadNums(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int getMaxMsgCacheSize() {
|
||||
int ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getMaxMsgCacheSize(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public ONSChannel getOnsChannel() {
|
||||
ONSChannel ret = (ONSChannel)ONSClient4CPPPINVOKE.ONSFactoryProperty_getOnsChannel(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getChannel() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getChannel(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getMessageContent() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getMessageContent(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getNameSrvAddr() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getNameSrvAddr(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getNameSrvDomain() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getNameSrvDomain(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getAccessKey() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getAccessKey(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getSecretKey() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getSecretKey(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getConsumerInstanceName() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getConsumerInstanceName(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool getOnsTraceSwitch() {
|
||||
bool ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getOnsTraceSwitch(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string getNameSpace() {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_getNameSpace(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string LogPath {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_LogPath_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_LogPath_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ProducerId {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_ProducerId_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_ProducerId_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ConsumerId {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_ConsumerId_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_ConsumerId_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string PublishTopics {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_PublishTopics_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_PublishTopics_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string MsgContent {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_MsgContent_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_MsgContent_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ONSAddr {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_ONSAddr_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_ONSAddr_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string AccessKey {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_AccessKey_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_AccessKey_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string SecretKey {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_SecretKey_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_SecretKey_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string MessageModel {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_MessageModel_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_MessageModel_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string BROADCASTING {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_BROADCASTING_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_BROADCASTING_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string CLUSTERING {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_CLUSTERING_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_CLUSTERING_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string SendMsgTimeoutMillis {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_SendMsgTimeoutMillis_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_SendMsgTimeoutMillis_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string NAMESRV_ADDR {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_NAMESRV_ADDR_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_NAMESRV_ADDR_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ConsumeThreadNums {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_ConsumeThreadNums_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_ConsumeThreadNums_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string OnsChannel {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_OnsChannel_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_OnsChannel_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string MaxMsgCacheSize {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_MaxMsgCacheSize_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_MaxMsgCacheSize_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string OnsTraceSwitch {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_OnsTraceSwitch_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_OnsTraceSwitch_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string SendMsgRetryTimes {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_SendMsgRetryTimes_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_SendMsgRetryTimes_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ConsumerInstanceName {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_ConsumerInstanceName_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_ConsumerInstanceName_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string InstanceId {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.ONSFactoryProperty_InstanceId_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.ONSFactoryProperty_InstanceId_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public enum ONSPullStatus {
|
||||
ONS_FOUND,
|
||||
ONS_NO_NEW_MSG,
|
||||
ONS_NO_MATCHED_MSG,
|
||||
ONS_OFFSET_ILLEGAL,
|
||||
ONS_BROKER_TIMEOUT
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public enum OrderAction {
|
||||
Success,
|
||||
Suspend
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class OrderConsumer : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal OrderConsumer(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(OrderConsumer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~OrderConsumer() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_OrderConsumer(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public OrderConsumer() : this(ONSClient4CPPPINVOKE.new_OrderConsumer(), true) {
|
||||
SwigDirectorConnect();
|
||||
}
|
||||
|
||||
public virtual void start() {
|
||||
ONSClient4CPPPINVOKE.OrderConsumer_start(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual void shutdown() {
|
||||
ONSClient4CPPPINVOKE.OrderConsumer_shutdown(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual void subscribe(string topic, string subExpression, MessageOrderListener listener) {
|
||||
ONSClient4CPPPINVOKE.OrderConsumer_subscribe(swigCPtr, topic, subExpression, MessageOrderListener.getCPtr(listener));
|
||||
}
|
||||
|
||||
private void SwigDirectorConnect() {
|
||||
if (SwigDerivedClassHasMethod("start", swigMethodTypes0))
|
||||
swigDelegate0 = new SwigDelegateOrderConsumer_0(SwigDirectorstart);
|
||||
if (SwigDerivedClassHasMethod("shutdown", swigMethodTypes1))
|
||||
swigDelegate1 = new SwigDelegateOrderConsumer_1(SwigDirectorshutdown);
|
||||
if (SwigDerivedClassHasMethod("subscribe", swigMethodTypes2))
|
||||
swigDelegate2 = new SwigDelegateOrderConsumer_2(SwigDirectorsubscribe);
|
||||
ONSClient4CPPPINVOKE.OrderConsumer_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2);
|
||||
}
|
||||
|
||||
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
|
||||
global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
|
||||
bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(OrderConsumer));
|
||||
return hasDerivedMethod;
|
||||
}
|
||||
|
||||
private void SwigDirectorstart() {
|
||||
start();
|
||||
}
|
||||
|
||||
private void SwigDirectorshutdown() {
|
||||
shutdown();
|
||||
}
|
||||
|
||||
private void SwigDirectorsubscribe(string topic, string subExpression, global::System.IntPtr listener) {
|
||||
subscribe(topic, subExpression, (listener == global::System.IntPtr.Zero) ? null : new MessageOrderListener(listener, false));
|
||||
}
|
||||
|
||||
public delegate void SwigDelegateOrderConsumer_0();
|
||||
public delegate void SwigDelegateOrderConsumer_1();
|
||||
public delegate void SwigDelegateOrderConsumer_2(string topic, string subExpression, global::System.IntPtr listener);
|
||||
|
||||
private SwigDelegateOrderConsumer_0 swigDelegate0;
|
||||
private SwigDelegateOrderConsumer_1 swigDelegate1;
|
||||
private SwigDelegateOrderConsumer_2 swigDelegate2;
|
||||
|
||||
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
|
||||
private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { };
|
||||
private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(string), typeof(string), typeof(MessageOrderListener) };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class OrderProducer : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal OrderProducer(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(OrderProducer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~OrderProducer() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_OrderProducer(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public OrderProducer() : this(ONSClient4CPPPINVOKE.new_OrderProducer(), true) {
|
||||
SwigDirectorConnect();
|
||||
}
|
||||
|
||||
public virtual void start() {
|
||||
ONSClient4CPPPINVOKE.OrderProducer_start(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual void shutdown() {
|
||||
ONSClient4CPPPINVOKE.OrderProducer_shutdown(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual SendResultONS send(Message msg, string shardingKey) {
|
||||
SendResultONS ret = new SendResultONS(ONSClient4CPPPINVOKE.OrderProducer_send(swigCPtr, Message.getCPtr(msg), shardingKey), true);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void SwigDirectorConnect() {
|
||||
if (SwigDerivedClassHasMethod("start", swigMethodTypes0))
|
||||
swigDelegate0 = new SwigDelegateOrderProducer_0(SwigDirectorstart);
|
||||
if (SwigDerivedClassHasMethod("shutdown", swigMethodTypes1))
|
||||
swigDelegate1 = new SwigDelegateOrderProducer_1(SwigDirectorshutdown);
|
||||
if (SwigDerivedClassHasMethod("send", swigMethodTypes2))
|
||||
swigDelegate2 = new SwigDelegateOrderProducer_2(SwigDirectorsend);
|
||||
ONSClient4CPPPINVOKE.OrderProducer_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2);
|
||||
}
|
||||
|
||||
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
|
||||
global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
|
||||
bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(OrderProducer));
|
||||
return hasDerivedMethod;
|
||||
}
|
||||
|
||||
private void SwigDirectorstart() {
|
||||
start();
|
||||
}
|
||||
|
||||
private void SwigDirectorshutdown() {
|
||||
shutdown();
|
||||
}
|
||||
|
||||
private global::System.IntPtr SwigDirectorsend(global::System.IntPtr msg, string shardingKey) {
|
||||
return SendResultONS.getCPtr(send(new Message(msg, false), shardingKey)).Handle;
|
||||
}
|
||||
|
||||
public delegate void SwigDelegateOrderProducer_0();
|
||||
public delegate void SwigDelegateOrderProducer_1();
|
||||
public delegate global::System.IntPtr SwigDelegateOrderProducer_2(global::System.IntPtr msg, string shardingKey);
|
||||
|
||||
private SwigDelegateOrderProducer_0 swigDelegate0;
|
||||
private SwigDelegateOrderProducer_1 swigDelegate1;
|
||||
private SwigDelegateOrderProducer_2 swigDelegate2;
|
||||
|
||||
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
|
||||
private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { };
|
||||
private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(Message), typeof(string) };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class Producer : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal Producer(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Producer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~Producer() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_Producer(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public Producer() : this(ONSClient4CPPPINVOKE.new_Producer(), true) {
|
||||
SwigDirectorConnect();
|
||||
}
|
||||
|
||||
public virtual void start() {
|
||||
ONSClient4CPPPINVOKE.Producer_start(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual void shutdown() {
|
||||
ONSClient4CPPPINVOKE.Producer_shutdown(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual SendResultONS send(Message msg) {
|
||||
SendResultONS ret = new SendResultONS(ONSClient4CPPPINVOKE.Producer_send__SWIG_0(swigCPtr, Message.getCPtr(msg)), true);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual SendResultONS send(Message msg, MessageQueueONS mq) {
|
||||
SendResultONS ret = new SendResultONS(ONSClient4CPPPINVOKE.Producer_send__SWIG_1(swigCPtr, Message.getCPtr(msg), MessageQueueONS.getCPtr(mq)), true);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual void sendOneway(Message msg) {
|
||||
ONSClient4CPPPINVOKE.Producer_sendOneway(swigCPtr, Message.getCPtr(msg));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
private void SwigDirectorConnect() {
|
||||
if (SwigDerivedClassHasMethod("start", swigMethodTypes0))
|
||||
swigDelegate0 = new SwigDelegateProducer_0(SwigDirectorstart);
|
||||
if (SwigDerivedClassHasMethod("shutdown", swigMethodTypes1))
|
||||
swigDelegate1 = new SwigDelegateProducer_1(SwigDirectorshutdown);
|
||||
if (SwigDerivedClassHasMethod("send", swigMethodTypes2))
|
||||
swigDelegate2 = new SwigDelegateProducer_2(SwigDirectorsend__SWIG_0);
|
||||
if (SwigDerivedClassHasMethod("send", swigMethodTypes3))
|
||||
swigDelegate3 = new SwigDelegateProducer_3(SwigDirectorsend__SWIG_1);
|
||||
if (SwigDerivedClassHasMethod("sendOneway", swigMethodTypes4))
|
||||
swigDelegate4 = new SwigDelegateProducer_4(SwigDirectorsendOneway);
|
||||
ONSClient4CPPPINVOKE.Producer_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4);
|
||||
}
|
||||
|
||||
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
|
||||
global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
|
||||
bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(Producer));
|
||||
return hasDerivedMethod;
|
||||
}
|
||||
|
||||
private void SwigDirectorstart() {
|
||||
start();
|
||||
}
|
||||
|
||||
private void SwigDirectorshutdown() {
|
||||
shutdown();
|
||||
}
|
||||
|
||||
private global::System.IntPtr SwigDirectorsend__SWIG_0(global::System.IntPtr msg) {
|
||||
return SendResultONS.getCPtr(send(new Message(msg, false))).Handle;
|
||||
}
|
||||
|
||||
private global::System.IntPtr SwigDirectorsend__SWIG_1(global::System.IntPtr msg, global::System.IntPtr mq) {
|
||||
return SendResultONS.getCPtr(send(new Message(msg, false), new MessageQueueONS(mq, false))).Handle;
|
||||
}
|
||||
|
||||
private void SwigDirectorsendOneway(global::System.IntPtr msg) {
|
||||
sendOneway(new Message(msg, false));
|
||||
}
|
||||
|
||||
public delegate void SwigDelegateProducer_0();
|
||||
public delegate void SwigDelegateProducer_1();
|
||||
public delegate global::System.IntPtr SwigDelegateProducer_2(global::System.IntPtr msg);
|
||||
public delegate global::System.IntPtr SwigDelegateProducer_3(global::System.IntPtr msg, global::System.IntPtr mq);
|
||||
public delegate void SwigDelegateProducer_4(global::System.IntPtr msg);
|
||||
|
||||
private SwigDelegateProducer_0 swigDelegate0;
|
||||
private SwigDelegateProducer_1 swigDelegate1;
|
||||
private SwigDelegateProducer_2 swigDelegate2;
|
||||
private SwigDelegateProducer_3 swigDelegate3;
|
||||
private SwigDelegateProducer_4 swigDelegate4;
|
||||
|
||||
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
|
||||
private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { };
|
||||
private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(Message) };
|
||||
private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { typeof(Message), typeof(MessageQueueONS) };
|
||||
private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { typeof(Message) };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
using ons;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace AliYunSub.Common
|
||||
{
|
||||
public class MyMsgListener : MessageListener
|
||||
{
|
||||
public MyMsgListener()
|
||||
{
|
||||
}
|
||||
|
||||
~MyMsgListener()
|
||||
{
|
||||
}
|
||||
|
||||
public override ons.Action consume(Message value, ConsumeContext context)
|
||||
{
|
||||
Console.WriteLine("consume:");
|
||||
Console.WriteLine(value.getBody());
|
||||
return ons.Action.CommitMessage;
|
||||
}
|
||||
}
|
||||
public class MyLocalTransactionChecker : LocalTransactionChecker
|
||||
{
|
||||
public MyLocalTransactionChecker()
|
||||
{
|
||||
|
||||
}
|
||||
~MyLocalTransactionChecker()
|
||||
{
|
||||
|
||||
}
|
||||
public override TransactionStatus check(Message value)
|
||||
{
|
||||
return TransactionStatus.CommitTransaction;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class MyMsgOrderListener : MessageOrderListener
|
||||
{
|
||||
public MyMsgOrderListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
~MyMsgOrderListener()
|
||||
{
|
||||
}
|
||||
|
||||
public override ons.OrderAction consume(Message value, ConsumeOrderContext context)
|
||||
{
|
||||
Byte[] text = Encoding.Default.GetBytes(value.getBody());
|
||||
Console.WriteLine(Encoding.UTF8.GetString(text));
|
||||
//Console.WriteLine(value.getBody());
|
||||
return ons.OrderAction.Success;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class OnscSharp
|
||||
{
|
||||
private static Producer _producer;
|
||||
private static PushConsumer _consumer;
|
||||
private static OrderConsumer _orderconsumer;
|
||||
private static OrderProducer _orderproducer;
|
||||
private static MyMsgListener _listen;
|
||||
private static object s_SyncLock = new Object();
|
||||
private static string Ons_Topic = "TOP_test";//
|
||||
private static string Ons_ProducerID = "PID_ivan";
|
||||
private static string Ons_AccessKey = "LTAIx1788cERk3CX";//
|
||||
private static string Ons_SecretKey = "BaHgY1ovuPk72U2QGQGoXxS1ZgQYkG";//
|
||||
private static string Ons_ConsumerId = "GID_Tcp";
|
||||
private static string Ons_NameSrv = "http://MQ_INST_1824023413705812_BXaOH55h.mq-internet-access.mq-internet.aliyuncs.com:80";
|
||||
//private static string Ons_NameSrv = "http://1824023413705812.mqrest.cn-qingdao-public.aliyuncs.com";
|
||||
|
||||
public static void SendMessage(byte[] msgBody)
|
||||
{
|
||||
Message msg = new Message(Ons_Topic, "", "");
|
||||
msg.setBody(msgBody, msgBody.Length);
|
||||
try
|
||||
{
|
||||
SendResultONS sendResult = _producer.send(msg);
|
||||
Console.WriteLine("send success {0}", sendResult.getMessageId());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("send failure{0}", ex.ToString());
|
||||
}
|
||||
}
|
||||
public static void SendMessage(string msgBody, String tag = "RegisterLog")
|
||||
{
|
||||
// Message msg = new Message(Ons_Topic, tag, msgBody);
|
||||
Message msg = new Message(Ons_Topic, tag, msgBody);
|
||||
msg.setKey(Guid.NewGuid().ToString());
|
||||
try
|
||||
{
|
||||
SendResultONS sendResult = _producer.send(msg);
|
||||
Console.WriteLine("send success {0}", sendResult.getMessageId());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("send failure{0}", ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public static void SendOrderMessage(string msgBody, String tag = "RegisterLog", String key = "test")
|
||||
{
|
||||
Message msg = new Message(Ons_Topic, tag, msgBody);
|
||||
byte[] data = new byte[10];
|
||||
msg.setBody(data, 10);
|
||||
msg.setKey(Guid.NewGuid().ToString());
|
||||
try
|
||||
{
|
||||
SendResultONS sendResult = _orderproducer.send(msg, key);
|
||||
Console.WriteLine("send success {0}", sendResult.getMessageId());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("send failure{0}", ex.ToString());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 定义监听
|
||||
/// </summary>
|
||||
public static void StartPushConsumer()
|
||||
{
|
||||
MyMsgListener listen = new MyMsgListener();
|
||||
_consumer.subscribe(Ons_Topic, "*", listen);
|
||||
_consumer.start();
|
||||
Console.WriteLine("start cunsumer");
|
||||
}
|
||||
|
||||
public static void StartOrderConsumer()
|
||||
{
|
||||
MyMsgOrderListener listen = new MyMsgOrderListener();
|
||||
_orderconsumer.subscribe(Ons_Topic, "*", listen);
|
||||
_orderconsumer.start();
|
||||
}
|
||||
|
||||
public static void shutdownPushConsumer()
|
||||
{
|
||||
_consumer.shutdown();
|
||||
}
|
||||
|
||||
public static void shutdownOrderConsumer()
|
||||
{
|
||||
_orderconsumer.shutdown();
|
||||
}
|
||||
|
||||
public static void StartProducer()
|
||||
{
|
||||
_producer.start();
|
||||
}
|
||||
|
||||
public static void ShutdownProducer()
|
||||
{
|
||||
_producer.shutdown();
|
||||
}
|
||||
|
||||
|
||||
public static void StartOrderProducer()
|
||||
{
|
||||
_orderproducer.start();
|
||||
}
|
||||
|
||||
public static void ShutdownOrderProducer()
|
||||
{
|
||||
_orderproducer.shutdown();
|
||||
}
|
||||
|
||||
private static ONSFactoryProperty getFactoryProperty()
|
||||
{
|
||||
ONSFactoryProperty factoryInfo = new ONSFactoryProperty();
|
||||
factoryInfo.setFactoryProperty(ONSFactoryProperty.AccessKey, Ons_AccessKey);
|
||||
factoryInfo.setFactoryProperty(ONSFactoryProperty.SecretKey, Ons_SecretKey);
|
||||
factoryInfo.setFactoryProperty(ONSFactoryProperty.ConsumerId, Ons_ConsumerId);
|
||||
factoryInfo.setFactoryProperty(ONSFactoryProperty.ProducerId, Ons_ProducerID);
|
||||
factoryInfo.setFactoryProperty(ONSFactoryProperty.PublishTopics, Ons_Topic);
|
||||
factoryInfo.setFactoryProperty(ONSFactoryProperty.NAMESRV_ADDR, Ons_NameSrv);
|
||||
factoryInfo.setFactoryProperty(ONSFactoryProperty.MessageModel, ONSFactoryProperty.BROADCASTING);
|
||||
return factoryInfo;
|
||||
}
|
||||
|
||||
public static void CreatePushConsumer()
|
||||
{
|
||||
|
||||
_consumer = ONSFactory.getInstance().createPushConsumer(getFactoryProperty());
|
||||
}
|
||||
|
||||
public static void CreateProducer()
|
||||
{
|
||||
|
||||
_producer = ONSFactory.getInstance().createProducer(getFactoryProperty());
|
||||
}
|
||||
|
||||
|
||||
public static void CreateOrderConsumer()
|
||||
{
|
||||
|
||||
_orderconsumer = ONSFactory.getInstance().createOrderConsumer(getFactoryProperty());
|
||||
}
|
||||
|
||||
public static void CreateOrderProducer()
|
||||
{
|
||||
|
||||
_orderproducer = ONSFactory.getInstance().createOrderProducer(getFactoryProperty());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
OnscSharp.CreatePushConsumer();
|
||||
OnscSharp.StartPushConsumer();
|
||||
//OnscSharp.StartProducer();
|
||||
//System.DateTime beforDt = System.DateTime.Now;
|
||||
//byte[] data = Encoding.UTF8.GetBytes(" 万会觉得 哎哎啊啊啊 啊哎啊啊啊 cds ");
|
||||
//// string body = Encoding.Default.GetString(data);
|
||||
//// string body = " 万会觉得 哎哎啊啊啊 啊哎啊啊啊 cds ";
|
||||
//for (int i = 0;i < 2; ++i)
|
||||
//{
|
||||
// OnscSharp.SendMessage(data);
|
||||
//}
|
||||
//System.DateTime endDt = System.DateTime.Now;
|
||||
//System.TimeSpan ts = endDt.Subtract(beforDt);
|
||||
//Console.WriteLine("per message:{0}ms.", ts.TotalMilliseconds / 10000);
|
||||
|
||||
Console.ReadKey();
|
||||
//Thread.Sleep(1000 * 100);
|
||||
OnscSharp.ShutdownProducer();
|
||||
OnscSharp.shutdownPushConsumer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("AliYunSub.Common")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("AliYunSub.Common")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("0c206585-91f4-47b1-80a6-c6b10dc5e8b2")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class PullConsumer : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal PullConsumer(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PullConsumer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~PullConsumer() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_PullConsumer(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public PullConsumer() : this(ONSClient4CPPPINVOKE.new_PullConsumer(), true) {
|
||||
SwigDirectorConnect();
|
||||
}
|
||||
|
||||
public virtual void start() {
|
||||
ONSClient4CPPPINVOKE.PullConsumer_start(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual void shutdown() {
|
||||
ONSClient4CPPPINVOKE.PullConsumer_shutdown(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual void fetchSubscribeMessageQueues(string topic, SWIGTYPE_p_std__vectorT_ons__MessageQueueONS_t mqs) {
|
||||
ONSClient4CPPPINVOKE.PullConsumer_fetchSubscribeMessageQueues(swigCPtr, topic, SWIGTYPE_p_std__vectorT_ons__MessageQueueONS_t.getCPtr(mqs));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public virtual PullResultONS pull(MessageQueueONS mq, string subExpression, long offset, int maxNums) {
|
||||
PullResultONS ret = new PullResultONS(ONSClient4CPPPINVOKE.PullConsumer_pull(swigCPtr, MessageQueueONS.getCPtr(mq), subExpression, offset, maxNums), true);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual long searchOffset(MessageQueueONS mq, long timestamp) {
|
||||
long ret = ONSClient4CPPPINVOKE.PullConsumer_searchOffset(swigCPtr, MessageQueueONS.getCPtr(mq), timestamp);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual long maxOffset(MessageQueueONS mq) {
|
||||
long ret = ONSClient4CPPPINVOKE.PullConsumer_maxOffset(swigCPtr, MessageQueueONS.getCPtr(mq));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual long minOffset(MessageQueueONS mq) {
|
||||
long ret = ONSClient4CPPPINVOKE.PullConsumer_minOffset(swigCPtr, MessageQueueONS.getCPtr(mq));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual void updateConsumeOffset(MessageQueueONS mq, long offset) {
|
||||
ONSClient4CPPPINVOKE.PullConsumer_updateConsumeOffset(swigCPtr, MessageQueueONS.getCPtr(mq), offset);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public virtual void removeConsumeOffset(MessageQueueONS mq) {
|
||||
ONSClient4CPPPINVOKE.PullConsumer_removeConsumeOffset(swigCPtr, MessageQueueONS.getCPtr(mq));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public virtual long fetchConsumeOffset(MessageQueueONS mq, bool fromStore) {
|
||||
long ret = ONSClient4CPPPINVOKE.PullConsumer_fetchConsumeOffset(swigCPtr, MessageQueueONS.getCPtr(mq), fromStore);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual void persistConsumerOffset4PullConsumer(MessageQueueONS mq) {
|
||||
ONSClient4CPPPINVOKE.PullConsumer_persistConsumerOffset4PullConsumer(swigCPtr, MessageQueueONS.getCPtr(mq));
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
private void SwigDirectorConnect() {
|
||||
if (SwigDerivedClassHasMethod("start", swigMethodTypes0))
|
||||
swigDelegate0 = new SwigDelegatePullConsumer_0(SwigDirectorstart);
|
||||
if (SwigDerivedClassHasMethod("shutdown", swigMethodTypes1))
|
||||
swigDelegate1 = new SwigDelegatePullConsumer_1(SwigDirectorshutdown);
|
||||
if (SwigDerivedClassHasMethod("fetchSubscribeMessageQueues", swigMethodTypes2))
|
||||
swigDelegate2 = new SwigDelegatePullConsumer_2(SwigDirectorfetchSubscribeMessageQueues);
|
||||
if (SwigDerivedClassHasMethod("pull", swigMethodTypes3))
|
||||
swigDelegate3 = new SwigDelegatePullConsumer_3(SwigDirectorpull);
|
||||
if (SwigDerivedClassHasMethod("searchOffset", swigMethodTypes4))
|
||||
swigDelegate4 = new SwigDelegatePullConsumer_4(SwigDirectorsearchOffset);
|
||||
if (SwigDerivedClassHasMethod("maxOffset", swigMethodTypes5))
|
||||
swigDelegate5 = new SwigDelegatePullConsumer_5(SwigDirectormaxOffset);
|
||||
if (SwigDerivedClassHasMethod("minOffset", swigMethodTypes6))
|
||||
swigDelegate6 = new SwigDelegatePullConsumer_6(SwigDirectorminOffset);
|
||||
if (SwigDerivedClassHasMethod("updateConsumeOffset", swigMethodTypes7))
|
||||
swigDelegate7 = new SwigDelegatePullConsumer_7(SwigDirectorupdateConsumeOffset);
|
||||
if (SwigDerivedClassHasMethod("removeConsumeOffset", swigMethodTypes8))
|
||||
swigDelegate8 = new SwigDelegatePullConsumer_8(SwigDirectorremoveConsumeOffset);
|
||||
if (SwigDerivedClassHasMethod("fetchConsumeOffset", swigMethodTypes9))
|
||||
swigDelegate9 = new SwigDelegatePullConsumer_9(SwigDirectorfetchConsumeOffset);
|
||||
if (SwigDerivedClassHasMethod("persistConsumerOffset4PullConsumer", swigMethodTypes10))
|
||||
swigDelegate10 = new SwigDelegatePullConsumer_10(SwigDirectorpersistConsumerOffset4PullConsumer);
|
||||
ONSClient4CPPPINVOKE.PullConsumer_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8, swigDelegate9, swigDelegate10);
|
||||
}
|
||||
|
||||
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
|
||||
global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
|
||||
bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(PullConsumer));
|
||||
return hasDerivedMethod;
|
||||
}
|
||||
|
||||
private void SwigDirectorstart() {
|
||||
start();
|
||||
}
|
||||
|
||||
private void SwigDirectorshutdown() {
|
||||
shutdown();
|
||||
}
|
||||
|
||||
private void SwigDirectorfetchSubscribeMessageQueues(string topic, global::System.IntPtr mqs) {
|
||||
fetchSubscribeMessageQueues(topic, new SWIGTYPE_p_std__vectorT_ons__MessageQueueONS_t(mqs, false));
|
||||
}
|
||||
|
||||
private global::System.IntPtr SwigDirectorpull(global::System.IntPtr mq, string subExpression, long offset, int maxNums) {
|
||||
return PullResultONS.getCPtr(pull(new MessageQueueONS(mq, false), subExpression, offset, maxNums)).Handle;
|
||||
}
|
||||
|
||||
private long SwigDirectorsearchOffset(global::System.IntPtr mq, long timestamp) {
|
||||
return searchOffset(new MessageQueueONS(mq, false), timestamp);
|
||||
}
|
||||
|
||||
private long SwigDirectormaxOffset(global::System.IntPtr mq) {
|
||||
return maxOffset(new MessageQueueONS(mq, false));
|
||||
}
|
||||
|
||||
private long SwigDirectorminOffset(global::System.IntPtr mq) {
|
||||
return minOffset(new MessageQueueONS(mq, false));
|
||||
}
|
||||
|
||||
private void SwigDirectorupdateConsumeOffset(global::System.IntPtr mq, long offset) {
|
||||
updateConsumeOffset(new MessageQueueONS(mq, false), offset);
|
||||
}
|
||||
|
||||
private void SwigDirectorremoveConsumeOffset(global::System.IntPtr mq) {
|
||||
removeConsumeOffset(new MessageQueueONS(mq, false));
|
||||
}
|
||||
|
||||
private long SwigDirectorfetchConsumeOffset(global::System.IntPtr mq, bool fromStore) {
|
||||
return fetchConsumeOffset(new MessageQueueONS(mq, false), fromStore);
|
||||
}
|
||||
|
||||
private void SwigDirectorpersistConsumerOffset4PullConsumer(global::System.IntPtr mq) {
|
||||
persistConsumerOffset4PullConsumer(new MessageQueueONS(mq, false));
|
||||
}
|
||||
|
||||
public delegate void SwigDelegatePullConsumer_0();
|
||||
public delegate void SwigDelegatePullConsumer_1();
|
||||
public delegate void SwigDelegatePullConsumer_2(string topic, global::System.IntPtr mqs);
|
||||
public delegate global::System.IntPtr SwigDelegatePullConsumer_3(global::System.IntPtr mq, string subExpression, long offset, int maxNums);
|
||||
public delegate long SwigDelegatePullConsumer_4(global::System.IntPtr mq, long timestamp);
|
||||
public delegate long SwigDelegatePullConsumer_5(global::System.IntPtr mq);
|
||||
public delegate long SwigDelegatePullConsumer_6(global::System.IntPtr mq);
|
||||
public delegate void SwigDelegatePullConsumer_7(global::System.IntPtr mq, long offset);
|
||||
public delegate void SwigDelegatePullConsumer_8(global::System.IntPtr mq);
|
||||
public delegate long SwigDelegatePullConsumer_9(global::System.IntPtr mq, bool fromStore);
|
||||
public delegate void SwigDelegatePullConsumer_10(global::System.IntPtr mq);
|
||||
|
||||
private SwigDelegatePullConsumer_0 swigDelegate0;
|
||||
private SwigDelegatePullConsumer_1 swigDelegate1;
|
||||
private SwigDelegatePullConsumer_2 swigDelegate2;
|
||||
private SwigDelegatePullConsumer_3 swigDelegate3;
|
||||
private SwigDelegatePullConsumer_4 swigDelegate4;
|
||||
private SwigDelegatePullConsumer_5 swigDelegate5;
|
||||
private SwigDelegatePullConsumer_6 swigDelegate6;
|
||||
private SwigDelegatePullConsumer_7 swigDelegate7;
|
||||
private SwigDelegatePullConsumer_8 swigDelegate8;
|
||||
private SwigDelegatePullConsumer_9 swigDelegate9;
|
||||
private SwigDelegatePullConsumer_10 swigDelegate10;
|
||||
|
||||
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
|
||||
private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { };
|
||||
private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(string), typeof(SWIGTYPE_p_std__vectorT_ons__MessageQueueONS_t) };
|
||||
private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { typeof(MessageQueueONS), typeof(string), typeof(long), typeof(int) };
|
||||
private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { typeof(MessageQueueONS), typeof(long) };
|
||||
private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { typeof(MessageQueueONS) };
|
||||
private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { typeof(MessageQueueONS) };
|
||||
private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { typeof(MessageQueueONS), typeof(long) };
|
||||
private static global::System.Type[] swigMethodTypes8 = new global::System.Type[] { typeof(MessageQueueONS) };
|
||||
private static global::System.Type[] swigMethodTypes9 = new global::System.Type[] { typeof(MessageQueueONS), typeof(bool) };
|
||||
private static global::System.Type[] swigMethodTypes10 = new global::System.Type[] { typeof(MessageQueueONS) };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class PullResultONS : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal PullResultONS(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PullResultONS obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~PullResultONS() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_PullResultONS(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public PullResultONS(ONSPullStatus status) : this(ONSClient4CPPPINVOKE.new_PullResultONS__SWIG_0((int)status), true) {
|
||||
}
|
||||
|
||||
public PullResultONS(ONSPullStatus pullStatus, long nextBeginOffset, long minOffset, long maxOffset) : this(ONSClient4CPPPINVOKE.new_PullResultONS__SWIG_1((int)pullStatus, nextBeginOffset, minOffset, maxOffset), true) {
|
||||
}
|
||||
|
||||
public ONSPullStatus pullStatus {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.PullResultONS_pullStatus_set(swigCPtr, (int)value);
|
||||
}
|
||||
get {
|
||||
ONSPullStatus ret = (ONSPullStatus)ONSClient4CPPPINVOKE.PullResultONS_pullStatus_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public long nextBeginOffset {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.PullResultONS_nextBeginOffset_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
long ret = ONSClient4CPPPINVOKE.PullResultONS_nextBeginOffset_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public long minOffset {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.PullResultONS_minOffset_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
long ret = ONSClient4CPPPINVOKE.PullResultONS_minOffset_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public long maxOffset {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.PullResultONS_maxOffset_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
long ret = ONSClient4CPPPINVOKE.PullResultONS_maxOffset_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_std__vectorT_ons__Message_t msgFoundList {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.PullResultONS_msgFoundList_set(swigCPtr, SWIGTYPE_p_std__vectorT_ons__Message_t.getCPtr(value));
|
||||
}
|
||||
get {
|
||||
global::System.IntPtr cPtr = ONSClient4CPPPINVOKE.PullResultONS_msgFoundList_get(swigCPtr);
|
||||
SWIGTYPE_p_std__vectorT_ons__Message_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_std__vectorT_ons__Message_t(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class PushConsumer : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal PushConsumer(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PushConsumer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~PushConsumer() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_PushConsumer(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public PushConsumer() : this(ONSClient4CPPPINVOKE.new_PushConsumer(), true) {
|
||||
SwigDirectorConnect();
|
||||
}
|
||||
|
||||
public virtual void start() {
|
||||
ONSClient4CPPPINVOKE.PushConsumer_start(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual void shutdown() {
|
||||
ONSClient4CPPPINVOKE.PushConsumer_shutdown(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual void subscribe(string topic, string subExpression, MessageListener listener) {
|
||||
ONSClient4CPPPINVOKE.PushConsumer_subscribe(swigCPtr, topic, subExpression, MessageListener.getCPtr(listener));
|
||||
}
|
||||
|
||||
private void SwigDirectorConnect() {
|
||||
if (SwigDerivedClassHasMethod("start", swigMethodTypes0))
|
||||
swigDelegate0 = new SwigDelegatePushConsumer_0(SwigDirectorstart);
|
||||
if (SwigDerivedClassHasMethod("shutdown", swigMethodTypes1))
|
||||
swigDelegate1 = new SwigDelegatePushConsumer_1(SwigDirectorshutdown);
|
||||
if (SwigDerivedClassHasMethod("subscribe", swigMethodTypes2))
|
||||
swigDelegate2 = new SwigDelegatePushConsumer_2(SwigDirectorsubscribe);
|
||||
ONSClient4CPPPINVOKE.PushConsumer_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2);
|
||||
}
|
||||
|
||||
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
|
||||
global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
|
||||
bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(PushConsumer));
|
||||
return hasDerivedMethod;
|
||||
}
|
||||
|
||||
private void SwigDirectorstart() {
|
||||
start();
|
||||
}
|
||||
|
||||
private void SwigDirectorshutdown() {
|
||||
shutdown();
|
||||
}
|
||||
|
||||
private void SwigDirectorsubscribe(string topic, string subExpression, global::System.IntPtr listener) {
|
||||
subscribe(topic, subExpression, (listener == global::System.IntPtr.Zero) ? null : new MessageListener(listener, false));
|
||||
}
|
||||
|
||||
public delegate void SwigDelegatePushConsumer_0();
|
||||
public delegate void SwigDelegatePushConsumer_1();
|
||||
public delegate void SwigDelegatePushConsumer_2(string topic, string subExpression, global::System.IntPtr listener);
|
||||
|
||||
private SwigDelegatePushConsumer_0 swigDelegate0;
|
||||
private SwigDelegatePushConsumer_1 swigDelegate1;
|
||||
private SwigDelegatePushConsumer_2 swigDelegate2;
|
||||
|
||||
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
|
||||
private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { };
|
||||
private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(string), typeof(string), typeof(MessageListener) };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_CONSTSTRING {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_CONSTSTRING(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_CONSTSTRING() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_CONSTSTRING obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_ConsumeContext {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_ConsumeContext(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_ConsumeContext() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_ConsumeContext obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_ConsumeOrderContext {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_ConsumeOrderContext(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_ConsumeOrderContext() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_ConsumeOrderContext obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_LocalTransactionChecker {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_LocalTransactionChecker(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_LocalTransactionChecker() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_LocalTransactionChecker obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_MQException {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_MQException(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_MQException() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_MQException obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_Message {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_Message(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_Message() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_Message obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_MessageOrderListener {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_MessageOrderListener(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_MessageOrderListener() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_MessageOrderListener obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class SWIGTYPE_p_MessageQueueONS {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_MessageQueueONS(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_MessageQueueONS() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_MessageQueueONS obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_ONSCLIENT_API {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_ONSCLIENT_API(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_ONSCLIENT_API() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_ONSCLIENT_API obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_ONSClientException {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_ONSClientException(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_ONSClientException() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_ONSClientException obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_OrderConsumer {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_OrderConsumer(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_OrderConsumer() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_OrderConsumer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_OrderProducer {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_OrderProducer(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_OrderProducer() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_OrderProducer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_PushConsumer {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_PushConsumer(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_PushConsumer() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_PushConsumer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_SendResult {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_SendResult(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_SendResult() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_SendResult obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_SendResultONS {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_SendResultONS(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_SendResultONS() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_SendResultONS obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_TransactionProducer {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_TransactionProducer(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_TransactionProducer() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_TransactionProducer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_TransactionStatus {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_TransactionStatus(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_TransactionStatus() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_TransactionStatus obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_ons__LocalTransactionChecker {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_ons__LocalTransactionChecker(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_ons__LocalTransactionChecker() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_ons__LocalTransactionChecker obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_ons__OrderConsumer {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_ons__OrderConsumer(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_ons__OrderConsumer() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_ons__OrderConsumer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_ons__OrderProducer {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_ons__OrderProducer(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_ons__OrderProducer() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_ons__OrderProducer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class SWIGTYPE_p_ons__PullConsumer {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_ons__PullConsumer(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_ons__PullConsumer() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_ons__PullConsumer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_ons__PushConsumer {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_ons__PushConsumer(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_ons__PushConsumer() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_ons__PushConsumer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_ons__TransactionProducer {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_ons__TransactionProducer(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_ons__TransactionProducer() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_ons__TransactionProducer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class SWIGTYPE_p_std__mapT_std__string_std__string_t {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_std__mapT_std__string_std__string_t(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_std__mapT_std__string_std__string_t() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_std__mapT_std__string_std__string_t obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public class SWIGTYPE_p_std__string {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_std__string(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_std__string() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_std__string obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class SWIGTYPE_p_std__vectorT_ons__MessageQueueONS_t {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_std__vectorT_ons__MessageQueueONS_t(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_std__vectorT_ons__MessageQueueONS_t() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_std__vectorT_ons__MessageQueueONS_t obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class SWIGTYPE_p_std__vectorT_ons__Message_t {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_std__vectorT_ons__Message_t(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_std__vectorT_ons__Message_t() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_std__vectorT_ons__Message_t obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.10
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class SWIGTYPE_p_unsigned_char {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_unsigned_char(global::System.IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_unsigned_char() {
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_unsigned_char obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class SendResultONS : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal SendResultONS(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SendResultONS obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~SendResultONS() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_SendResultONS(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public SendResultONS() : this(ONSClient4CPPPINVOKE.new_SendResultONS(), true) {
|
||||
}
|
||||
|
||||
public void setMessageId(string msgId) {
|
||||
ONSClient4CPPPINVOKE.SendResultONS_setMessageId(swigCPtr, msgId);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public string getMessageId() {
|
||||
string ret = ONSClient4CPPPINVOKE.SendResultONS_getMessageId(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class SystemPropKey : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal SystemPropKey(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SystemPropKey obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~SystemPropKey() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_SystemPropKey(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public SystemPropKey() : this(ONSClient4CPPPINVOKE.new_SystemPropKey(), true) {
|
||||
}
|
||||
|
||||
public static string TAG {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.SystemPropKey_TAG_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.SystemPropKey_TAG_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string KEY {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.SystemPropKey_KEY_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.SystemPropKey_KEY_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string MSGID {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.SystemPropKey_MSGID_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.SystemPropKey_MSGID_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string RECONSUMETIMES {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.SystemPropKey_RECONSUMETIMES_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.SystemPropKey_RECONSUMETIMES_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public static string STARTDELIVERTIME {
|
||||
set {
|
||||
ONSClient4CPPPINVOKE.SystemPropKey_STARTDELIVERTIME_set(value);
|
||||
}
|
||||
get {
|
||||
string ret = ONSClient4CPPPINVOKE.SystemPropKey_STARTDELIVERTIME_get();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public class TransactionProducer : global::System.IDisposable {
|
||||
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal TransactionProducer(global::System.IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TransactionProducer obj) {
|
||||
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~TransactionProducer() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
ONSClient4CPPPINVOKE.delete_TransactionProducer(swigCPtr);
|
||||
}
|
||||
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
|
||||
}
|
||||
global::System.GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void start() {
|
||||
ONSClient4CPPPINVOKE.TransactionProducer_start(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual void shutdown() {
|
||||
ONSClient4CPPPINVOKE.TransactionProducer_shutdown(swigCPtr);
|
||||
}
|
||||
|
||||
public virtual SendResultONS send(Message msg, LocalTransactionExecuter executer) {
|
||||
SendResultONS ret = new SendResultONS(ONSClient4CPPPINVOKE.TransactionProducer_send(swigCPtr, Message.getCPtr(msg), LocalTransactionExecuter.getCPtr(executer)), true);
|
||||
if (ONSClient4CPPPINVOKE.SWIGPendingException.Pending) throw ONSClient4CPPPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//
|
||||
// This file was automatically generated by SWIG (http://www.swig.org).
|
||||
// Version 3.0.12
|
||||
//
|
||||
// Do not make changes to this file unless you know what you are doing--modify
|
||||
// the SWIG interface file instead.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ons {
|
||||
|
||||
public enum TransactionStatus {
|
||||
CommitTransaction = 0,
|
||||
RollbackTransaction = 1,
|
||||
Unknow = 2
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
using System.Web.Mvc;
|
||||
|
||||
namespace AppletMvcService
|
||||
{
|
||||
public class FilterConfig
|
||||
{
|
||||
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
|
||||
{
|
||||
filters.Add(new HandleErrorAttribute());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace AppletMvcService
|
||||
{
|
||||
public class RouteConfig
|
||||
{
|
||||
public static void RegisterRoutes(RouteCollection routes)
|
||||
{
|
||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||
|
||||
routes.MapRoute(
|
||||
name: "Default",
|
||||
url: "{controller}/{action}/{id}",
|
||||
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
using System.Web.Http;
|
||||
using System.Web.Http.Cors;
|
||||
|
||||
namespace AppletMvcService
|
||||
{
|
||||
public static class WebApiConfig
|
||||
{
|
||||
public static void Register(HttpConfiguration config)
|
||||
{
|
||||
//var cors = new EnableCorsAttribute("*", "*", "*");
|
||||
//config.EnableCors(cors);
|
||||
//config.EnableCors();
|
||||
config.MapHttpAttributeRoutes();
|
||||
|
||||
config.Routes.MapHttpRoute(
|
||||
name: "DefaultApi",
|
||||
routeTemplate: "api/{controller}/{action}/{id}",
|
||||
defaults: new { id = RouteParameter.Optional }
|
||||
);
|
||||
//这是重点,从配置文件的appsettings节点中读取跨域的地址
|
||||
var cors = new EnableCorsAttribute("*", "*", "*");
|
||||
config.EnableCors(cors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,276 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{DCC65E1A-EBFE-4CC0-B852-121C4B014A8F}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AppletMvcService</RootNamespace>
|
||||
<AssemblyName>AppletMvcService</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<Use64BitIISExpress />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.AspNet.SignalR.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.SignalR.Core.2.2.2\lib\net45\Microsoft.AspNet.SignalR.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.AspNet.SignalR.SystemWeb, Version=2.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.SignalR.SystemWeb.2.2.2\lib\net45\Microsoft.AspNet.SignalR.SystemWeb.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Cors, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Owin.Cors.3.1.0\lib\net45\Microsoft.Owin.Cors.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.2.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Security, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Owin.Security.2.1.0\lib\net45\Microsoft.Owin.Security.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ninject">
|
||||
<HintPath>..\packages\Ninject.3.2.2.0\lib\net45-full\Ninject.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Oracle.ManagedDataAccess.12.1.24160719\lib\net40\Oracle.ManagedDataAccess.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Oracle.ManagedDataAccess.EntityFramework.12.1.2400\lib\net45\Oracle.ManagedDataAccess.EntityFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Web.Cors, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Cors.5.2.3\lib\net45\System.Web.Cors.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Entity" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.Cors, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Cors.5.2.3\lib\net45\System.Web.Http.Cors.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Web.Razor">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="log4net.config">
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="Properties\PublishProfiles\AppletMvcService.pubxml" />
|
||||
<None Include="Properties\PublishProfiles\AppletMvsService.pubxml" />
|
||||
<None Include="Scripts\jquery-1.6.4-vsdoc.js" />
|
||||
<Content Include="Index.html" />
|
||||
<Content Include="Scripts\jquery-1.6.4.js" />
|
||||
<Content Include="Scripts\jquery-1.6.4.min.js" />
|
||||
<Content Include="Scripts\jquery.signalR-2.2.2.js" />
|
||||
<Content Include="Scripts\jquery.signalR-2.2.2.min.js" />
|
||||
<Content Include="silk2mp3\ffmpeg.exe" />
|
||||
<Content Include="silk2mp3\silk2mp3.exe" />
|
||||
<Content Include="silk2mp3\silk_v3_decoder.exe" />
|
||||
<Content Include="silk2mp3\silk_v3_encoder.exe" />
|
||||
<Content Include="Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App_Start\FilterConfig.cs" />
|
||||
<Compile Include="App_Start\RouteConfig.cs" />
|
||||
<Compile Include="App_Start\WebApiConfig.cs" />
|
||||
<Compile Include="ChatHub.cs" />
|
||||
<Compile Include="Common\RequestHelper.cs" />
|
||||
<Compile Include="Controllers\WxGroupSvrController.cs" />
|
||||
<Compile Include="Controllers\WxMessageSvrController.cs" />
|
||||
<Compile Include="Controllers\WxUserInfoSvrController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Hanlder\MessageHandler.cs" />
|
||||
<Compile Include="Models\AccessToken.cs" />
|
||||
<Compile Include="Models\CustoemrDetail.cs" />
|
||||
<Compile Include="Models\ImageMsg.cs" />
|
||||
<Compile Include="Models\ResultModel.cs" />
|
||||
<Compile Include="Models\SendMsg.cs" />
|
||||
<Compile Include="Models\SuCaiModel.cs" />
|
||||
<Compile Include="Models\UnReadMsgModel.cs" />
|
||||
<Compile Include="Models\UserDetail.cs" />
|
||||
<Compile Include="Models\web_push_wxUserServiceModel.cs" />
|
||||
<Compile Include="Models\WxAccount.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Startup.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\web.config" />
|
||||
<Content Include="packages.config" />
|
||||
<None Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
<None Include="Web.Release.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="Fakes\" />
|
||||
<Folder Include="xml\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BLL\BLL.csproj">
|
||||
<Project>{0970c8c4-661a-49f3-a746-8c48589a6732}</Project>
|
||||
<Name>BLL</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Common\Common.csproj">
|
||||
<Project>{5e07f523-738a-456e-a9ea-b1fe3b3f5721}</Project>
|
||||
<Name>Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\IBLL\IBLL.csproj">
|
||||
<Project>{380cccce-fd6d-43f4-abd0-60e5ec8b8aac}</Project>
|
||||
<Name>IBLL</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Model\Model.csproj">
|
||||
<Project>{67b5f328-4cec-4940-b6bc-32285f90234d}</Project>
|
||||
<Name>Model</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WebHelper\WebHelper.csproj">
|
||||
<Project>{0358ee1a-a77e-4fe6-ab02-23cbe6de48b6}</Project>
|
||||
<Name>WebHelper</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>True</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>8368</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:7908/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,231 @@
|
|||
using AppletMvcService.Hanlder;
|
||||
using AppletMvcService.Models;
|
||||
using Microsoft.AspNet.SignalR;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using WX.CRM.Common;
|
||||
|
||||
namespace AppletMvcService
|
||||
{
|
||||
public class ChatHub : Hub
|
||||
{
|
||||
//public void Send(string name, string message)
|
||||
//{
|
||||
// Clients.All.broadcastMessage(name, message);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 给客服发送消息
|
||||
/// </summary>
|
||||
/// <param name="toUserId"></param>
|
||||
/// <param name="fromUserId"></param>
|
||||
/// <param name="message"></param>
|
||||
public static void SendAllMessage(string toUserId, string fromUserId, string message, string msgType, string accountnum, int isNew)
|
||||
{
|
||||
//CustoemrDetail detial = CustomerUsers.FirstOrDefault(m => m.OpenId == fromUserId);
|
||||
UserDetail xx = ConnectedUsers[accountnum].FirstOrDefault(m => m.UserID == toUserId);
|
||||
if (xx == null)
|
||||
{
|
||||
LogHelper.Info("工号:" + toUserId + "不在线,content:" + message + ",add unread msg");
|
||||
return;
|
||||
}
|
||||
if (isNew == 1)
|
||||
{
|
||||
CustoemrDetail detial = new CustoemrDetail();
|
||||
detial.OpenId = fromUserId;
|
||||
detial.NickName = "客户";
|
||||
detial.ConnectionId = fromUserId;
|
||||
detial.HeaderUrl = "";
|
||||
detial.LoginTime = DateTime.Now;
|
||||
detial = MessageHandler.GetCustomerHeadInfo(detial);
|
||||
//添加登陆者
|
||||
MessageHandler.GetCustomerHeadInfo(detial);
|
||||
Microsoft.AspNet.SignalR.GlobalHost.ConnectionManager.GetHubContext<ChatHub>().Clients.Client(xx.ConnectionId).onNewUserConnected(fromUserId, fromUserId, detial.NickName, "微信", detial.HeaderUrl, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
|
||||
}
|
||||
Microsoft.AspNet.SignalR.GlobalHost.ConnectionManager.GetHubContext<ChatHub>().Clients.Client(xx.ConnectionId).receivePrivateMessage(fromUserId, message, msgType);
|
||||
}
|
||||
|
||||
#region Data Members
|
||||
private static Dictionary<string, List<UserDetail>> _connectedUsers;
|
||||
|
||||
public static Dictionary<string, List<UserDetail>> ConnectedUsers
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_connectedUsers == null || _connectedUsers.Count == 0)
|
||||
{
|
||||
_connectedUsers = MessageHandler.GetConnectedByRedis();
|
||||
}
|
||||
return ChatHub._connectedUsers;
|
||||
|
||||
}
|
||||
set { ChatHub._connectedUsers = value; }
|
||||
}
|
||||
//public static List<CustoemrDetail> CustomerUsers = new List<CustoemrDetail>();//客户在线列表
|
||||
//public static string ConectedEids = string.Empty;
|
||||
#endregion
|
||||
|
||||
//心跳
|
||||
public void Alive(string userId, string accountnum)
|
||||
{
|
||||
//LogHelper.Info("alive==========" + userId);
|
||||
UserDetail xx = ConnectedUsers[accountnum].FirstOrDefault(m => m.UserID == userId);
|
||||
Microsoft.AspNet.SignalR.GlobalHost.ConnectionManager.GetHubContext<ChatHub>().Clients.Client(xx.ConnectionId).getAlive(userId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 登录连线
|
||||
/// </summary>
|
||||
/// <param name="userID">用户ID</param>
|
||||
/// <param name="userName">用户名</param>
|
||||
/// <param name="deptName">部门名</param>
|
||||
/// <param name="accountnum">公众号</param>
|
||||
public void Connect(string userID, string userName, string deptName, string accountnum)
|
||||
{
|
||||
try
|
||||
{
|
||||
var id = Context.ConnectionId;
|
||||
if (!ConnectedUsers.ContainsKey(accountnum))
|
||||
ConnectedUsers.Add(accountnum, new List<UserDetail>());
|
||||
LogHelper.Info("登录系统!" + userID);
|
||||
if (ConnectedUsers[accountnum].Count(x => x.ConnectionId == id) == 0)
|
||||
{
|
||||
if (ConnectedUsers[accountnum].Count(x => x.UserID == userID) > 0)
|
||||
{
|
||||
var items = ConnectedUsers[accountnum].Where(x => x.UserID == userID).ToList();
|
||||
foreach (var item in items)
|
||||
{
|
||||
Clients.AllExcept(id).onUserDisconnected(item.ConnectionId, item.UserName);
|
||||
}
|
||||
ConnectedUsers[accountnum].RemoveAll(x => x.UserID == userID);
|
||||
}
|
||||
//ConectedEids += "[" + userID + "]";
|
||||
|
||||
//添加在线人员
|
||||
UserDetail detial = new UserDetail { ConnectionId = id, UserID = userID, UserName = userName, DeptName = deptName, LoginTime = DateTime.Now };
|
||||
ConnectedUsers[accountnum].Add(detial);
|
||||
MessageHandler.AddConnectedToRedis(detial, accountnum);//--redis新增
|
||||
// 反馈信息给登录者
|
||||
Clients.Caller.onConnected(id, userName, MessageHandler.GetFriends(Convert.ToDecimal(userID), accountnum));
|
||||
//LogHelper.Info(string.Format("ConnectionId = {0}, UserID = {1}, UserName = {2}, DeptName = {3}", id, userID, userName, deptName));
|
||||
// 通知所有用户,有新用户连接
|
||||
//Clients.AllExcept(id).onNewUserConnected(id, userID, userName, deptName, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送私聊
|
||||
/// </summary>
|
||||
/// <param name="toUserId">接收方用户连接ID</param>
|
||||
/// <param name="message">内容</param>
|
||||
public void SendPrivateMessage(string toUserId, string message, int eid, string accountnum)
|
||||
{
|
||||
//string fromUserId = Context.ConnectionId;
|
||||
//var toUser = ConnectedUsers.FirstOrDefault(x => x.ConnectionId == toUserId);
|
||||
//var fromUser = ConnectedUsers.FirstOrDefault(x => x.ConnectionId == fromUserId);
|
||||
|
||||
//if (toUser != null && fromUser != null)
|
||||
//{ // send to
|
||||
|
||||
MessageHandler.SendMsg(toUserId, message, eid, accountnum);
|
||||
|
||||
//Clients.Client(toUserId).receivePrivateMessage(fromUserId, fromUser.UserName, message);
|
||||
|
||||
// send to caller user
|
||||
//Clients.Caller.sendPrivateMessage(toUserId, fromUser.UserName, message);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// //表示对方不在线
|
||||
// Clients.Caller.absentSubscriber();Class1.cs
|
||||
//}
|
||||
}
|
||||
/// <summary>
|
||||
/// 批量发送
|
||||
/// </summary>
|
||||
/// <param name="toUserIds">接收人openID用“,”隔开</param>
|
||||
/// <param name="message">消息</param>
|
||||
/// <param name="accountnum">公众号</param>
|
||||
public void SendQFMessage(string toUserIds, string message, int eid, string accountnum)
|
||||
{
|
||||
LogHelper.Info("批量发送消息:" + toUserIds + ",message:" + message + ",accountnum:" + accountnum);
|
||||
if (string.IsNullOrEmpty(toUserIds))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string[] openIds = toUserIds.Split(',');
|
||||
foreach (string openId in openIds)
|
||||
{
|
||||
if (string.IsNullOrEmpty(openId))
|
||||
continue;
|
||||
MessageHandler.SendMsg(openId, message, eid, accountnum);
|
||||
}
|
||||
}
|
||||
///// <summary>
|
||||
///// 发送素材消息
|
||||
///// </summary>
|
||||
///// <param name="toUserId">目标人</param>
|
||||
///// <param name="name">素材名称</param>
|
||||
///// <param name="media_id">素材ID</param>
|
||||
///// <param name="sucaitype">素材类型</param>
|
||||
///// <param name="url">素材地址</param>
|
||||
///// <param name="accountnum">公众号</param>
|
||||
//public void SendSuCaiMessage(string toUserId, string name, string media_id, string sucaitype, string url, string accountnum)
|
||||
//{
|
||||
// if (sucaitype != "news")
|
||||
// {
|
||||
// ImageMsg msg = new ImageMsg();
|
||||
// msg.media_id = media_id;
|
||||
// MessageHandler.SendImgMsg(msg, sucaitype, toUserId, accountnum);
|
||||
// //if (MessageHandler.IsNeedDownLoadSuCai(media_id))
|
||||
// //{
|
||||
// // string imagepath=MessageHandler.DownLoadSuCaiPath(media_id, url);
|
||||
// // MessageHandler.appletmsg.WeapAddFilePath(0, media_id, imagepath);
|
||||
// //}
|
||||
// }
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// 离线
|
||||
/// </summary>
|
||||
public override System.Threading.Tasks.Task OnDisconnected(bool stopCalled)
|
||||
{
|
||||
try
|
||||
{
|
||||
//LogHelper.Error("有人离线了," + Context.ConnectionId);
|
||||
|
||||
foreach (var unn in ConnectedUsers)
|
||||
{
|
||||
//LogHelper.Error("公众号:" + unn.Key + ",在线人数:" + unn.Value.Count);
|
||||
var item = unn.Value.FirstOrDefault(x => x.ConnectionId == Context.ConnectionId);
|
||||
if (item != null)
|
||||
{
|
||||
MessageHandler.RemoveConnectedToRedis(item, unn.Key);//--redis新增
|
||||
//ConectedEids.Replace("[" + item.UserID + "]", "");
|
||||
//LogHelper.Info("客服离线:" + item.UserID);
|
||||
//Clients.All.onUserDisconnected(item.ConnectionId, item.UserName); //调用客户端用户离线通知
|
||||
ConnectedUsers[unn.Key].Remove(item);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception xx)
|
||||
{
|
||||
LogHelper.Error(xx.ToString());
|
||||
}
|
||||
return base.OnDisconnected(stopCalled);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,236 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
|
||||
namespace AppletMvcService.Common
|
||||
{
|
||||
public class RequestHelper
|
||||
{
|
||||
private static readonly string DefaultUserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0";
|
||||
|
||||
/// <summary>
|
||||
/// 创建GET方式的HTTP请求
|
||||
/// </summary>
|
||||
/// <param name="url">请求的URL</param>
|
||||
/// <param name="timeout">请求的超时时间</param>
|
||||
/// <param name="userAgent">请求的客户端浏览器信息,可以为空</param>
|
||||
/// <param name="cookies">随同HTTP请求发送的Cookie信息,如果不需要身份验证可以为空</param>
|
||||
/// <returns></returns>
|
||||
public static HttpWebResponse CreateGetHttpResponse(string url, int? timeout, string userAgent, CookieCollection cookies)
|
||||
{
|
||||
if (string.IsNullOrEmpty(url))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
HttpWebRequest request = null;
|
||||
HttpWebResponse response = null;
|
||||
try
|
||||
{
|
||||
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult);//验证服务器证书回调自动验证
|
||||
request = WebRequest.Create(url) as HttpWebRequest;
|
||||
request.Method = "GET";
|
||||
request.UserAgent = DefaultUserAgent;
|
||||
if (!string.IsNullOrEmpty(userAgent))
|
||||
{
|
||||
request.UserAgent = userAgent;
|
||||
}
|
||||
if (timeout.HasValue)
|
||||
{
|
||||
request.Timeout = timeout.Value;
|
||||
}
|
||||
if (cookies != null)
|
||||
{
|
||||
request.CookieContainer = new CookieContainer();
|
||||
request.CookieContainer.Add(cookies);
|
||||
}
|
||||
response = request.GetResponse() as HttpWebResponse;
|
||||
return response;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (response != null)
|
||||
{
|
||||
response.Close();
|
||||
}
|
||||
throw (ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static string CreateGetString(string url, int? timeout, string userAgent, CookieCollection cookies)
|
||||
{
|
||||
HttpWebResponse response = null;
|
||||
Stream stream = null;
|
||||
StreamReader sr = null;
|
||||
try
|
||||
{
|
||||
response = CreateGetHttpResponse(url, timeout, userAgent, cookies);
|
||||
if (response == null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
stream = response.GetResponseStream();
|
||||
sr = new StreamReader(stream);
|
||||
string strResult = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
stream.Close();
|
||||
response.Close();
|
||||
return strResult;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw (ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (sr != null) { sr.Close(); }
|
||||
if (stream != null) { stream.Close(); }
|
||||
if (response != null) { response.Close(); }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建POST方式的HTTP请求
|
||||
/// </summary>
|
||||
/// <param name="url">请求的URL</param>
|
||||
/// <param name="parameters">随同请求POST的参数名称及参数值字典</param>
|
||||
/// <param name="timeout">请求的超时时间</param>
|
||||
/// <param name="userAgent">请求的客户端浏览器信息,可以为空</param>
|
||||
/// <param name="requestEncoding">发送HTTP请求时所用的编码</param>
|
||||
/// <param name="cookies">随同HTTP请求发送的Cookie信息,如果不需要身份验证可以为空</param>
|
||||
/// <returns></returns>
|
||||
public static HttpWebResponse CreatePostHttpResponse(string url, object postData, int? timeout, string userAgent, Encoding requestEncoding, CookieCollection cookies)
|
||||
{
|
||||
if (string.IsNullOrEmpty(url))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (requestEncoding == null)
|
||||
{
|
||||
requestEncoding = System.Text.Encoding.UTF8;
|
||||
}
|
||||
HttpWebRequest request = null;
|
||||
HttpWebResponse response = null;
|
||||
try
|
||||
{
|
||||
//如果是发送HTTPS请求
|
||||
if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
|
||||
request = WebRequest.Create(url) as HttpWebRequest;
|
||||
request.ProtocolVersion = HttpVersion.Version10;
|
||||
}
|
||||
else
|
||||
{
|
||||
request = WebRequest.Create(url) as HttpWebRequest;
|
||||
}
|
||||
request.Method = "POST";
|
||||
request.ContentType = "application/x-www-form-urlencoded";
|
||||
if (!string.IsNullOrEmpty(userAgent))
|
||||
{
|
||||
request.UserAgent = userAgent;
|
||||
}
|
||||
else
|
||||
{
|
||||
request.UserAgent = DefaultUserAgent;
|
||||
}
|
||||
if (timeout.HasValue)
|
||||
{
|
||||
request.Timeout = timeout.Value;
|
||||
}
|
||||
if (cookies != null)
|
||||
{
|
||||
request.CookieContainer = new CookieContainer();
|
||||
request.CookieContainer.Add(cookies);
|
||||
}
|
||||
string strBuffer = string.Empty;
|
||||
if (postData is string)
|
||||
{
|
||||
strBuffer = (string)postData;
|
||||
}
|
||||
else if (postData is IDictionary<string, string>)
|
||||
{
|
||||
IDictionary<string, string> parameters = (IDictionary<string, string>)postData;
|
||||
//如果需要POST数据
|
||||
if (!(parameters == null || parameters.Count == 0))
|
||||
{
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
int i = 0;
|
||||
foreach (string key in parameters.Keys)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
buffer.AppendFormat("&{0}={1}", key, parameters[key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer.AppendFormat("{0}={1}", key, parameters[key]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
strBuffer = buffer.ToString();
|
||||
}
|
||||
}
|
||||
byte[] data = requestEncoding.GetBytes(strBuffer.ToString());
|
||||
using (Stream stream = request.GetRequestStream())
|
||||
{
|
||||
stream.Write(data, 0, data.Length);
|
||||
}
|
||||
response = request.GetResponse() as HttpWebResponse;
|
||||
return response;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (response != null)
|
||||
{
|
||||
response.Close();
|
||||
}
|
||||
throw (ex);
|
||||
}
|
||||
}
|
||||
public static string WebClientRequest(string url, string postData, Encoding coding, string method = "POST")
|
||||
{
|
||||
WebClient webClient = new WebClient();
|
||||
webClient.Encoding = coding;
|
||||
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
||||
string result = webClient.UploadString(url, method, postData.ToString());
|
||||
return result;
|
||||
}
|
||||
public static string CreatePostGetString(string url, object postData, int? timeout, string userAgent, Encoding requestEncoding, CookieCollection cookies)
|
||||
{
|
||||
HttpWebResponse response = null;
|
||||
Stream stream = null;
|
||||
StreamReader sr = null;
|
||||
try
|
||||
{
|
||||
response = CreatePostHttpResponse(url, postData, timeout, userAgent, requestEncoding, cookies);
|
||||
if (response == null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
stream = response.GetResponseStream();
|
||||
sr = new StreamReader(stream);
|
||||
string strResult = sr.ReadToEnd();
|
||||
return strResult;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw (ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (sr != null) { sr.Close(); }
|
||||
if (stream != null) { stream.Close(); }
|
||||
if (response != null) { response.Close(); }
|
||||
}
|
||||
}
|
||||
|
||||
private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
|
||||
{
|
||||
return true; //总是接受
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,279 @@
|
|||
using Ninject;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using WX.CRM.Common;
|
||||
using WX.CRM.IBLL.Base;
|
||||
using WX.CRM.IBLL.weapp;
|
||||
using WX.CRM.Model.Entity;
|
||||
using WX.CRM.WebHelper;
|
||||
using WX.CRM.WebHelper.Infrastructure;
|
||||
|
||||
namespace AppletMvcService.Controllers
|
||||
{
|
||||
|
||||
//[EnableCors("http://localhost:10229", "*", "*")]
|
||||
public class WxGroupSvrController : Controller
|
||||
{
|
||||
private readonly IWEAPP_GROUP _weappGroup = NinjectControllerFactory.ninjectKernel.Get<IWEAPP_GROUP>();
|
||||
private readonly IWEAPP_USERGROUP _weappUserGroup = NinjectControllerFactory.ninjectKernel.Get<IWEAPP_USERGROUP>();
|
||||
private readonly IWEAPP_FRIENDS _weappFriends = NinjectControllerFactory.ninjectKernel.Get<IWEAPP_FRIENDS>();
|
||||
private readonly ISEQUENCES _sequences = NinjectControllerFactory.ninjectKernel.Get<ISEQUENCES>();
|
||||
/// <summary>
|
||||
/// 编辑分组的时候列出全部分组
|
||||
/// </summary>
|
||||
/// <param name="accountNum"></param>
|
||||
/// <param name="eId"></param>
|
||||
/// <returns></returns>
|
||||
public JsonResult GetGroup(string accountNum, decimal eId)
|
||||
{
|
||||
try
|
||||
{
|
||||
//var sw = new Stopwatch();
|
||||
//sw.Start();
|
||||
var list = _weappGroup.GetGroup(accountNum, eId);
|
||||
//sw.Stop();
|
||||
//LogHelper.Info("请求时间:" + sw.ElapsedMilliseconds);
|
||||
return Json(new { type = 1, data = list }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return JsonHandler.ManageMessage(ex.Message, false);
|
||||
}
|
||||
}
|
||||
|
||||
public JsonResult AddGroup(decimal eid, string groupName, string accountNum)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(groupName) || string.IsNullOrEmpty(accountNum))
|
||||
{
|
||||
return JsonHandler.ManageMessage("参数错误,请确认!", false);
|
||||
}
|
||||
var info = new WEAPP_GROUP
|
||||
{
|
||||
PKID = _sequences.Seq_base_get(),
|
||||
GROUPNAME = groupName,
|
||||
GROUPTYPE = 1,
|
||||
SALEUSEREID = eid,
|
||||
CTIME = DateTime.Now,
|
||||
ACCOUNTNUM = accountNum
|
||||
};
|
||||
var ret = _weappGroup.Add(info) > 0 ? 1 : 0;
|
||||
return Json(new { type = ret, pkid = info.PKID }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return JsonHandler.ManageMessage(ex.Message, false);
|
||||
}
|
||||
}
|
||||
|
||||
public JsonResult UpdateGroup(decimal groupId, decimal eid, string groupName, string accountNum)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (groupId == 0)
|
||||
return AddGroup(eid, groupName, accountNum);
|
||||
if (string.IsNullOrEmpty(groupName) || string.IsNullOrEmpty(accountNum))
|
||||
{
|
||||
return JsonHandler.ManageMessage("参数错误,请确认!", false);
|
||||
}
|
||||
WEAPP_GROUP info = _weappGroup.Get(p => p.PKID == groupId);
|
||||
info.GROUPNAME = groupName;
|
||||
info.ACCOUNTNUM = accountNum;
|
||||
var ret = _weappGroup.Update(info) ? 1 : 0;
|
||||
return Json(new { type = ret }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return JsonHandler.ManageMessage(ex.Message, false);
|
||||
}
|
||||
}
|
||||
|
||||
public JsonResult DeleteGroup(decimal groupId)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (groupId <= 0)
|
||||
{
|
||||
return JsonHandler.ManageMessage("参数错误,请确认!", false);
|
||||
}
|
||||
_weappUserGroup.Delete(p => p.GROUPID == groupId);
|
||||
var ret = _weappGroup.Delete(p => p.PKID == groupId) ? 1 : 0;
|
||||
return Json(new { type = ret }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return JsonHandler.ManageMessage(ex.Message, false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取客服 所有的和客户的分组情况
|
||||
/// </summary>
|
||||
/// <param name="accountNum"></param>
|
||||
/// <param name="eId"></param>
|
||||
/// <returns></returns>
|
||||
public JsonResult GetUserGroup(string accountNum, decimal eId)
|
||||
{
|
||||
try
|
||||
{
|
||||
//var sw = new Stopwatch();
|
||||
//sw.Start();
|
||||
var list = new List<UserGroupView>();
|
||||
var userGroupView = _weappGroup.GetUserGroup(accountNum, eId);
|
||||
var groups = userGroupView.groups;
|
||||
foreach (var item in groups)
|
||||
{
|
||||
var userGroup = userGroupView.userGroups.Where(p => p.GROUPID == item.PKID);
|
||||
var userGroupList = new List<UserGroup>();
|
||||
foreach (var row in userGroup)
|
||||
{
|
||||
var data = new UserGroup { GroupId = row.GROUPID, OpenId = row.OPENID, SaleUserEid = row.SALEUSEREID };
|
||||
userGroupList.Add(data);
|
||||
}
|
||||
var info = new UserGroupView()
|
||||
{
|
||||
GroupId = item.PKID,
|
||||
GroupName = item.GROUPNAME,
|
||||
GroupType = item.GROUPTYPE,
|
||||
SaleUserEid = item.SALEUSEREID,
|
||||
AccountNum = item.ACCOUNTNUM,
|
||||
UserGroupList = userGroupList
|
||||
};
|
||||
list.Add(info);
|
||||
}
|
||||
//sw.Stop();
|
||||
//LogHelper.Info("请求时间:" + sw.ElapsedMilliseconds);
|
||||
return Json(new { type = 1, data = list }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return JsonHandler.ManageMessage(ex.Message, false);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取客户的单个分组情况
|
||||
/// </summary>
|
||||
/// <param name="accountnum"></param>
|
||||
/// <param name="openid"></param>
|
||||
/// <param name="eid"></param>
|
||||
/// <returns></returns>
|
||||
public JsonResult GetUserInGroupByOpenId(string accountnum, string openid, decimal eId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var list = _weappGroup.GetList(p => p.GROUPTYPE == 1 && p.ACCOUNTNUM == accountnum && p.SALEUSEREID == eId).OrderBy(m => m.CTIME);
|
||||
var userGroups = _weappUserGroup.GetList(p => p.SALEUSEREID == eId && p.ACCOUNTNUM == accountnum && p.OPENID == openid);
|
||||
List<object> xnn = new List<object>();
|
||||
foreach (var item in userGroups)
|
||||
{
|
||||
xnn.Add(new { gid = item.GROUPID });
|
||||
}
|
||||
return Json(new { type = 1, data = xnn, data2 = list }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return JsonHandler.ManageMessage(ex.Message, false);
|
||||
}
|
||||
}
|
||||
|
||||
public JsonResult UpdateUserGroup(string accountNum, decimal eId, string openId, string groups)
|
||||
{
|
||||
try
|
||||
{
|
||||
var sysGid = _weappGroup.GetList(m => m.GROUPTYPE == 0).Select(m => m.PKID);
|
||||
_weappUserGroup.Delete(p => p.OPENID == openId && p.SALEUSEREID == eId && !sysGid.Contains(p.GROUPID));//不能删除系统分组
|
||||
var list = new List<WEAPP_USERGROUP>();
|
||||
var groupList = new List<string>(groups.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
|
||||
foreach (var item in groupList)
|
||||
{
|
||||
var info = new WEAPP_USERGROUP
|
||||
{
|
||||
PKID = _sequences.Seq_base_get(),
|
||||
GROUPID = Convert.ToDecimal(item),
|
||||
SALEUSEREID = eId,
|
||||
OPENID = openId,
|
||||
ACCOUNTNUM = accountNum,
|
||||
CTIME = DateTime.Now
|
||||
};
|
||||
list.Add(info);
|
||||
}
|
||||
_weappUserGroup.AddList(list);
|
||||
return Json(new { type = 1 }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return JsonHandler.ManageMessage(ex.Message, false);
|
||||
}
|
||||
}
|
||||
|
||||
public JsonResult DeleteUserGroup(UserGroup userGroup)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (userGroup.GroupId <= 0 || userGroup.SaleUserEid <= 0 || string.IsNullOrEmpty(userGroup.OpenId))
|
||||
{
|
||||
return JsonHandler.ManageMessage("参数错误,请确认!", false);
|
||||
}
|
||||
var ret = _weappUserGroup.Delete(p => p.GROUPID == userGroup.GroupId && p.OPENID == userGroup.OpenId) ? 1 : 0;
|
||||
return Json(new { type = ret }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return JsonHandler.ManageMessage(ex.Message, false);
|
||||
}
|
||||
}
|
||||
|
||||
public JsonResult UpdateRemark(string OPENID, string REMARKS, string ACCOUNTNUM, int EID)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(OPENID) || string.IsNullOrEmpty(ACCOUNTNUM) || EID <= 0)
|
||||
{
|
||||
return JsonHandler.ManageMessage("参数错误,请确认!", false);
|
||||
}
|
||||
var info = _weappFriends.Get(p => p.EID == EID && p.OPENID == OPENID && p.ACCOUNTNUM == ACCOUNTNUM);
|
||||
if (info == null)
|
||||
{
|
||||
return Json(new { type = 0, message = "未找到记录!" }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
info.REMARKS = REMARKS;
|
||||
var ret = _weappFriends.Update(info) ? "1" : "0";
|
||||
return Json(new { type = ret }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return JsonHandler.ManageMessage(ex.Message, false);
|
||||
}
|
||||
}
|
||||
|
||||
public class UserGroupView
|
||||
{
|
||||
public decimal GroupId { get; set; }
|
||||
public string GroupName { get; set; }
|
||||
public decimal GroupType { get; set; }
|
||||
public decimal? SaleUserEid { get; set; }
|
||||
public string AccountNum { get; set; }
|
||||
public List<UserGroup> UserGroupList { get; set; }
|
||||
}
|
||||
|
||||
public class UserGroup
|
||||
{
|
||||
public decimal GroupId { get; set; }
|
||||
public decimal SaleUserEid { get; set; }
|
||||
public string OpenId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,715 @@
|
|||
using AppletMvcService.Common;
|
||||
using AppletMvcService.Hanlder;
|
||||
using AppletMvcService.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Security;
|
||||
using WX.CRM.Common;
|
||||
using WX.CRM.Model.weapp;
|
||||
namespace AppletMvcService.Controllers
|
||||
{
|
||||
//[EnableCors("http://localhost:10229", "*", "*")]
|
||||
public class WxMessageSvrController : Controller
|
||||
{
|
||||
|
||||
#region 消息接口
|
||||
//
|
||||
// GET: /WxMessageSvr/
|
||||
public string AppletMsg(AppletMsgModel appletMsg, string signature, string timestamp, string nonce)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ConfigurationManager.AppSettings["weappIsTest"] != null && ConfigurationManager.AppSettings["weappIsTest"] == "false")
|
||||
{ //不是测试的有些数据需要转发到测试站点去
|
||||
if (MessageHandler.GetWxAccount().ContainsKey(appletMsg.ToUserName) && MessageHandler.GetWxAccount()[appletMsg.ToUserName].isonline == 0)
|
||||
{
|
||||
return AppletMsgRedirect(appletMsg, signature, timestamp, nonce);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//LogHelper.Info("数据:" + Utility.ConvertToJSON(appletMsg));
|
||||
if (!IsFromWxServ(signature, timestamp, nonce))
|
||||
{
|
||||
//LogHelper.Info("验证失败");
|
||||
return "fail";
|
||||
}
|
||||
//LogHelper.Info("验证成功");
|
||||
//LogHelper.Info(string.Format("FromUserName:{0},MsgId:{1},MsgType:{2},ToUserName:{3},Content:{4}", appletMsg.FromUserName, appletMsg.MsgId, appletMsg.MsgType, appletMsg.ToUserName, appletMsg.Content));
|
||||
string eid = "1";
|
||||
int isNew = 0;
|
||||
int isNeedSendMsg = 1;//是否需要发送提示消息到前段
|
||||
int ntype = 1;//1.普通消息 2.关注 3.取消关注 0界面操作
|
||||
int isNeedFenPei = 1;
|
||||
string msgType = "txt";//消息类型
|
||||
if (MessageHandler.GetWxAccount().ContainsKey(appletMsg.ToUserName))
|
||||
{
|
||||
if (appletMsg.MsgType == "event" && appletMsg.Event == "subscribe")//关注和取消关注
|
||||
{
|
||||
msgType = "subscribe";
|
||||
appletMsg.Content = "关注了公众号!";
|
||||
ntype = 2;
|
||||
MessageHandler.weapp_update_subscribe(appletMsg.FromUserName, appletMsg.Event, DateTimeTool.GetTimeFromLinuxShortTime(appletMsg.CreateTime), appletMsg.ToUserName);
|
||||
}
|
||||
else if (appletMsg.MsgType == "event" && appletMsg.Event == "unsubscribe")
|
||||
{
|
||||
msgType = "unsubscribe";
|
||||
appletMsg.Content = "取消了公众号关注!";
|
||||
ntype = 3;
|
||||
MessageHandler.weapp_update_subscribe(appletMsg.FromUserName, appletMsg.Event, DateTimeTool.GetTimeFromLinuxShortTime(appletMsg.CreateTime), appletMsg.ToUserName);
|
||||
//isNeedSendMsg = 0;
|
||||
isNeedFenPei = 1;
|
||||
}
|
||||
else if (appletMsg.MsgType == "event")
|
||||
{
|
||||
ntype = 0;
|
||||
isNeedSendMsg = 0;
|
||||
}
|
||||
if (isNeedFenPei == 1)//需要分配
|
||||
eid = MessageHandler.GetFenPeiEID(ntype, appletMsg.FromUserName, "", appletMsg.ToUserName, MessageHandler.GetWxAccount()[appletMsg.ToUserName].fenPeiPoc, ref isNew);
|
||||
}
|
||||
//LogHelper.Error("isNew:" + isNew);
|
||||
bool issucced = MessageHandler.appletmsg.WeapAddMessage(appletMsg, Convert.ToInt32(eid), 0, 0);//插入消息表
|
||||
if (appletMsg.MsgType == "image")
|
||||
{
|
||||
//图片类型,进行图片下载
|
||||
msgType = "image";
|
||||
string imagepath = DownLoadPath(appletMsg.PicUrl);
|
||||
MessageHandler.appletmsg.WeapAddFilePath(appletMsg.MsgId, appletMsg.MediaId, imagepath);
|
||||
if (eid != "1" && isNeedSendMsg == 1)
|
||||
ChatHub.SendAllMessage(eid, appletMsg.FromUserName, "[imagepath]:" + imagepath, msgType, appletMsg.ToUserName, isNew);
|
||||
//else
|
||||
// MessageHandler.SendNoLineMsg(appletMsg.FromUserName);
|
||||
}
|
||||
else if (appletMsg.MsgType == "voice")
|
||||
{
|
||||
//MessageHandler.GetSuCaiUrl(appletMsg.MediaId, appletMsg.ToUserName);
|
||||
|
||||
GetVoice(appletMsg.MediaId, appletMsg.ToUserName);
|
||||
ChatHub.SendAllMessage(eid, appletMsg.FromUserName, "[voice]:" + appletMsg.MediaId, msgType, appletMsg.ToUserName, isNew);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (eid != "1" && isNeedSendMsg == 1)
|
||||
ChatHub.SendAllMessage(eid, appletMsg.FromUserName, appletMsg.Content, msgType, appletMsg.ToUserName, isNew);
|
||||
//else
|
||||
// MessageHandler.SendNoLineMsg(appletMsg.FromUserName);
|
||||
}
|
||||
if (issucced)
|
||||
return "success";
|
||||
else
|
||||
return "fail";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return "fail";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 从定向数据
|
||||
/// <summary>
|
||||
/// 转发重定向消息
|
||||
/// </summary>
|
||||
/// <param name="appletMsg"></param>
|
||||
/// <param name="signature"></param>
|
||||
/// <param name="timestamp"></param>
|
||||
/// <param name="nonce"></param>
|
||||
/// <returns></returns>
|
||||
public string AppletMsgRedirect(AppletMsgModel appletMsg, string signature, string timestamp, string nonce)
|
||||
{
|
||||
string nul = "";
|
||||
try
|
||||
{
|
||||
string url = ConfigurationManager.AppSettings["weappTestService"] + "/WxMessageSvr/AppletMsg?signature=" + signature + "×tamp=" + timestamp + "&nonce=" + nonce;
|
||||
nul = url;
|
||||
string result = RequestHelper.WebClientRequest(url, Utility.ConvertToJSON(appletMsg), Encoding.UTF8);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error("转接出现错误:" + ex.ToString());
|
||||
LogHelper.Error("转接出现数据:" + Utility.ConvertToJSON(appletMsg));
|
||||
LogHelper.Error("转接出现地址:" + nul);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 用户信息接口
|
||||
public string UserInfoReceive(web_push_wxUserServiceModel t)
|
||||
{
|
||||
bool issucced = true;
|
||||
try
|
||||
{
|
||||
|
||||
ValidationErrors errors = new ValidationErrors();
|
||||
DateTime time = DateTimeTool.GetTimeFromLinuxShortTime(t.SubscribeTime);
|
||||
issucced = MessageHandler.userinfo.weapp_userinfo_Storage(t.OpenId, t.NickName, t.Gender, t.Language, t.City, t.Province, t.Country, t.AvatarUrl, t.Type, t.UnionId, t.Subscribe, time, t.AccountNum);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
issucced = false;
|
||||
LogHelper.Error("数据:" + JsonConvert.SerializeObject(t));
|
||||
LogHelper.Error(ex.ToString());
|
||||
}
|
||||
if (issucced)
|
||||
return "success";
|
||||
else
|
||||
return "fail";
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 文件上传
|
||||
|
||||
//保存文件
|
||||
public JsonResult UploadImage(string toUser, string accountnum, int eid)
|
||||
{
|
||||
|
||||
string filepath = string.Empty;
|
||||
string erromsg = string.Empty;
|
||||
int issucced = 1;
|
||||
try
|
||||
{
|
||||
HttpPostedFileBase file = Request.Files["uploadFile"];
|
||||
var yearMonth = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
|
||||
string uploadFolder = (ConfigurationManager.AppSettings["weappfile"] ?? "weappfile") + "/" + yearMonth;
|
||||
string filename = file.FileName;
|
||||
string suffix = filename.Substring(filename.LastIndexOf(".") + 1, (filename.Length - filename.LastIndexOf(".") - 1)); //扩展名
|
||||
suffix = suffix.ToLower();
|
||||
string fileType = "image";
|
||||
if (suffix == "amr" || suffix == "mp3")
|
||||
{
|
||||
fileType = "voice";
|
||||
}
|
||||
else if (suffix == "mp4")
|
||||
{
|
||||
fileType = "video";
|
||||
}
|
||||
else if (suffix == "png" || suffix == "jpeg" || suffix == "jpg" || suffix == "gif")
|
||||
{
|
||||
fileType = "image";
|
||||
}
|
||||
else
|
||||
{
|
||||
var json2 = new
|
||||
{
|
||||
fileName = "",
|
||||
result = 0,
|
||||
erro = "文件格式不对!"
|
||||
};
|
||||
JsonResult rs2 = Json(json2);
|
||||
rs2.ContentType = "text/html";
|
||||
return rs2;
|
||||
}
|
||||
//string suffix = "png";
|
||||
if (!Directory.Exists(uploadFolder))
|
||||
{
|
||||
Directory.CreateDirectory(uploadFolder);
|
||||
}
|
||||
string imgname = "S" + DateTime.Now.ToString("yyyyMMddHHmmssffff") + "." + suffix;//文件名称
|
||||
string path = Path.Combine(uploadFolder, imgname);
|
||||
filepath = "/" + yearMonth + "/" + imgname;
|
||||
file.SaveAs(path);
|
||||
|
||||
|
||||
ImageMsg imgmodel = MessageHandler.SendImg(fileType, accountnum, path, "/" + yearMonth + "/" + imgname);
|
||||
if (imgmodel == null)
|
||||
{
|
||||
filepath = "";
|
||||
erromsg = "发送临时素材失败!";
|
||||
issucced = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] opeIds = toUser.Split(',');
|
||||
string content = string.Empty;
|
||||
foreach (string opeId in opeIds)
|
||||
{
|
||||
if (string.IsNullOrEmpty(opeId))
|
||||
continue;
|
||||
MessageHandler.SendImgMsg(imgmodel, fileType, opeId, accountnum, eid, "", ref content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
filepath += "";
|
||||
erromsg = ex.ToString();
|
||||
issucced = 0;
|
||||
}
|
||||
var json = new
|
||||
{
|
||||
fileName = filepath,
|
||||
result = issucced,
|
||||
erro = erromsg
|
||||
};
|
||||
JsonResult rs = Json(json);
|
||||
rs.ContentType = "text/html";
|
||||
return rs;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 发送素材
|
||||
public JsonResult SendSuCai(string toUserId, string name, string media_id, string sucaitype, string url, string accountnum, int eid)
|
||||
{
|
||||
string filepath = string.Empty;
|
||||
string erromsg = string.Empty;
|
||||
int issucced = 1;
|
||||
string content = string.Empty;
|
||||
try
|
||||
{
|
||||
//if (sucaitype != "news")
|
||||
//{
|
||||
ImageMsg msg = new ImageMsg();
|
||||
msg.media_id = media_id;
|
||||
string[] openIds = toUserId.Split(',');
|
||||
foreach (string openId in openIds)
|
||||
{
|
||||
if (string.IsNullOrEmpty(openId))
|
||||
continue;
|
||||
MessageHandler.SendImgMsg(msg, sucaitype, openId, accountnum, eid, name, ref content);
|
||||
}
|
||||
if (sucaitype == "image")
|
||||
{
|
||||
DataTable tab = MessageHandler.IsNeedDownLoadSuCai(media_id);
|
||||
if (tab != null && tab.Rows.Count == 0)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(url) && url != "null")
|
||||
{
|
||||
string imagepath = MessageHandler.DownLoadSuCaiPath(media_id, url);
|
||||
MessageHandler.appletmsg.WeapAddFilePath(0, media_id, imagepath);
|
||||
filepath = imagepath;
|
||||
}
|
||||
}
|
||||
else if (tab != null && tab.Rows.Count > 0)
|
||||
{
|
||||
filepath = tab.Rows[0]["Path"].ToString();
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
filepath += "";
|
||||
erromsg = ex.ToString();
|
||||
issucced = 0;
|
||||
}
|
||||
var json = new
|
||||
{
|
||||
fileName = filepath,
|
||||
result = issucced,
|
||||
erro = erromsg,
|
||||
content = content
|
||||
};
|
||||
JsonResult rs = Json(json);
|
||||
rs.ContentType = "text/html";
|
||||
return rs;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 预览图片素材
|
||||
/// <summary>
|
||||
/// 预览图片素材
|
||||
/// </summary>
|
||||
/// <param name="media_id">素材ID</param>
|
||||
/// <param name="url">素材URL</param>
|
||||
/// <returns></returns>
|
||||
public JsonResult ImgPreview(string media_id, string url)
|
||||
{
|
||||
string filepath = string.Empty;
|
||||
string erromsg = string.Empty;
|
||||
int issucced = 1;
|
||||
try
|
||||
{
|
||||
DataTable tab = MessageHandler.IsNeedDownLoadSuCai(media_id);
|
||||
if (tab != null && tab.Rows.Count == 0)
|
||||
{
|
||||
string imagepath = MessageHandler.DownLoadSuCaiPath(media_id, url);
|
||||
MessageHandler.appletmsg.WeapAddFilePath(0, media_id, imagepath);
|
||||
filepath = imagepath;
|
||||
}
|
||||
else if (tab != null && tab.Rows.Count > 0)
|
||||
{
|
||||
filepath = tab.Rows[0]["Path"].ToString();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
filepath += "";
|
||||
erromsg = ex.ToString();
|
||||
issucced = 0;
|
||||
}
|
||||
var json = new
|
||||
{
|
||||
fileName = filepath,
|
||||
result = issucced,
|
||||
erro = erromsg
|
||||
};
|
||||
JsonResult rs = Json(json);
|
||||
rs.ContentType = "text/html";
|
||||
return rs;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 下载文件
|
||||
/// <summary>
|
||||
/// 下载文件
|
||||
/// </summary>
|
||||
/// <param name="URLAddress"></param>
|
||||
/// <returns></returns>
|
||||
private string DownLoadPath(string URLAddress)
|
||||
{
|
||||
string filepath = string.Empty;
|
||||
try
|
||||
{
|
||||
WebClient client = new WebClient();
|
||||
Stream str = client.OpenRead(URLAddress);
|
||||
StreamReader reader = new StreamReader(str);
|
||||
byte[] mbyte = new byte[1000000];
|
||||
int allmybyte = (int)mbyte.Length;
|
||||
int startmbyte = 0;
|
||||
|
||||
while (allmybyte > 0)
|
||||
{
|
||||
|
||||
int m = str.Read(mbyte, startmbyte, allmybyte);
|
||||
if (m == 0)
|
||||
break;
|
||||
|
||||
startmbyte += m;
|
||||
allmybyte -= m;
|
||||
}
|
||||
|
||||
reader.Dispose();
|
||||
str.Dispose();
|
||||
var yearMonth = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
|
||||
string uploadFolder = (ConfigurationManager.AppSettings["weappfile"] ?? "weappfile") + "/" + yearMonth;
|
||||
if (!Directory.Exists(uploadFolder))
|
||||
{
|
||||
Directory.CreateDirectory(uploadFolder);
|
||||
}
|
||||
string imgname = "G" + DateTime.Now.ToString("yyyyMMddHHmmssffff") + ".jpg";
|
||||
string path = Path.Combine(uploadFolder, imgname);
|
||||
filepath = "/" + yearMonth + "/" + imgname;
|
||||
FileStream fstr = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
|
||||
fstr.Write(mbyte, 0, startmbyte);
|
||||
fstr.Flush();
|
||||
fstr.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error("download erro:" + ex.ToString());
|
||||
filepath = "";
|
||||
}
|
||||
return filepath;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取素材列表
|
||||
/// <summary>
|
||||
/// 获取素材列表
|
||||
/// </summary>
|
||||
/// <param name="type">素材类型 图片(image)、视频(video)、语音 (voice)、图文(news)</param>
|
||||
/// <param name="count">显示数量</param>
|
||||
/// <returns></returns>
|
||||
public JsonResult GetSuCai(string type, int count, int offset, string accountnum)
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] ntypes = { "image", "video", "voice", "news" };
|
||||
if (!type.Contains(type))
|
||||
return Json(new { result = false, msg = "参数错误" });
|
||||
|
||||
object obj = MessageHandler.GetSucaiModel(type, count, offset, accountnum);
|
||||
return Json(obj);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return Json(new { result = false, msg = "系统错误:" + ex.ToString() });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 接口验证
|
||||
private const string Token = "wxapi_hc";
|
||||
private bool IsFromWxServ(string signature, string timestamp, string nonce)
|
||||
{
|
||||
|
||||
var strArray = new string[] { nonce, timestamp, Token };
|
||||
Array.Sort(strArray);
|
||||
string strContent = string.Join("", strArray);
|
||||
strContent = EncryptSHA1(strContent);//进行sha1加密
|
||||
strContent = strContent.ToLower();
|
||||
if (signature == strContent)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
public static string EncryptSHA1(string value)
|
||||
{
|
||||
if (value == null || value.Trim() == "")
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FormsAuthentication.HashPasswordForStoringInConfigFile(value, "SHA1");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取未读消息
|
||||
|
||||
/// <summary>
|
||||
/// 获取未读消息
|
||||
/// </summary>
|
||||
/// <param name="eid">工号</param>
|
||||
/// <returns></returns>
|
||||
public JsonResult GetUnReadMsg(int eid, string accountnum)
|
||||
{
|
||||
|
||||
DataTable tab = MessageHandler.appletmsg.GetUnReadMsg(eid, accountnum);
|
||||
List<UnReadMsgModel> list = new List<UnReadMsgModel>();
|
||||
if (tab != null && tab.Rows.Count > 0)
|
||||
{
|
||||
UnReadMsgModel model = null;
|
||||
foreach (DataRow row in tab.Rows)
|
||||
{
|
||||
model = new UnReadMsgModel();
|
||||
model.id = Convert.ToInt32(row["id"]);
|
||||
model.issend = Convert.ToInt32(row["issend"]);
|
||||
model.msgtype = row["msgtype"].ToString();
|
||||
model.openId = row["fromusername"].ToString();
|
||||
model.content = row["content"].ToString();
|
||||
model.createtime = Convert.ToInt64(row["createtime"]);
|
||||
model.eid = Convert.ToInt32(row["eid"]);
|
||||
if (row["Path"] != DBNull.Value)
|
||||
model.filepath = row["Path"].ToString();
|
||||
else
|
||||
model.filepath = "";
|
||||
list.Add(model);
|
||||
}
|
||||
}
|
||||
return Json(list);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取已读的新消息(虽然已读,但是未生成在JSON文件中)
|
||||
/// <summary>
|
||||
/// 获取已读的新消息(虽然已读,但是未生成在JSON文件中)
|
||||
/// </summary>
|
||||
/// <param name="eid">工号</param>
|
||||
/// <param name="accountnum">公众号</param>
|
||||
/// <param name="pkid">界面加载的最大PKID</param>
|
||||
/// <returns></returns>
|
||||
public JsonResult GetNewAndIsReadMsg(int eid, string accountnum, string openid, long pkid)
|
||||
{
|
||||
|
||||
DataTable tab = MessageHandler.appletmsg.GetNewAndIsReadMsg(eid, accountnum, openid, pkid);
|
||||
List<UnReadMsgModel> list = new List<UnReadMsgModel>();
|
||||
if (tab != null && tab.Rows.Count > 0)
|
||||
{
|
||||
UnReadMsgModel model = null;
|
||||
foreach (DataRow row in tab.Rows)
|
||||
{
|
||||
model = new UnReadMsgModel();
|
||||
model.id = Convert.ToInt32(row["id"]);
|
||||
model.issend = Convert.ToInt32(row["issend"]);
|
||||
model.msgtype = row["msgtype"].ToString();
|
||||
model.openId = row["fromusername"].ToString();
|
||||
model.content = row["content"].ToString();
|
||||
model.createtime = Convert.ToInt64(row["createtime"]);
|
||||
model.eid = Convert.ToInt32(row["eid"]);
|
||||
if (row["Path"] != DBNull.Value)
|
||||
model.filepath = row["Path"].ToString();
|
||||
else
|
||||
model.filepath = "";
|
||||
if (row["mediaid"] != DBNull.Value)
|
||||
model.mediaid = row["mediaid"].ToString();
|
||||
else
|
||||
model.mediaid = "";
|
||||
list.Add(model);
|
||||
}
|
||||
}
|
||||
return Json(list);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 修改状态
|
||||
/// <summary>
|
||||
/// 修改状态
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public JsonResult UpdateIsAlreadyRead(int eid, string openId, string accountnum)
|
||||
{
|
||||
string erromsg = string.Empty;
|
||||
int issucced = 1;
|
||||
try
|
||||
{
|
||||
if (!MessageHandler.appletmsg.UpdateIsAlreadyRead(eid, openId, accountnum))
|
||||
issucced = 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
erromsg = ex.ToString();
|
||||
issucced = 0;
|
||||
}
|
||||
var json = new
|
||||
{
|
||||
result = issucced,
|
||||
erro = erromsg
|
||||
};
|
||||
JsonResult rs = Json(json);
|
||||
rs.ContentType = "text/html";
|
||||
return rs;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取历史消息文件列表
|
||||
public JsonResult GetHisMsgFile(string openid, string accountnum)
|
||||
{
|
||||
string erroMsg = string.Empty;
|
||||
List<string> list = new List<string>();//定义list变量,存放获取到的路径
|
||||
int issucced = 0;
|
||||
try
|
||||
{
|
||||
string path = ConfigurationManager.AppSettings["WxMsgFile"] == null ? "D:\\web\\WXCRM\\MessageGh\\" : System.Configuration.ConfigurationManager.AppSettings["WxMsgFile"] + accountnum + "/" + openid + "/";
|
||||
DirectoryInfo dir = new DirectoryInfo(path);
|
||||
if (dir.Exists)
|
||||
{
|
||||
FileInfo[] fil = dir.GetFiles();
|
||||
DirectoryInfo[] dii = dir.GetDirectories();
|
||||
foreach (FileInfo f in fil)
|
||||
{
|
||||
list.Add(f.Name);//添加文件的路径到列表
|
||||
}
|
||||
list = list.OrderByDescending(m => m).ToList();
|
||||
}
|
||||
issucced = 1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
erroMsg = ex.ToString();
|
||||
}
|
||||
JsonResult rs = Json(new { result = issucced, data = list, erro = erroMsg });
|
||||
rs.ContentType = "text/html";
|
||||
return rs;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取语音地址
|
||||
public JsonResult GetVoice(string MediaId, string accountNum)
|
||||
{
|
||||
if (string.IsNullOrEmpty(MediaId))
|
||||
return Json(new { result = false, msg = "参数错误" });
|
||||
bool result = false;
|
||||
string erro = string.Empty;
|
||||
string filepath = string.Empty;
|
||||
try
|
||||
{
|
||||
DataTable tab = MessageHandler.IsNeedDownLoadSuCai(MediaId);
|
||||
if (tab != null && tab.Rows.Count == 0)//需要进行文件下载
|
||||
{
|
||||
string voicePath = MessageHandler.GetSuCaiUrl(MediaId, accountNum, ref erro);//先进行文件下载
|
||||
if (!string.IsNullOrEmpty(voicePath))
|
||||
{
|
||||
MessageHandler.appletmsg.WeapAddFilePath(0, MediaId, voicePath);//然后进行
|
||||
filepath = voicePath;
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
else if (tab != null && tab.Rows.Count > 0)
|
||||
{
|
||||
filepath = tab.Rows[0]["Path"].ToString();
|
||||
result = true;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
erro = ex.ToString();
|
||||
LogHelper.Error(ex.ToString());
|
||||
}
|
||||
|
||||
return Json(new { result = result, voicePath = filepath, msg = erro });
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 将客户转接给目标客服
|
||||
/// <summary>
|
||||
/// 将客户转接给目标客服
|
||||
/// </summary>
|
||||
/// <param name="fromEid">原工号</param>
|
||||
/// <param name="toEid">目标工号</param>
|
||||
/// <param name="openId">openId</param>
|
||||
/// <param name="accountNum">公众号</param>
|
||||
/// <returns></returns>
|
||||
public JsonResult TransferEid(int fromEid, int toEid, string openId, string accountNum)
|
||||
{
|
||||
string erro = string.Empty;
|
||||
int result = 0;
|
||||
try
|
||||
{
|
||||
DataTable tab = MessageHandler.userinfo.TransferEid(fromEid, toEid, openId, accountNum);
|
||||
if (tab != null)
|
||||
{
|
||||
result = Convert.ToInt32(tab.Rows[0]["xresult"]);
|
||||
erro = tab.Rows[0]["message"].ToString();
|
||||
}
|
||||
if (result == 1)//转接数据修改成功,进行推送一条通知
|
||||
{
|
||||
AppletMsgModel appletMsg = new AppletMsgModel()
|
||||
{
|
||||
Content = "系统提示:[" + fromEid + "]将此客户转接给你!",
|
||||
CreateTime = DateTimeTool.ConvertDateTimeInt(DateTime.Now),
|
||||
FromUserName = openId,
|
||||
MsgId = 1,
|
||||
ToUserName = accountNum,
|
||||
MsgType = "txt"
|
||||
};
|
||||
bool issucced = MessageHandler.appletmsg.WeapAddMessage(appletMsg, toEid, 0, 0);//插入消息表
|
||||
ChatHub.SendAllMessage(toEid.ToString(), openId, appletMsg.Content, "txt", accountNum, 1);
|
||||
}
|
||||
//result = 1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
erro = ex.ToString();
|
||||
LogHelper.Error(ex.ToString());
|
||||
}
|
||||
return Json(new { result = result, msg = erro });
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
using Ninject;
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
using WX.CRM.Common;
|
||||
using WX.CRM.IBLL.Res;
|
||||
using WX.CRM.IBLL.weapp;
|
||||
using WX.CRM.WebHelper.Infrastructure;
|
||||
|
||||
namespace AppletMvcService.Controllers
|
||||
{
|
||||
public class WxUserInfoSvrController : Controller
|
||||
{
|
||||
|
||||
ValidationErrors errors = new ValidationErrors();
|
||||
|
||||
//[Inject]
|
||||
//private IWEAPP_USERINFO weapp_UserInfo_BL { get; set; }
|
||||
|
||||
//[Inject]
|
||||
//private IRES_CUSTOMER_Q res_Customer_Q_BL { get; set; }
|
||||
|
||||
//[Inject]
|
||||
//private IRES_CUSTOMER res_Customer_BL { get; set; }
|
||||
|
||||
private readonly IRES_CUSTOMER res_Customer_BL = NinjectControllerFactory.ninjectKernel.Get<IRES_CUSTOMER>();
|
||||
private readonly IRES_CUSTOMER_Q res_Customer_Q_BL = NinjectControllerFactory.ninjectKernel.Get<IRES_CUSTOMER_Q>();
|
||||
private readonly IWEAPP_USERINFO weapp_UserInfo_BL = NinjectControllerFactory.ninjectKernel.Get<IWEAPP_USERINFO>();
|
||||
public JsonResult BindResId(string resId, string openId, decimal resIdVerify)
|
||||
{
|
||||
try
|
||||
{
|
||||
var flag = false;
|
||||
if (string.IsNullOrWhiteSpace(resId) || string.IsNullOrWhiteSpace(openId))
|
||||
{
|
||||
errors.Add("参数不能为空!");
|
||||
return Json(new { result = flag, msg = errors.Error });
|
||||
}
|
||||
if (resId.Length != 18 && resId.Length != 11)
|
||||
{
|
||||
errors.Add("手机号格式不正确!");
|
||||
return Json(new { result = flag, msg = errors.Error });
|
||||
}
|
||||
if (resId.Length == 11 && !Utility.ChekMobile(resId))
|
||||
{
|
||||
errors.Add("手机号格式不正确!");
|
||||
return Json(new { result = flag, msg = errors.Error });
|
||||
}
|
||||
else
|
||||
{
|
||||
string resid = WX.CRM.Common.ResUtil.CreateResId(resId);
|
||||
if (res_Customer_Q_BL.getResCustomerByResId(resid) == null)
|
||||
{
|
||||
res_Customer_BL.ResgisterCustomer(resId, resid, "OpenIdBindResId");
|
||||
}
|
||||
|
||||
resId = resid;
|
||||
}
|
||||
int result = weapp_UserInfo_BL.BindResIdByOpenId(openId, resId, resIdVerify, ref errors);
|
||||
if (errors.Count == 0)
|
||||
flag = true;
|
||||
if (result == 0)
|
||||
{
|
||||
errors.Add("此客户已被验证绑定!不能再做修改。");
|
||||
}
|
||||
return Json(new { result = flag, resid = resId, msg = errors.Error });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
return Json(new { result = false, msg = "系统错误:" + ex.ToString() });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public JsonResult GetUserInfoOrderExtByOpenId(string openId)
|
||||
{
|
||||
var json = weapp_UserInfo_BL.GetUserInfoOrderExtByOpenId(openId);
|
||||
return Json(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
<%@ Application Codebehind="Global.asax.cs" Inherits="AppletMvcService.MvcApplication" Language="C#" %>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using WX.CRM.Model.Entity;
|
||||
|
||||
namespace AppletMvcService
|
||||
{
|
||||
public class MvcApplication : System.Web.HttpApplication
|
||||
{
|
||||
protected void Application_Start()
|
||||
{
|
||||
System.Data.Entity.Database.SetInitializer<crmContext>(null);
|
||||
AreaRegistration.RegisterAllAreas();
|
||||
//WebApiConfig.Register(GlobalConfiguration.Configuration);
|
||||
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||
//BundleConfig.RegisterBundles(BundleTable.Bundles);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,645 @@
|
|||
using AppletMvcService.Common;
|
||||
using AppletMvcService.Models;
|
||||
using Newtonsoft.Json;
|
||||
using Ninject;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using WX.CRM.Common;
|
||||
using WX.CRM.IBLL.weapp;
|
||||
using WX.CRM.Model.weapp;
|
||||
using WX.CRM.WebHelper.Infrastructure;
|
||||
namespace AppletMvcService.Hanlder
|
||||
{
|
||||
public class MessageHandler
|
||||
{
|
||||
public static IAppletMsg appletmsg = NinjectControllerFactory.ninjectKernel.Get<IAppletMsg>();
|
||||
public static IWX_UserInfo userinfo = NinjectControllerFactory.ninjectKernel.Get<IWX_UserInfo>();
|
||||
private static Dictionary<string, WxAccount> wxaccount = null;
|
||||
|
||||
public static Dictionary<string, WxAccount> GetWxAccount()
|
||||
{
|
||||
if (wxaccount != null && wxaccount.Count > 0)
|
||||
return wxaccount;
|
||||
wxaccount = new Dictionary<string, WxAccount>();
|
||||
DataTable tab = userinfo.GetWxAccount();
|
||||
if (tab != null && tab.Rows.Count > 0)
|
||||
{
|
||||
LogHelper.Error("wxaccount为空,需要进行初始化!");
|
||||
foreach (DataRow item in tab.Rows)
|
||||
{
|
||||
WxAccount account = new WxAccount();
|
||||
account.accountName = item["ACCOUNTNAME"].ToString();
|
||||
account.pkid = Convert.ToDecimal(item["PKID"]);
|
||||
account.accountNum = item["ACCOUNTNUM"].ToString();
|
||||
account.appId = item["APPID"].ToString();
|
||||
account.appSecret = item["APPSECRET"].ToString();
|
||||
account.fenPeiPoc = item["FENPEIPOC"].ToString();
|
||||
if (!wxaccount.ContainsKey(account.accountNum))
|
||||
wxaccount.Add(account.accountNum, account);
|
||||
account.tokenhttp = item["TOKENHTTP"].ToString();
|
||||
account.isonline = Convert.ToInt32(item["ISONLINE"]);
|
||||
}
|
||||
}
|
||||
return wxaccount;
|
||||
}
|
||||
#region 在线客服维护
|
||||
public static Dictionary<string, List<UserDetail>> GetConnectedByRedis()
|
||||
{
|
||||
Dictionary<string, List<UserDetail>> nn = new Dictionary<string, List<UserDetail>>();
|
||||
try
|
||||
{
|
||||
LogHelper.Error("客服数据获取");
|
||||
//Dictionary<string, WxAccount> naccount = GetWxAccount();
|
||||
DataTable tab = userinfo.GetOnlineUser();
|
||||
if (tab != null && tab.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow item in tab.Rows)
|
||||
{
|
||||
UserDetail detial = new UserDetail();
|
||||
detial.ConnectionId = item["connectionid"].ToString();
|
||||
detial.DeptName = item["deptname"].ToString();
|
||||
detial.LoginTime = Convert.ToDateTime(item["logintime"]);
|
||||
detial.UserID = item["userid"].ToString();
|
||||
detial.UserName = item["username"].ToString();
|
||||
string accountnum = item["accountnum"].ToString();
|
||||
if (!nn.ContainsKey(accountnum))
|
||||
nn.Add(accountnum, new List<UserDetail>());
|
||||
nn[accountnum].Add(detial);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception x)
|
||||
{
|
||||
LogHelper.Error(x.ToString());
|
||||
}
|
||||
return nn;
|
||||
}
|
||||
public static void AddConnectedToRedis(UserDetail connected, string accountnum)
|
||||
{
|
||||
try
|
||||
{
|
||||
userinfo.Logon(connected.ConnectionId, connected.UserID, connected.UserName, connected.DeptName, connected.LoginTime, accountnum);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveConnectedToRedis(UserDetail connected, string accountnum)
|
||||
{
|
||||
try
|
||||
{
|
||||
userinfo.UnLogon(connected.UserID, accountnum);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
public static void UpdateSendTime(string v_openid, DateTime v_ctime, string v_AccountNum, decimal eid)
|
||||
{
|
||||
userinfo.UpdateSendTime(v_openid, v_ctime, v_AccountNum, eid);
|
||||
}
|
||||
public static CustoemrDetail GetCustomerHeadInfo(CustoemrDetail info)
|
||||
{
|
||||
DataTable table = userinfo.GetUserHeadInfo(info.OpenId);
|
||||
if (table != null && table.Rows.Count > 0)
|
||||
{
|
||||
info.NickName = table.Rows[0]["nickname"].ToString();
|
||||
info.HeaderUrl = table.Rows[0]["avatarurl"].ToString();
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
public static void weapp_update_subscribe(string v_openid, string v_subType, DateTime v_time, string v_AccountNum)
|
||||
{
|
||||
userinfo.weapp_update_subscribe(v_openid, v_subType, v_time, v_AccountNum);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分配信息
|
||||
/// </summary>
|
||||
/// <param name="openId"></param>
|
||||
/// <param name="onlineUser">在线人员</param>
|
||||
/// <param name="accountnum">公众号</param>
|
||||
/// <returns></returns>
|
||||
public static string GetFenPeiEID(int type, string openId, string onlineUser, string accountnum, string fenpei, ref int isNew)
|
||||
{
|
||||
//LogHelper.Error("1");
|
||||
if (string.IsNullOrEmpty(fenpei))
|
||||
return "1";
|
||||
//LogHelper.Error("2");
|
||||
DataTable table = userinfo.GetFenPeiCustomerService(type, openId, onlineUser, accountnum, fenpei);
|
||||
//LogHelper.Error("3");
|
||||
string eid = "1";
|
||||
isNew = 0;
|
||||
if (table != null && table.Rows.Count > 0)
|
||||
{
|
||||
eid = table.Rows[0]["eid"].ToString();
|
||||
isNew = Convert.ToInt32(table.Rows[0]["isNew"]);
|
||||
}
|
||||
//LogHelper.Error("4");
|
||||
//LogHelper.Error("eid:" + eid + ",isNew:" + isNew + ",ChatHub.ConnectedUsers:" + (ChatHub.ConnectedUsers == null));
|
||||
//if (ChatHub.ConnectedUsers == null)
|
||||
//{
|
||||
// LogHelper.Error("ChatHub.ConnectedUsers被销毁" + eid);
|
||||
// return "1";
|
||||
//}
|
||||
//LogHelper.Error("ChatHub.ConnectedUsers.Count:" + ChatHub.ConnectedUsers.Count);
|
||||
//if (ChatHub.ConnectedUsers[accountnum].Count == 0)//没有售后客服在线
|
||||
//{
|
||||
// eid = "1";//系统工号
|
||||
//}
|
||||
//else if (!string.IsNullOrEmpty(eid) && ChatHub.ConnectedUsers[accountnum].Count > 0)//检测目标售后是否在线
|
||||
//{
|
||||
// LogHelper.Error("count:" + ChatHub.ConnectedUsers[accountnum].Count);
|
||||
|
||||
// UserDetail detail = ChatHub.ConnectedUsers[accountnum].FirstOrDefault(m => m.UserID == eid);
|
||||
// if (detail == null)
|
||||
// {
|
||||
// Random rd = new Random();
|
||||
// eid = ChatHub.ConnectedUsers[accountnum][rd.Next(ChatHub.ConnectedUsers.Count)].UserID;
|
||||
// }
|
||||
//}
|
||||
return eid;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取好友列表
|
||||
/// </summary>
|
||||
/// <param name="eid"></param>
|
||||
/// <param name="accountnum"></param>
|
||||
/// <returns></returns>
|
||||
public static List<CustoemrDetail> GetFriends(decimal eid, string accountnum)
|
||||
{
|
||||
List<CustoemrDetail> friends = new List<CustoemrDetail>();
|
||||
DataTable table = userinfo.GetFriends(eid, accountnum);
|
||||
if (table == null || table.Rows.Count == 0)
|
||||
return friends;
|
||||
CustoemrDetail fd = null;
|
||||
foreach (DataRow item in table.Rows)
|
||||
{
|
||||
fd = new CustoemrDetail();
|
||||
fd.ConnectionId = item["openid"].ToString();
|
||||
fd.HeaderUrl = item["avatarurl"].ToString();
|
||||
fd.LoginTime = DateTime.Now;
|
||||
fd.NickName = item["nickname"].ToString();
|
||||
fd.OpenId = item["openid"].ToString();
|
||||
fd.Remarks = item["remarks"].ToString();
|
||||
if (item["subscribe"] == DBNull.Value)
|
||||
fd.subscribe = 0;
|
||||
else
|
||||
fd.subscribe = Convert.ToInt32(item["subscribe"]);
|
||||
if (item["ChatTime"] == DBNull.Value)
|
||||
fd.ChatTime = new DateTime(2017, 1, 1);
|
||||
else
|
||||
fd.ChatTime = Convert.ToDateTime(item["ChatTime"]);
|
||||
|
||||
fd.Hours = Convert.ToInt32(item["hours"]);
|
||||
if (string.IsNullOrEmpty(fd.HeaderUrl))
|
||||
fd.HeaderUrl = "/Content/Images/defaulthead.jpg";
|
||||
fd.resid = string.Format("{0}", item["resid"]);
|
||||
friends.Add(fd);
|
||||
}
|
||||
return friends;
|
||||
|
||||
}
|
||||
public static void SendNoLineMsg(string toUserId, string accountnum)
|
||||
{
|
||||
string message = "无客服在线!请在上班9:00~11:30 13:00~18:00进行咨询";
|
||||
SendMsg(toUserId, message, 1, accountnum);
|
||||
}
|
||||
private static string GetToken(string accountnum, bool GetNew = false)
|
||||
{
|
||||
|
||||
string url = GetWxAccount()[accountnum].tokenhttp + accountnum + (GetNew == true ? "&isForce=true" : "");
|
||||
string result = RequestHelper.CreateGetString(url, null, "", null);
|
||||
AccessToken imgmsg = JsonConvert.DeserializeObject<AccessToken>(result);
|
||||
return imgmsg.access_token;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送消息
|
||||
/// </summary>
|
||||
/// <param name="toUserId"></param>
|
||||
/// <param name="message"></param>
|
||||
public static void SendMsg(string toUserId, string message, int eid, string accountnum)
|
||||
{
|
||||
string token = GetToken(accountnum);
|
||||
SendMsg msg = new SendMsg();
|
||||
string resultJson = string.Empty;
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
string url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" + token;
|
||||
//LogHelper.Info(string.Format("userid:{0},token:{1}", toUserId, token));
|
||||
msg.touser = toUserId.Replace("userid-", "");
|
||||
msg.text = new MsgContent() { content = message };
|
||||
msg.msgtype = "text";
|
||||
resultJson = RequestHelper.CreatePostGetString(url, JsonConvert.SerializeObject(msg), null, "", Encoding.UTF8, null);
|
||||
//LogHelper.Info("返回值:" + resultJson);
|
||||
if (resultJson.IndexOf("\"errcode\":40001") > -1)
|
||||
token = GetToken(accountnum, true);
|
||||
else
|
||||
break;
|
||||
}
|
||||
ResultModel rest = JsonConvert.DeserializeObject<ResultModel>(resultJson);
|
||||
if (rest.errmsg != "ok")//发送失败
|
||||
{
|
||||
LogHelper.Error("发送文本错误:" + resultJson);
|
||||
}
|
||||
else
|
||||
{
|
||||
AppletMsgModel appletMsg = new AppletMsgModel();
|
||||
appletMsg.Content = message;
|
||||
DateTime time1 = System.DateTime.Now;
|
||||
appletMsg.CreateTime = DateTimeTool.ConvertDateTimeInt(time1);
|
||||
appletMsg.MsgId = 0;
|
||||
appletMsg.MsgType = "text";
|
||||
appletMsg.ToUserName = msg.touser;
|
||||
appletMsg.FromUserName = accountnum;
|
||||
appletmsg.WeapAddMessage(appletMsg, eid, 1, 1);
|
||||
UpdateSendTime(msg.touser, time1, accountnum, eid);
|
||||
}
|
||||
}
|
||||
public static string GetSuCaiUrl(string mediaId, string accountnum, ref string erroMsg)
|
||||
{
|
||||
string token = GetToken(accountnum);
|
||||
string resultJson = string.Empty;
|
||||
HttpWebResponse response = null;
|
||||
Stream stream = null;
|
||||
StreamReader sr = null;
|
||||
string filePath = string.Empty;
|
||||
byte[] mbyte = null;
|
||||
int startmbyte = 0;
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
string url = "https://api.weixin.qq.com/cgi-bin/media/get?access_token=" + token + "&media_id=" + mediaId;
|
||||
WebClient client = new WebClient();
|
||||
stream = client.OpenRead(url);
|
||||
sr = new StreamReader(stream);
|
||||
mbyte = new byte[1000000];
|
||||
int allmybyte = (int)mbyte.Length;
|
||||
while (allmybyte > 0)
|
||||
{
|
||||
|
||||
int m = stream.Read(mbyte, startmbyte, allmybyte);
|
||||
if (m == 0)
|
||||
break;
|
||||
|
||||
startmbyte += m;
|
||||
allmybyte -= m;
|
||||
}
|
||||
resultJson = sr.ReadToEnd();
|
||||
|
||||
if (resultJson.IndexOf("\"errcode\":40001") > -1)
|
||||
token = GetToken(accountnum, true);
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (resultJson.IndexOf("errcode") > -1)//发送失败
|
||||
{
|
||||
LogHelper.Error("素材获取失败:" + resultJson);
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#region 下载文件
|
||||
// 把 byte[] 写入文件
|
||||
|
||||
var yearMonth = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
|
||||
string fileNameWithoutExt = yearMonth + "/" + mediaId;
|
||||
string vpath = ConfigurationManager.AppSettings["weappfile"] + fileNameWithoutExt + ".amr";
|
||||
|
||||
FileStream fstr = new FileStream(vpath, FileMode.OpenOrCreate, FileAccess.Write);
|
||||
fstr.Write(mbyte, 0, startmbyte);
|
||||
fstr.Flush();
|
||||
fstr.Close();
|
||||
|
||||
#endregion
|
||||
|
||||
#region 文件转换成MP3
|
||||
var webPath = FileUnit.GetBaseDirectory();
|
||||
var exePath = webPath + "silk2mp3";
|
||||
//var fileNameWithoutExt = Path.GetFileNameWithoutExtension(vpath);
|
||||
var basePath = Utility.GetSettingByKey("weappfile");
|
||||
var path = basePath + "audio/" + yearMonth;
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
if (!System.IO.File.Exists(vpath))
|
||||
{
|
||||
erroMsg = "未能找到文件!";
|
||||
}
|
||||
|
||||
var targetFileNameMp3 = Path.Combine(path, mediaId + ".mp3");
|
||||
if (!System.IO.File.Exists(targetFileNameMp3))
|
||||
{
|
||||
SilkConvertToMp3 amr = new SilkConvertToMp3();
|
||||
amr.ConvertToMp3(exePath, vpath, targetFileNameMp3);
|
||||
}
|
||||
#endregion
|
||||
|
||||
filePath = "/audio/" + yearMonth + "/" + mediaId + ".mp3";
|
||||
}
|
||||
}
|
||||
catch (Exception ex) { LogHelper.Error(ex.ToString()); }
|
||||
finally
|
||||
{
|
||||
if (sr != null) { sr.Close(); }
|
||||
if (stream != null) { stream.Close(); }
|
||||
if (response != null) { response.Close(); }
|
||||
}
|
||||
return filePath;
|
||||
}
|
||||
/// <summary>
|
||||
/// 新增一个图片文件
|
||||
/// </summary>
|
||||
public static ImageMsg SendImg(string type, string accountnum, string filename, string nfile)
|
||||
{
|
||||
string token = GetToken(accountnum);
|
||||
string resultJson = string.Empty;
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
string url = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token=" + token + "&type=" + type;
|
||||
resultJson = HttpUploadFile(url, filename);
|
||||
if (resultJson.IndexOf("\"errcode\":40001") > -1)
|
||||
token = GetToken(accountnum, true);
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (resultJson.IndexOf("errcode") > -1)//发送失败
|
||||
{
|
||||
LogHelper.Error("新增素材失败:" + resultJson);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImageMsg imgmsg = JsonConvert.DeserializeObject<ImageMsg>(resultJson);
|
||||
MessageHandler.appletmsg.WeapAddFilePath(0, imgmsg.media_id, nfile);
|
||||
return imgmsg;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发送图片素材
|
||||
/// </summary>
|
||||
/// <param name="imgmsg"></param>
|
||||
/// <param name="toUser"></param>
|
||||
/// <param name="accountnum"></param>
|
||||
public static void SendImgMsg(ImageMsg imgmsg, string sucaitype, string toUser, string accountnum, int eid, string name, ref string content)
|
||||
{
|
||||
if (imgmsg == null)
|
||||
return;
|
||||
string token = GetToken(accountnum);
|
||||
string resultJson = string.Empty;
|
||||
content = string.Empty;
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
string url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" + token;
|
||||
var ojb = new object();
|
||||
if (sucaitype == "image")
|
||||
{
|
||||
|
||||
ojb = new { touser = toUser, msgtype = sucaitype, image = new { media_id = imgmsg.media_id } };
|
||||
content = "图片素材【" + (string.IsNullOrEmpty(name) ? "本地图片" : name) + "】";
|
||||
}
|
||||
else if (sucaitype == "voice")
|
||||
{
|
||||
ojb = new { touser = toUser, msgtype = sucaitype, voice = new { media_id = imgmsg.media_id } };
|
||||
content = "语音素材【" + name + "】";
|
||||
}
|
||||
else if (sucaitype == "video")
|
||||
{
|
||||
ojb = new { touser = toUser, msgtype = sucaitype, video = new { media_id = imgmsg.media_id } };
|
||||
content = "视频素材【" + name + "】";
|
||||
}
|
||||
else if (sucaitype == "mpnews")
|
||||
{
|
||||
ojb = new { touser = toUser, msgtype = "mpnews", mpnews = new { media_id = imgmsg.media_id } };
|
||||
content = "图文素材【" + name + "】";
|
||||
}
|
||||
resultJson = RequestHelper.CreatePostGetString(url, JsonConvert.SerializeObject(ojb), null, "", Encoding.UTF8, null);
|
||||
if (resultJson.IndexOf("\"errcode\":40001") > -1)
|
||||
token = GetToken(accountnum, true);
|
||||
else
|
||||
break;
|
||||
}
|
||||
ResultModel rest = JsonConvert.DeserializeObject<ResultModel>(resultJson);
|
||||
if (rest.errmsg != "ok")//发送失败
|
||||
{
|
||||
LogHelper.Error("发送" + content + "素材错误:" + resultJson);
|
||||
}
|
||||
else
|
||||
{
|
||||
AppletMsgModel appletMsg = new AppletMsgModel();
|
||||
appletMsg.CreateTime = DateTimeTool.ConvertDateTimeInt(System.DateTime.Now);
|
||||
appletMsg.MsgId = 0;
|
||||
appletMsg.MsgType = sucaitype;
|
||||
appletMsg.ToUserName = toUser;
|
||||
appletMsg.FromUserName = accountnum;
|
||||
appletMsg.MediaId = imgmsg.media_id;
|
||||
appletMsg.Content = content;
|
||||
appletmsg.WeapAddMessage(appletMsg, eid, 1, 1);
|
||||
}
|
||||
}
|
||||
public static DataTable IsNeedDownLoadSuCai(string media_id)
|
||||
{
|
||||
return appletmsg.IsHasMediaId(media_id);
|
||||
}
|
||||
/// <summary>
|
||||
/// 下载文件素材
|
||||
/// </summary>
|
||||
/// <param name="URLAddress"></param>
|
||||
/// <returns></returns>
|
||||
public static string DownLoadSuCaiPath(string media_id, string URLAddress)
|
||||
{
|
||||
string filepath = string.Empty;
|
||||
try
|
||||
{
|
||||
string fix = ".jpg";
|
||||
LogHelper.Error("fix:" + fix);
|
||||
WebClient client = new WebClient();
|
||||
Stream str = client.OpenRead(URLAddress);
|
||||
StreamReader reader = new StreamReader(str);
|
||||
byte[] mbyte = new byte[1000000];
|
||||
int allmybyte = (int)mbyte.Length;
|
||||
int startmbyte = 0;
|
||||
|
||||
while (allmybyte > 0)
|
||||
{
|
||||
|
||||
int m = str.Read(mbyte, startmbyte, allmybyte);
|
||||
if (m == 0)
|
||||
break;
|
||||
|
||||
startmbyte += m;
|
||||
allmybyte -= m;
|
||||
}
|
||||
|
||||
reader.Dispose();
|
||||
str.Dispose();
|
||||
var yearMonth = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
|
||||
string uploadFolder = (ConfigurationManager.AppSettings["weappfile"] ?? "weappfile") + "/" + yearMonth;
|
||||
if (!Directory.Exists(uploadFolder))
|
||||
{
|
||||
Directory.CreateDirectory(uploadFolder);
|
||||
}
|
||||
string imgname = "G" + DateTime.Now.ToString("yyyyMMddHHmmssffff") + fix;
|
||||
string path = Path.Combine(uploadFolder, imgname);
|
||||
filepath = "/" + yearMonth + "/" + imgname;
|
||||
FileStream fstr = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
|
||||
fstr.Write(mbyte, 0, startmbyte);
|
||||
fstr.Flush();
|
||||
fstr.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error("download erro:" + ex.ToString());
|
||||
filepath = "";
|
||||
}
|
||||
return filepath;
|
||||
|
||||
}
|
||||
|
||||
public static string HttpUploadFile(string url, string path)//这个方法是两个URL第一个url是条到微信的,第二个是本地图片路径
|
||||
{
|
||||
// 设置参数
|
||||
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
|
||||
CookieContainer cookieContainer = new CookieContainer();
|
||||
request.CookieContainer = cookieContainer;
|
||||
request.AllowAutoRedirect = true;
|
||||
request.Method = "POST";
|
||||
string boundary = DateTime.Now.Ticks.ToString("X"); // 随机分隔线
|
||||
request.ContentType = "multipart/form-data;charset=utf-8;boundary=" + boundary;
|
||||
byte[] itemBoundaryBytes = Encoding.UTF8.GetBytes("\r\n--" + boundary + "\r\n");
|
||||
byte[] endBoundaryBytes = Encoding.UTF8.GetBytes("\r\n--" + boundary + "--\r\n");
|
||||
|
||||
int pos = path.LastIndexOf("\\");
|
||||
string fileName = path.Substring(pos + 1);
|
||||
|
||||
//请求头部信息
|
||||
StringBuilder sbHeader = new StringBuilder(string.Format("Content-Disposition:form-data;name=\"file\";filename=\"{0}\"\r\nContent-Type:application/octet-stream\r\n\r\n", fileName));
|
||||
byte[] postHeaderBytes = Encoding.UTF8.GetBytes(sbHeader.ToString());
|
||||
|
||||
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
|
||||
byte[] bArr = new byte[fs.Length];
|
||||
fs.Read(bArr, 0, bArr.Length);
|
||||
fs.Close();
|
||||
|
||||
Stream postStream = request.GetRequestStream();
|
||||
postStream.Write(itemBoundaryBytes, 0, itemBoundaryBytes.Length);
|
||||
postStream.Write(postHeaderBytes, 0, postHeaderBytes.Length);
|
||||
postStream.Write(bArr, 0, bArr.Length);
|
||||
postStream.Write(endBoundaryBytes, 0, endBoundaryBytes.Length);
|
||||
postStream.Close();
|
||||
|
||||
//发送请求并获取相应回应数据
|
||||
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
|
||||
//直到request.GetResponse()程序才开始向目标网页发送Post请求
|
||||
Stream instream = response.GetResponseStream();
|
||||
StreamReader sr = new StreamReader(instream, Encoding.UTF8);
|
||||
//返回结果网页(html)代码
|
||||
string content = sr.ReadToEnd();
|
||||
return content;
|
||||
}
|
||||
|
||||
#region 获取素材
|
||||
|
||||
public static object GetSucaiModel(string type, int count, int offset, string accountnum)
|
||||
{
|
||||
string token = GetToken(accountnum);
|
||||
string resultJson = string.Empty;
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
string url = "https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=" + token;
|
||||
SuCaiSendModel model = new SuCaiSendModel();
|
||||
model.count = count;
|
||||
model.offset = offset;
|
||||
model.type = type;
|
||||
resultJson = RequestHelper.CreatePostGetString(url, JsonConvert.SerializeObject(model), null, "", Encoding.UTF8, null);
|
||||
if (resultJson.IndexOf("\"errcode\":40001") > -1)
|
||||
token = GetToken(accountnum, true);
|
||||
else
|
||||
break;
|
||||
|
||||
}
|
||||
if (resultJson.IndexOf("errcode") > -1)
|
||||
{
|
||||
//ResultModel result = JsonConvert.DeserializeObject<ResultModel>(resultJson);
|
||||
return new { result = false, msg = resultJson };
|
||||
}
|
||||
if (type == "news")
|
||||
{
|
||||
//LogHelper.Info(resultJson);
|
||||
//NewsModel newsmodel = JsonConvert.DeserializeObject<NewsModel>(resultJson);
|
||||
//newsmodel.result = true;
|
||||
//return newsmodel;
|
||||
NewsModel2 newmodel = new NewsModel2();
|
||||
newmodel.result = true;
|
||||
newmodel.dataResult = resultJson;
|
||||
return newmodel;
|
||||
}
|
||||
else
|
||||
{
|
||||
SuCaiModel newsmodel = JsonConvert.DeserializeObject<SuCaiModel>(resultJson);
|
||||
newsmodel.result = true;
|
||||
return newsmodel;
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class SilkConvertToMp3
|
||||
{
|
||||
public void ConvertToPcm(string applicationPath, string fileName, string targetFileName)
|
||||
{
|
||||
string para = applicationPath + @"\silk_v3_decoder.exe " + fileName + " " + targetFileName + "&exit";
|
||||
Cmd(para);
|
||||
}
|
||||
public void ConvertToMp3(string applicationPath, string fileName, string targetFilName)
|
||||
{
|
||||
string c = applicationPath + @"\ffmpeg.exe -i " + fileName + " " + targetFilName + "&exit"; ;
|
||||
Cmd(c);
|
||||
}
|
||||
private void Cmd(string c)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process process = new System.Diagnostics.Process();
|
||||
process.StartInfo.FileName = "cmd.exe";
|
||||
process.StartInfo.UseShellExecute = false;
|
||||
process.StartInfo.CreateNoWindow = true;
|
||||
process.StartInfo.RedirectStandardOutput = true;
|
||||
process.StartInfo.RedirectStandardInput = true;
|
||||
process.Start();
|
||||
|
||||
process.StandardInput.WriteLine(c);
|
||||
process.StandardInput.AutoFlush = true;
|
||||
//process.StandardInput.WriteLine("exit");
|
||||
|
||||
var reader = process.StandardOutput.ReadToEnd(); //截取输出流
|
||||
|
||||
process.WaitForExit();
|
||||
process.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error("转换录音文件失败:" + ex.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE html>
|
||||
<meta http-equiv="Access-Control-Allow-Origin" content="http://192.168.1.132">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>SignalR Simple Chat</title>
|
||||
<style type="text/css">
|
||||
.container {
|
||||
background-color: #99CCFF;
|
||||
border: thick solid #808080;
|
||||
padding: 20px;
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<input type="text" id="message" />
|
||||
<input type="button" id="sendmessage" value="Send" />
|
||||
<input type="hidden" id="displayname" />
|
||||
<ul id="discussion"></ul>
|
||||
</div>
|
||||
<!--Script references. -->
|
||||
<!--Reference the jQuery library. -->
|
||||
<script src="Scripts/jquery-1.6.4.min.js"></script>
|
||||
<!--Reference the SignalR library. -->
|
||||
<script src="Scripts/jquery.signalR-2.2.2.min.js"></script>
|
||||
<!--Reference the autogenerated SignalR hub script. -->
|
||||
<script src="signalr/hubs"></script>
|
||||
<!--Add script to update the page and send messages.-->
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
//To enable logging for your hub's events in a browser, add the following command to your client application
|
||||
$.connection.hub.logging = true;
|
||||
// Declare a proxy to reference the hub.
|
||||
var chat = $.connection.chatHub;
|
||||
|
||||
// Create a function that the hub can call to broadcast messages.
|
||||
chat.client.broadcastMessage = function (name, message) {
|
||||
// Html encode display name and message.
|
||||
var encodedName = $('<div />').text(name).html();
|
||||
var encodedMsg = $('<div />').text(message).html();
|
||||
// Add the message to the page.
|
||||
$('#discussion').append('<li><strong>' + encodedName + '</strong>: ' + encodedMsg + '</li>');
|
||||
};
|
||||
// Get the user name and store it to prepend to messages.
|
||||
$('#displayname').val(prompt('Enter your name:', ''));
|
||||
// Set initial focus to message input box.
|
||||
$('#message').focus();
|
||||
// Start the connection.
|
||||
$.connection.hub.start().done(function () {
|
||||
$('#sendmessage').click(function () {
|
||||
// Call the Send method on the hub.
|
||||
chat.server.send($('#displayname').val(), $('#message').val());
|
||||
// Clear text box and reset focus for next comment.
|
||||
$('#message').val('').focus();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
|
||||
namespace AppletMvcService.Models
|
||||
{
|
||||
public class AccessToken
|
||||
{
|
||||
public string account_num { get; set; }
|
||||
|
||||
public string appid { get; set; }
|
||||
|
||||
public string secret { get; set; }
|
||||
|
||||
public string access_token { get; set; }
|
||||
|
||||
public int expires_in { get; set; }
|
||||
|
||||
public DateTime get_time { get; set; }
|
||||
|
||||
public DateTime expire_time { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
|
||||
namespace AppletMvcService.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户列表
|
||||
/// </summary>
|
||||
public class CustoemrDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// 连接ID
|
||||
/// </summary>
|
||||
public string ConnectionId { get; set; }
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
public string OpenId { get; set; }
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
public string NickName { get; set; }
|
||||
/// <summary>
|
||||
/// 用户部门
|
||||
/// </summary>
|
||||
public string HeaderUrl { get; set; }
|
||||
public string Remarks { get; set; }
|
||||
/// <summary>
|
||||
/// 登录时间
|
||||
/// </summary>
|
||||
public DateTime LoginTime { get; set; }
|
||||
/// <summary>
|
||||
/// 客户最后回复时间
|
||||
/// </summary>
|
||||
public DateTime ChatTime { get; set; }
|
||||
/// <summary>
|
||||
/// 相差小时
|
||||
/// </summary>
|
||||
public int Hours { get; set; }
|
||||
/// <summary>
|
||||
/// 关注状态
|
||||
/// </summary>
|
||||
public int subscribe { get; set; }
|
||||
/// <summary>
|
||||
/// 资源ID
|
||||
/// </summary>
|
||||
public string resid { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
namespace AppletMvcService.Models
|
||||
{
|
||||
public class ImageMsg
|
||||
{
|
||||
public string type { get; set; }
|
||||
public string media_id { get; set; }
|
||||
public string created_at { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
namespace AppletMvcService.Models
|
||||
{
|
||||
public class ResultModel
|
||||
{
|
||||
public int errcode { get; set; }
|
||||
public string errmsg { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
namespace AppletMvcService.Models
|
||||
{
|
||||
public class SendMsg
|
||||
{
|
||||
public string touser { get; set; }
|
||||
public string msgtype { get; set; }
|
||||
public MsgContent text { get; set; }
|
||||
}
|
||||
public class MsgContent
|
||||
{
|
||||
public string content { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace AppletMvcService.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 素材模型
|
||||
/// </summary>
|
||||
public class SuCaiModel
|
||||
{
|
||||
public int total_count { get; set; }
|
||||
public int item_count { get; set; }
|
||||
public List<SuCaiWJ> item { get; set; }
|
||||
public bool result { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 素材文件
|
||||
/// </summary>
|
||||
public class SuCaiWJ
|
||||
{
|
||||
public string media_id { get; set; }
|
||||
public string name { get; set; }
|
||||
public long update_time { get; set; }
|
||||
public string url { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 图文素材
|
||||
/// </summary>
|
||||
public class NewsModel
|
||||
{
|
||||
public int total_count { get; set; }
|
||||
public int item_count { get; set; }
|
||||
public List<NewItem> item { get; set; }
|
||||
public bool result { get; set; }
|
||||
}
|
||||
public class NewsModel2
|
||||
{
|
||||
public bool result { get; set; }
|
||||
public string dataResult { get; set; }
|
||||
}
|
||||
public class NewItem
|
||||
{
|
||||
public string media_id { get; set; }
|
||||
public List<newContent> content { get; set; }
|
||||
public long update_time { get; set; }
|
||||
}
|
||||
public class newContent
|
||||
{
|
||||
public List<news_item> news_item { get; set; }
|
||||
public long create_time { get; set; }
|
||||
public long update_time { get; set; }
|
||||
}
|
||||
|
||||
public class news_item
|
||||
{
|
||||
public string title { get; set; }
|
||||
public string thumb_media_id { get; set; }
|
||||
public int show_cover_pic { get; set; }
|
||||
public string author { get; set; }
|
||||
public string digest { get; set; }
|
||||
//public string content { get; set; }
|
||||
public string url { get; set; }
|
||||
public string content_source_url { get; set; }
|
||||
}
|
||||
public class ContentItem
|
||||
{
|
||||
public string title { get; set; }
|
||||
public string thumb_media_id { get; set; }
|
||||
public int show_cover_pic { get; set; }
|
||||
public string author { get; set; }
|
||||
public string digest { get; set; }
|
||||
public string content { get; set; }
|
||||
public string url { get; set; }
|
||||
public string content_source_url { get; set; }
|
||||
}
|
||||
public class SuCaiSendModel
|
||||
{
|
||||
public string type { get; set; }
|
||||
public int offset { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
namespace AppletMvcService.Models
|
||||
{
|
||||
public class UnReadMsgModel
|
||||
{
|
||||
public long id { get; set; }
|
||||
public string openId { get; set; }
|
||||
public long createtime { get; set; }
|
||||
public string msgtype { get; set; }
|
||||
|
||||
public string content { get; set; }
|
||||
|
||||
public int eid { get; set; }
|
||||
|
||||
public int issend { get; set; }
|
||||
public string filepath { get; set; }
|
||||
public string mediaid { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace AppletMvcService.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服人员
|
||||
/// </summary>
|
||||
public class UserDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// 连接ID
|
||||
/// </summary>
|
||||
public string ConnectionId { get; set; }
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
public string UserID { get; set; }
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
/// <summary>
|
||||
/// 用户部门
|
||||
/// </summary>
|
||||
public string DeptName { get; set; }
|
||||
/// <summary>
|
||||
/// 登录时间
|
||||
/// </summary>
|
||||
public DateTime LoginTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
namespace AppletMvcService.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信公众号
|
||||
/// </summary>
|
||||
public class WxAccount
|
||||
{
|
||||
public decimal pkid { get; set; }
|
||||
public string accountName { get; set; }
|
||||
public string accountNum { get; set; }
|
||||
public string appId { get; set; }
|
||||
public string appSecret { get; set; }
|
||||
public string fenPeiPoc { get; set; }
|
||||
public string tokenhttp { get; set; }
|
||||
/// <summary>
|
||||
/// 是否已经上线
|
||||
/// </summary>
|
||||
public int isonline { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
namespace AppletMvcService.Models
|
||||
{
|
||||
public class web_push_wxUserServiceModel
|
||||
{
|
||||
|
||||
public string OpenId { get; set; }
|
||||
public string NickName { get; set; }
|
||||
public int Gender { get; set; }
|
||||
public string City { get; set; }
|
||||
public string Province { get; set; }
|
||||
public string Country { get; set; }
|
||||
|
||||
public string Language { get; set; }
|
||||
public string AvatarUrl { get; set; }
|
||||
public string UnionId { get; set; }
|
||||
public int Type { get; set; }
|
||||
public string AccountNum { get; set; }
|
||||
public long SubscribeTime { get; set; }
|
||||
public int Subscribe { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过下列特性集
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("AppletMvcService")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("AppletMvcService")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
// 对 COM 组件不可见。如果需要
|
||||
// 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
|
||||
[assembly: Guid("224f0c3b-9465-43ba-85f1-8a2901aa8de5")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 内部版本号
|
||||
// 修订版本
|
||||
//
|
||||
// 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
|
||||
// 方法是按如下所示使用 "*":
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,39 @@
|
|||
using Microsoft.Owin;
|
||||
using Owin;
|
||||
|
||||
[assembly: OwinStartup(typeof(AppletMvcService.Startup))]
|
||||
|
||||
namespace AppletMvcService
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configuration(IAppBuilder app)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
//app.UseCors(CorsOptions.AllowAll);//跨域访问
|
||||
app.MapSignalR();
|
||||
//app.Map("/signalr", map =>
|
||||
//{
|
||||
// map.UseCors(CorsOptions.AllowAll);
|
||||
// var hubConfiguration = new HubConfiguration
|
||||
// {
|
||||
// EnableJSONP = true
|
||||
// };
|
||||
// map.RunSignalR(hubConfiguration);
|
||||
//});
|
||||
// 有关如何配置应用程序的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkID=316888
|
||||
//app.Map("/signalr", map =>
|
||||
//{
|
||||
// map.UseCors(CorsOptions.AllowAll);
|
||||
// var hubConfiguration = new HubConfiguration
|
||||
// {
|
||||
// EnableJSONP = true
|
||||
// };
|
||||
// map.RunSignalR(hubConfiguration);
|
||||
//});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
<add namespace="System.Web.Mvc.Ajax" />
|
||||
<add namespace="System.Web.Mvc.Html" />
|
||||
<add namespace="System.Web.Routing" />
|
||||
<add namespace="AppletMvcService" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- 有关使用 web.config 转换的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
在下例中,“SetAttributes”转换将更改
|
||||
“connectionString”的值,以仅在“Match”定位器
|
||||
找到值为“MyDB”的特性“name”时使用“ReleaseSQLServer”。
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<!--
|
||||
|
||||
在下例中,“Replace”转换将替换
|
||||
web.config 文件的整个 <customErrors> 节。
|
||||
请注意,由于
|
||||
在 <system.web> 节点下仅有一个 customErrors 节,因此不需要使用“xdt:Locator”特性。
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- 有关使用 web.config 转换的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
在下例中,“SetAttributes”转换将更改
|
||||
“connectionString”的值,以仅在“Match”定位器
|
||||
找到值为“MyDB”的特性“name”时使用“ReleaseSQLServer”。
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||
<!--
|
||||
|
||||
在下例中,“Replace”转换将替换
|
||||
web.config 文件的整个 <customErrors> 节。
|
||||
请注意,由于
|
||||
在 <system.web> 节点下仅有一个 customErrors 节,因此不需要使用“xdt:Locator”特性。
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
有关如何配置 ASP.NET 应用程序的详细信息,请访问
|
||||
http://go.microsoft.com/fwlink/?LinkId=301880
|
||||
-->
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="Oracle.ManagedDataAccess.Client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
<section name="redis" type="WX.CRM.DAL.Redis.RedisConfigurationSection, DAL, Version=1.0.0.0, Culture=neutral" />
|
||||
</configSections>
|
||||
<appSettings>
|
||||
<add key="webpages:Version" value="3.0.0.0" />
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
<add key="ClientValidationEnabled" value="true" />
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||
<add key="weappfile" value="D:\web\WXFILE\weappfile\" />
|
||||
<!--是否为测试服务器站点-->
|
||||
<add key="weappIsTest" value="false" />
|
||||
<add key="weappTestService" value="http://192.168.1.132:7099" />
|
||||
<!--CRM号码加密key(clientKey)-->
|
||||
<add key="CRMClientKey" value="gd_crm" />
|
||||
</appSettings>
|
||||
<!--
|
||||
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
|
||||
|
||||
可在 <httpRuntime> 标记上设置以下特性。
|
||||
<system.Web>
|
||||
<httpRuntime targetFramework="4.5.2" />
|
||||
</system.Web>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.5.2" />
|
||||
<httpRuntime targetFramework="4.5" />
|
||||
</system.web>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="Oracle.ManagedDataAccess.Client" />
|
||||
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
|
||||
</DbProviderFactories>
|
||||
</system.data>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<publisherPolicy apply="no" />
|
||||
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.QualityTools.Testing.Fakes" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.9.9.0" newVersion="6.9.9.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<Oracle.ManagedDataAccess.Client>
|
||||
<version number="*">
|
||||
<dataSources>
|
||||
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
|
||||
</dataSources>
|
||||
</version>
|
||||
</Oracle.ManagedDataAccess.Client>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
||||
<parameters>
|
||||
<parameter value="v11.0" />
|
||||
</parameters>
|
||||
</defaultConnectionFactory>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
<provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<connectionStrings>
|
||||
<add name="crmContext" connectionString="DATA SOURCE=192.168.1.41:1521/ZJZXCRM;PERSIST SECURITY INFO=True;USER ID=UPDEV;PASSWORD=sa123456." providerName="Oracle.ManagedDataAccess.Client" />
|
||||
<add name="Entities" connectionString="DATA SOURCE=192.168.1.41:1521/ZJZXCRM;PASSWORD=sa123456.;PERSIST SECURITY INFO=True;USER ID=WSKUSER" providerName="Oracle.ManagedDataAccess.Client" />
|
||||
<add name="AYCRMConn" connectionString="Database=WeiXin;Server=192.168.1.46;UID=sa;Password=sa123456.;" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<redis>
|
||||
<add name="Redis0" connectionString="192.168.1.45:6379" db="0" />
|
||||
</redis>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
<log4net>
|
||||
<!-- 错误日志附加介质-->
|
||||
<appender name="ErrorAppender" type="log4net.Appender.RollingFileAppender">
|
||||
<param name="LockingModel" type="log4net.Appender.FileAppender+MinimalLock" />
|
||||
<param name="File" value="LogError/" />
|
||||
<param name="AppendToFile" value="true" />
|
||||
<param name="MaxSizeRollBackups" value="10" />
|
||||
<param name="MaximumFileSize" value="5MB" />
|
||||
<param name="StaticLogFileName" value="false" />
|
||||
<param name="DatePattern" value="yyyyMMdd.'log'" />
|
||||
<param name="RollingStyle" value="Date" />
|
||||
<!--布局-->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
|
||||
</layout>
|
||||
<filter type="log4net.Filter.LevelRangeFilter">
|
||||
<levelMin value="ERROR" />
|
||||
<levelMax value="FATAL" />
|
||||
</filter>
|
||||
</appender>
|
||||
<!-- 信息日志附加介质-->
|
||||
<appender name="InfoAppender" type="log4net.Appender.RollingFileAppender">
|
||||
<param name="LockingModel" type="log4net.Appender.FileAppender+MinimalLock" />
|
||||
<param name="File" value="LogError/" />
|
||||
<param name="AppendToFile" value="true" />
|
||||
<param name="MaximumFileSize" value="5MB" />
|
||||
<param name="MaxSizeRollBackups" value="10" />
|
||||
<param name="StaticLogFileName" value="false" />
|
||||
<param name="DatePattern" value="yyyyMMdd.'info'" />
|
||||
<param name="RollingStyle" value="Date" />
|
||||
<!-- 信息日志布局-->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
|
||||
</layout>
|
||||
<filter type="log4net.Filter.LevelRangeFilter">
|
||||
<levelMin value="INFO" />
|
||||
<levelMax value="INFO" />
|
||||
</filter>
|
||||
</appender>
|
||||
<!-- 信息日志附加介质-->
|
||||
<appender name="DebugAppender" type="log4net.Appender.RollingFileAppender">
|
||||
<param name="LockingModel" type="log4net.Appender.FileAppender+MinimalLock" />
|
||||
<param name="File" value="LogError/" />
|
||||
<param name="AppendToFile" value="true" />
|
||||
<param name="MaximumFileSize" value="5MB" />
|
||||
<param name="MaxSizeRollBackups" value="10" />
|
||||
<param name="StaticLogFileName" value="false" />
|
||||
<param name="DatePattern" value="yyyyMMdd.'deb'" />
|
||||
<param name="RollingStyle" value="Date" />
|
||||
<!-- 信息日志布局-->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
|
||||
</layout>
|
||||
<filter type="log4net.Filter.LevelRangeFilter">
|
||||
<levelMin value="DEBUG" />
|
||||
<levelMax value="DEBUG" />
|
||||
</filter>
|
||||
</appender>
|
||||
<root>
|
||||
<level value="DEBUG" />
|
||||
<appender-ref ref="ErrorAppender" />
|
||||
<appender-ref ref="InfoAppender" />
|
||||
<appender-ref ref="DebugAppender" />
|
||||
</root>
|
||||
</log4net>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.0.0" targetFramework="net45" />
|
||||
<package id="jQuery" version="1.6.4" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Cors" version="5.2.3" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor.zh-Hans" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.SignalR" version="2.2.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.SignalR.Core" version="2.2.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.SignalR.JS" version="2.2.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.SignalR.SystemWeb" version="2.2.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Cors" version="5.2.3" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Owin" version="3.1.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Owin.Cors" version="3.1.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Owin.Host.SystemWeb" version="2.1.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Owin.Security" version="2.1.0" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
|
||||
<package id="Oracle.ManagedDataAccess" version="12.1.24160719" targetFramework="net45" />
|
||||
<package id="Oracle.ManagedDataAccess.EntityFramework" version="12.1.2400" targetFramework="net45" />
|
||||
<package id="Owin" version="1.0" targetFramework="net45" />
|
||||
</packages>
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue