忽略
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,320 +1,320 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace RSATest
|
||||
{
|
||||
/// <summary>
|
||||
/// RSA加解密 使用OpenSSL的公钥加密/私钥解密
|
||||
///
|
||||
/// 公私钥请使用openssl生成 ssh-keygen -t rsa 命令生成的公钥私钥是不行的
|
||||
///
|
||||
/// 作者:李志强
|
||||
/// 时间:2017年10月30日15:50:14
|
||||
/// QQ:501232752
|
||||
/// </summary>
|
||||
public class RSAHelper
|
||||
{
|
||||
private readonly RSA _privateKeyRsaProvider;
|
||||
private readonly RSA _publicKeyRsaProvider;
|
||||
private readonly HashAlgorithmName _hashAlgorithmName;
|
||||
private readonly Encoding _encoding;
|
||||
|
||||
/// <summary>
|
||||
/// 实例化RSAHelper
|
||||
/// </summary>
|
||||
/// <param name="rsaType">加密算法类型 RSA SHA1;RSA2 SHA256 密钥长度至少为2048</param>
|
||||
/// <param name="encoding">编码类型</param>
|
||||
/// <param name="privateKey">私钥</param>
|
||||
/// <param name="publicKey">公钥</param>
|
||||
public RSAHelper(RSAType rsaType, Encoding encoding, string privateKey, string publicKey = null)
|
||||
{
|
||||
_encoding = encoding;
|
||||
if (!string.IsNullOrEmpty(privateKey))
|
||||
{
|
||||
_privateKeyRsaProvider = CreateRsaProviderFromPrivateKey(privateKey);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(publicKey))
|
||||
{
|
||||
_publicKeyRsaProvider = CreateRsaProviderFromPublicKey(publicKey);
|
||||
}
|
||||
|
||||
_hashAlgorithmName = rsaType == RSAType.RSA ? HashAlgorithmName.SHA1 : HashAlgorithmName.SHA256;
|
||||
}
|
||||
|
||||
#region 使用私钥签名
|
||||
|
||||
/// <summary>
|
||||
/// 使用私钥签名
|
||||
/// </summary>
|
||||
/// <param name="data">原始数据</param>
|
||||
/// <returns></returns>
|
||||
public string Sign(string data)
|
||||
{
|
||||
byte[] dataBytes = _encoding.GetBytes(data);
|
||||
|
||||
var signatureBytes = _privateKeyRsaProvider.SignData(dataBytes, _hashAlgorithmName, RSASignaturePadding.Pkcs1);
|
||||
|
||||
return Convert.ToBase64String(signatureBytes);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 使用公钥验证签名
|
||||
|
||||
/// <summary>
|
||||
/// 使用公钥验证签名
|
||||
/// </summary>
|
||||
/// <param name="data">原始数据</param>
|
||||
/// <param name="sign">签名</param>
|
||||
/// <returns></returns>
|
||||
public bool Verify(string data,string sign)
|
||||
{
|
||||
byte[] dataBytes = _encoding.GetBytes(data);
|
||||
byte[] signBytes = Convert.FromBase64String(sign);
|
||||
|
||||
var verify = _publicKeyRsaProvider.VerifyData(dataBytes, signBytes, _hashAlgorithmName, RSASignaturePadding.Pkcs1);
|
||||
|
||||
return verify;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 解密
|
||||
|
||||
public string Decrypt(string cipherText)
|
||||
{
|
||||
if (_privateKeyRsaProvider == null)
|
||||
{
|
||||
throw new Exception("_privateKeyRsaProvider is null");
|
||||
}
|
||||
return Encoding.UTF8.GetString(_privateKeyRsaProvider.Decrypt(Convert.FromBase64String(cipherText), RSAEncryptionPadding.Pkcs1));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加密
|
||||
|
||||
public string Encrypt(string text)
|
||||
{
|
||||
if (_publicKeyRsaProvider == null)
|
||||
{
|
||||
throw new Exception("_publicKeyRsaProvider is null");
|
||||
}
|
||||
return Convert.ToBase64String(_publicKeyRsaProvider.Encrypt(Encoding.UTF8.GetBytes(text), RSAEncryptionPadding.Pkcs1));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 使用私钥创建RSA实例
|
||||
|
||||
public RSA CreateRsaProviderFromPrivateKey(string privateKey)
|
||||
{
|
||||
var privateKeyBits = Convert.FromBase64String(privateKey);
|
||||
|
||||
var rsa = RSA.Create();
|
||||
var rsaParameters = new RSAParameters();
|
||||
|
||||
using (BinaryReader binr = new BinaryReader(new MemoryStream(privateKeyBits)))
|
||||
{
|
||||
byte bt = 0;
|
||||
ushort twobytes = 0;
|
||||
twobytes = binr.ReadUInt16();
|
||||
if (twobytes == 0x8130)
|
||||
binr.ReadByte();
|
||||
else if (twobytes == 0x8230)
|
||||
binr.ReadInt16();
|
||||
else
|
||||
throw new Exception("Unexpected value read binr.ReadUInt16()");
|
||||
|
||||
twobytes = binr.ReadUInt16();
|
||||
if (twobytes != 0x0102)
|
||||
throw new Exception("Unexpected version");
|
||||
|
||||
bt = binr.ReadByte();
|
||||
if (bt != 0x00)
|
||||
throw new Exception("Unexpected value read binr.ReadByte()");
|
||||
|
||||
rsaParameters.Modulus = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.Exponent = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.D = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.P = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.Q = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.DP = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.DQ = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.InverseQ = binr.ReadBytes(GetIntegerSize(binr));
|
||||
}
|
||||
|
||||
rsa.ImportParameters(rsaParameters);
|
||||
return rsa;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 使用公钥创建RSA实例
|
||||
|
||||
public RSA CreateRsaProviderFromPublicKey(string publicKeyString)
|
||||
{
|
||||
// encoded OID sequence for PKCS #1 rsaEncryption szOID_RSA_RSA = "1.2.840.113549.1.1.1"
|
||||
byte[] seqOid = { 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00 };
|
||||
byte[] seq = new byte[15];
|
||||
|
||||
var x509Key = Convert.FromBase64String(publicKeyString);
|
||||
|
||||
// --------- Set up stream to read the asn.1 encoded SubjectPublicKeyInfo blob ------
|
||||
using (MemoryStream mem = new MemoryStream(x509Key))
|
||||
{
|
||||
using (BinaryReader binr = new BinaryReader(mem)) //wrap Memory Stream with BinaryReader for easy reading
|
||||
{
|
||||
byte bt = 0;
|
||||
ushort twobytes = 0;
|
||||
|
||||
twobytes = binr.ReadUInt16();
|
||||
if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81)
|
||||
binr.ReadByte(); //advance 1 byte
|
||||
else if (twobytes == 0x8230)
|
||||
binr.ReadInt16(); //advance 2 bytes
|
||||
else
|
||||
return null;
|
||||
|
||||
seq = binr.ReadBytes(15); //read the Sequence OID
|
||||
if (!CompareBytearrays(seq, seqOid)) //make sure Sequence for OID is correct
|
||||
return null;
|
||||
|
||||
twobytes = binr.ReadUInt16();
|
||||
if (twobytes == 0x8103) //data read as little endian order (actual data order for Bit String is 03 81)
|
||||
binr.ReadByte(); //advance 1 byte
|
||||
else if (twobytes == 0x8203)
|
||||
binr.ReadInt16(); //advance 2 bytes
|
||||
else
|
||||
return null;
|
||||
|
||||
bt = binr.ReadByte();
|
||||
if (bt != 0x00) //expect null byte next
|
||||
return null;
|
||||
|
||||
twobytes = binr.ReadUInt16();
|
||||
if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81)
|
||||
binr.ReadByte(); //advance 1 byte
|
||||
else if (twobytes == 0x8230)
|
||||
binr.ReadInt16(); //advance 2 bytes
|
||||
else
|
||||
return null;
|
||||
|
||||
twobytes = binr.ReadUInt16();
|
||||
byte lowbyte = 0x00;
|
||||
byte highbyte = 0x00;
|
||||
|
||||
if (twobytes == 0x8102) //data read as little endian order (actual data order for Integer is 02 81)
|
||||
lowbyte = binr.ReadByte(); // read next bytes which is bytes in modulus
|
||||
else if (twobytes == 0x8202)
|
||||
{
|
||||
highbyte = binr.ReadByte(); //advance 2 bytes
|
||||
lowbyte = binr.ReadByte();
|
||||
}
|
||||
else
|
||||
return null;
|
||||
byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; //reverse byte order since asn.1 key uses big endian order
|
||||
int modsize = BitConverter.ToInt32(modint, 0);
|
||||
|
||||
int firstbyte = binr.PeekChar();
|
||||
if (firstbyte == 0x00)
|
||||
{ //if first byte (highest order) of modulus is zero, don't include it
|
||||
binr.ReadByte(); //skip this null byte
|
||||
modsize -= 1; //reduce modulus buffer size by 1
|
||||
}
|
||||
|
||||
byte[] modulus = binr.ReadBytes(modsize); //read the modulus bytes
|
||||
|
||||
if (binr.ReadByte() != 0x02) //expect an Integer for the exponent data
|
||||
return null;
|
||||
int expbytes = (int)binr.ReadByte(); // should only need one byte for actual exponent data (for all useful values)
|
||||
byte[] exponent = binr.ReadBytes(expbytes);
|
||||
|
||||
// ------- create RSACryptoServiceProvider instance and initialize with public key -----
|
||||
var rsa = RSA.Create();
|
||||
RSAParameters rsaKeyInfo = new RSAParameters
|
||||
{
|
||||
Modulus = modulus,
|
||||
Exponent = exponent
|
||||
};
|
||||
rsa.ImportParameters(rsaKeyInfo);
|
||||
|
||||
return rsa;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 导入密钥算法
|
||||
|
||||
private int GetIntegerSize(BinaryReader binr)
|
||||
{
|
||||
byte bt = 0;
|
||||
int count = 0;
|
||||
bt = binr.ReadByte();
|
||||
if (bt != 0x02)
|
||||
return 0;
|
||||
bt = binr.ReadByte();
|
||||
|
||||
if (bt == 0x81)
|
||||
count = binr.ReadByte();
|
||||
else
|
||||
if (bt == 0x82)
|
||||
{
|
||||
var highbyte = binr.ReadByte();
|
||||
var lowbyte = binr.ReadByte();
|
||||
byte[] modint = { lowbyte, highbyte, 0x00, 0x00 };
|
||||
count = BitConverter.ToInt32(modint, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
count = bt;
|
||||
}
|
||||
|
||||
while (binr.ReadByte() == 0x00)
|
||||
{
|
||||
count -= 1;
|
||||
}
|
||||
binr.BaseStream.Seek(-1, SeekOrigin.Current);
|
||||
return count;
|
||||
}
|
||||
|
||||
private bool CompareBytearrays(byte[] a, byte[] b)
|
||||
{
|
||||
if (a.Length != b.Length)
|
||||
return false;
|
||||
int i = 0;
|
||||
foreach (byte c in a)
|
||||
{
|
||||
if (c != b[i])
|
||||
return false;
|
||||
i++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RSA算法类型
|
||||
/// </summary>
|
||||
public enum RSAType
|
||||
{
|
||||
/// <summary>
|
||||
/// SHA1
|
||||
/// </summary>
|
||||
RSA = 0,
|
||||
/// <summary>
|
||||
/// RSA2 密钥长度至少为2048
|
||||
/// SHA256
|
||||
/// </summary>
|
||||
RSA2
|
||||
}
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace RSATest
|
||||
{
|
||||
/// <summary>
|
||||
/// RSA加解密 使用OpenSSL的公钥加密/私钥解密
|
||||
///
|
||||
/// 公私钥请使用openssl生成 ssh-keygen -t rsa 命令生成的公钥私钥是不行的
|
||||
///
|
||||
/// 作者:李志强
|
||||
/// 时间:2017年10月30日15:50:14
|
||||
/// QQ:501232752
|
||||
/// </summary>
|
||||
public class RSAHelper
|
||||
{
|
||||
private readonly RSA _privateKeyRsaProvider;
|
||||
private readonly RSA _publicKeyRsaProvider;
|
||||
private readonly HashAlgorithmName _hashAlgorithmName;
|
||||
private readonly Encoding _encoding;
|
||||
|
||||
/// <summary>
|
||||
/// 实例化RSAHelper
|
||||
/// </summary>
|
||||
/// <param name="rsaType">加密算法类型 RSA SHA1;RSA2 SHA256 密钥长度至少为2048</param>
|
||||
/// <param name="encoding">编码类型</param>
|
||||
/// <param name="privateKey">私钥</param>
|
||||
/// <param name="publicKey">公钥</param>
|
||||
public RSAHelper(RSAType rsaType, Encoding encoding, string privateKey, string publicKey = null)
|
||||
{
|
||||
_encoding = encoding;
|
||||
if (!string.IsNullOrEmpty(privateKey))
|
||||
{
|
||||
_privateKeyRsaProvider = CreateRsaProviderFromPrivateKey(privateKey);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(publicKey))
|
||||
{
|
||||
_publicKeyRsaProvider = CreateRsaProviderFromPublicKey(publicKey);
|
||||
}
|
||||
|
||||
_hashAlgorithmName = rsaType == RSAType.RSA ? HashAlgorithmName.SHA1 : HashAlgorithmName.SHA256;
|
||||
}
|
||||
|
||||
#region 使用私钥签名
|
||||
|
||||
/// <summary>
|
||||
/// 使用私钥签名
|
||||
/// </summary>
|
||||
/// <param name="data">原始数据</param>
|
||||
/// <returns></returns>
|
||||
public string Sign(string data)
|
||||
{
|
||||
byte[] dataBytes = _encoding.GetBytes(data);
|
||||
|
||||
var signatureBytes = _privateKeyRsaProvider.SignData(dataBytes, _hashAlgorithmName, RSASignaturePadding.Pkcs1);
|
||||
|
||||
return Convert.ToBase64String(signatureBytes);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 使用公钥验证签名
|
||||
|
||||
/// <summary>
|
||||
/// 使用公钥验证签名
|
||||
/// </summary>
|
||||
/// <param name="data">原始数据</param>
|
||||
/// <param name="sign">签名</param>
|
||||
/// <returns></returns>
|
||||
public bool Verify(string data,string sign)
|
||||
{
|
||||
byte[] dataBytes = _encoding.GetBytes(data);
|
||||
byte[] signBytes = Convert.FromBase64String(sign);
|
||||
|
||||
var verify = _publicKeyRsaProvider.VerifyData(dataBytes, signBytes, _hashAlgorithmName, RSASignaturePadding.Pkcs1);
|
||||
|
||||
return verify;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 解密
|
||||
|
||||
public string Decrypt(string cipherText)
|
||||
{
|
||||
if (_privateKeyRsaProvider == null)
|
||||
{
|
||||
throw new Exception("_privateKeyRsaProvider is null");
|
||||
}
|
||||
return Encoding.UTF8.GetString(_privateKeyRsaProvider.Decrypt(Convert.FromBase64String(cipherText), RSAEncryptionPadding.Pkcs1));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加密
|
||||
|
||||
public string Encrypt(string text)
|
||||
{
|
||||
if (_publicKeyRsaProvider == null)
|
||||
{
|
||||
throw new Exception("_publicKeyRsaProvider is null");
|
||||
}
|
||||
return Convert.ToBase64String(_publicKeyRsaProvider.Encrypt(Encoding.UTF8.GetBytes(text), RSAEncryptionPadding.Pkcs1));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 使用私钥创建RSA实例
|
||||
|
||||
public RSA CreateRsaProviderFromPrivateKey(string privateKey)
|
||||
{
|
||||
var privateKeyBits = Convert.FromBase64String(privateKey);
|
||||
|
||||
var rsa = RSA.Create();
|
||||
var rsaParameters = new RSAParameters();
|
||||
|
||||
using (BinaryReader binr = new BinaryReader(new MemoryStream(privateKeyBits)))
|
||||
{
|
||||
byte bt = 0;
|
||||
ushort twobytes = 0;
|
||||
twobytes = binr.ReadUInt16();
|
||||
if (twobytes == 0x8130)
|
||||
binr.ReadByte();
|
||||
else if (twobytes == 0x8230)
|
||||
binr.ReadInt16();
|
||||
else
|
||||
throw new Exception("Unexpected value read binr.ReadUInt16()");
|
||||
|
||||
twobytes = binr.ReadUInt16();
|
||||
if (twobytes != 0x0102)
|
||||
throw new Exception("Unexpected version");
|
||||
|
||||
bt = binr.ReadByte();
|
||||
if (bt != 0x00)
|
||||
throw new Exception("Unexpected value read binr.ReadByte()");
|
||||
|
||||
rsaParameters.Modulus = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.Exponent = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.D = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.P = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.Q = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.DP = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.DQ = binr.ReadBytes(GetIntegerSize(binr));
|
||||
rsaParameters.InverseQ = binr.ReadBytes(GetIntegerSize(binr));
|
||||
}
|
||||
|
||||
rsa.ImportParameters(rsaParameters);
|
||||
return rsa;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 使用公钥创建RSA实例
|
||||
|
||||
public RSA CreateRsaProviderFromPublicKey(string publicKeyString)
|
||||
{
|
||||
// encoded OID sequence for PKCS #1 rsaEncryption szOID_RSA_RSA = "1.2.840.113549.1.1.1"
|
||||
byte[] seqOid = { 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00 };
|
||||
byte[] seq = new byte[15];
|
||||
|
||||
var x509Key = Convert.FromBase64String(publicKeyString);
|
||||
|
||||
// --------- Set up stream to read the asn.1 encoded SubjectPublicKeyInfo blob ------
|
||||
using (MemoryStream mem = new MemoryStream(x509Key))
|
||||
{
|
||||
using (BinaryReader binr = new BinaryReader(mem)) //wrap Memory Stream with BinaryReader for easy reading
|
||||
{
|
||||
byte bt = 0;
|
||||
ushort twobytes = 0;
|
||||
|
||||
twobytes = binr.ReadUInt16();
|
||||
if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81)
|
||||
binr.ReadByte(); //advance 1 byte
|
||||
else if (twobytes == 0x8230)
|
||||
binr.ReadInt16(); //advance 2 bytes
|
||||
else
|
||||
return null;
|
||||
|
||||
seq = binr.ReadBytes(15); //read the Sequence OID
|
||||
if (!CompareBytearrays(seq, seqOid)) //make sure Sequence for OID is correct
|
||||
return null;
|
||||
|
||||
twobytes = binr.ReadUInt16();
|
||||
if (twobytes == 0x8103) //data read as little endian order (actual data order for Bit String is 03 81)
|
||||
binr.ReadByte(); //advance 1 byte
|
||||
else if (twobytes == 0x8203)
|
||||
binr.ReadInt16(); //advance 2 bytes
|
||||
else
|
||||
return null;
|
||||
|
||||
bt = binr.ReadByte();
|
||||
if (bt != 0x00) //expect null byte next
|
||||
return null;
|
||||
|
||||
twobytes = binr.ReadUInt16();
|
||||
if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81)
|
||||
binr.ReadByte(); //advance 1 byte
|
||||
else if (twobytes == 0x8230)
|
||||
binr.ReadInt16(); //advance 2 bytes
|
||||
else
|
||||
return null;
|
||||
|
||||
twobytes = binr.ReadUInt16();
|
||||
byte lowbyte = 0x00;
|
||||
byte highbyte = 0x00;
|
||||
|
||||
if (twobytes == 0x8102) //data read as little endian order (actual data order for Integer is 02 81)
|
||||
lowbyte = binr.ReadByte(); // read next bytes which is bytes in modulus
|
||||
else if (twobytes == 0x8202)
|
||||
{
|
||||
highbyte = binr.ReadByte(); //advance 2 bytes
|
||||
lowbyte = binr.ReadByte();
|
||||
}
|
||||
else
|
||||
return null;
|
||||
byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; //reverse byte order since asn.1 key uses big endian order
|
||||
int modsize = BitConverter.ToInt32(modint, 0);
|
||||
|
||||
int firstbyte = binr.PeekChar();
|
||||
if (firstbyte == 0x00)
|
||||
{ //if first byte (highest order) of modulus is zero, don't include it
|
||||
binr.ReadByte(); //skip this null byte
|
||||
modsize -= 1; //reduce modulus buffer size by 1
|
||||
}
|
||||
|
||||
byte[] modulus = binr.ReadBytes(modsize); //read the modulus bytes
|
||||
|
||||
if (binr.ReadByte() != 0x02) //expect an Integer for the exponent data
|
||||
return null;
|
||||
int expbytes = (int)binr.ReadByte(); // should only need one byte for actual exponent data (for all useful values)
|
||||
byte[] exponent = binr.ReadBytes(expbytes);
|
||||
|
||||
// ------- create RSACryptoServiceProvider instance and initialize with public key -----
|
||||
var rsa = RSA.Create();
|
||||
RSAParameters rsaKeyInfo = new RSAParameters
|
||||
{
|
||||
Modulus = modulus,
|
||||
Exponent = exponent
|
||||
};
|
||||
rsa.ImportParameters(rsaKeyInfo);
|
||||
|
||||
return rsa;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 导入密钥算法
|
||||
|
||||
private int GetIntegerSize(BinaryReader binr)
|
||||
{
|
||||
byte bt = 0;
|
||||
int count = 0;
|
||||
bt = binr.ReadByte();
|
||||
if (bt != 0x02)
|
||||
return 0;
|
||||
bt = binr.ReadByte();
|
||||
|
||||
if (bt == 0x81)
|
||||
count = binr.ReadByte();
|
||||
else
|
||||
if (bt == 0x82)
|
||||
{
|
||||
var highbyte = binr.ReadByte();
|
||||
var lowbyte = binr.ReadByte();
|
||||
byte[] modint = { lowbyte, highbyte, 0x00, 0x00 };
|
||||
count = BitConverter.ToInt32(modint, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
count = bt;
|
||||
}
|
||||
|
||||
while (binr.ReadByte() == 0x00)
|
||||
{
|
||||
count -= 1;
|
||||
}
|
||||
binr.BaseStream.Seek(-1, SeekOrigin.Current);
|
||||
return count;
|
||||
}
|
||||
|
||||
private bool CompareBytearrays(byte[] a, byte[] b)
|
||||
{
|
||||
if (a.Length != b.Length)
|
||||
return false;
|
||||
int i = 0;
|
||||
foreach (byte c in a)
|
||||
{
|
||||
if (c != b[i])
|
||||
return false;
|
||||
i++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RSA算法类型
|
||||
/// </summary>
|
||||
public enum RSAType
|
||||
{
|
||||
/// <summary>
|
||||
/// SHA1
|
||||
/// </summary>
|
||||
RSA = 0,
|
||||
/// <summary>
|
||||
/// RSA2 密钥长度至少为2048
|
||||
/// SHA256
|
||||
/// </summary>
|
||||
RSA2
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,15 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Etor.Infrastructure\Etor.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Etor.Infrastructure\Etor.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
using System.Net.Http;
|
||||
|
||||
namespace ServiceClient
|
||||
{
|
||||
public class BaseInfoHttpClient
|
||||
{
|
||||
private IHttpClientFactory _httpClientFactory;
|
||||
|
||||
internal static string _BaseUrl = "";
|
||||
|
||||
public string BaseUrl => _BaseUrl;
|
||||
|
||||
public BaseInfoHttpClient(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
public HttpClient CreateHttpClient()
|
||||
{
|
||||
return _httpClientFactory.CreateClient();
|
||||
}
|
||||
|
||||
}
|
||||
using System.Net.Http;
|
||||
|
||||
namespace ServiceClient
|
||||
{
|
||||
public class BaseInfoHttpClient
|
||||
{
|
||||
private IHttpClientFactory _httpClientFactory;
|
||||
|
||||
internal static string _BaseUrl = "";
|
||||
|
||||
public string BaseUrl => _BaseUrl;
|
||||
|
||||
public BaseInfoHttpClient(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
public HttpClient CreateHttpClient()
|
||||
{
|
||||
return _httpClientFactory.CreateClient();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace ServiceClient
|
||||
{
|
||||
public static class IServiceCollectionExtension
|
||||
{
|
||||
public static void AddBaseInfoClient(this IServiceCollection service, string baseUrl)
|
||||
{
|
||||
BaseInfoHttpClient._BaseUrl = baseUrl;
|
||||
|
||||
service.AddSingleton<BaseInfoHttpClient>();
|
||||
}
|
||||
}
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace ServiceClient
|
||||
{
|
||||
public static class IServiceCollectionExtension
|
||||
{
|
||||
public static void AddBaseInfoClient(this IServiceCollection service, string baseUrl)
|
||||
{
|
||||
BaseInfoHttpClient._BaseUrl = baseUrl;
|
||||
|
||||
service.AddSingleton<BaseInfoHttpClient>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.Householder
|
||||
{
|
||||
public class HouseholderItem
|
||||
{
|
||||
[JsonProperty("ID")] public int UserId { get; set; }
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
|
||||
[JsonProperty("mobile")] public string Mobile { get; set; } = "";
|
||||
}
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.Householder
|
||||
{
|
||||
public class HouseholderItem
|
||||
{
|
||||
[JsonProperty("ID")] public int UserId { get; set; }
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
|
||||
[JsonProperty("mobile")] public string Mobile { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -1,56 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Householder;
|
||||
|
||||
namespace ServiceClient.Response.Householder
|
||||
{
|
||||
|
||||
|
||||
public class QueryAllHouseholdersByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("userData")]
|
||||
public List<HouseholderItem> HouseholderItems { get; set; } = new List<HouseholderItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllHouseholdersByOwnerIdExtension
|
||||
{
|
||||
public static async Task<List<HouseholderItem>> QueryAllHouseholdersByOwnerId(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBasePerson?OwnerID={ownerId}&Data.IsGetUser=true");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllHouseholdersByOwnerIdResponse>>().Data.HouseholderItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<HouseholderItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<HouseholderItem>();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Householder;
|
||||
|
||||
namespace ServiceClient.Response.Householder
|
||||
{
|
||||
|
||||
|
||||
public class QueryAllHouseholdersByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("userData")]
|
||||
public List<HouseholderItem> HouseholderItems { get; set; } = new List<HouseholderItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllHouseholdersByOwnerIdExtension
|
||||
{
|
||||
public static async Task<List<HouseholderItem>> QueryAllHouseholdersByOwnerId(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBasePerson?OwnerID={ownerId}&Data.IsGetUser=true");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllHouseholdersByOwnerIdResponse>>().Data.HouseholderItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<HouseholderItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<HouseholderItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Householder;
|
||||
|
||||
namespace ServiceClient.Response.Householder
|
||||
{
|
||||
public class QueryHouseholderInfoByUserIdResponse
|
||||
{
|
||||
[JsonProperty("userData")] public HouseholderItem HouseholderItem { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryHouseholderInfoByUserIdExtension
|
||||
{
|
||||
public static async Task<HouseholderItem> QueryHouseholderInfoByUserId(this BaseInfoHttpClient client
|
||||
, int ownerId, int userId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?OwnerID={ownerId}&Data.userId={userId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryHouseholderInfoByUserIdResponse>>().Data.HouseholderItem;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据UserId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HouseholderItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new HouseholderItem();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Householder;
|
||||
|
||||
namespace ServiceClient.Response.Householder
|
||||
{
|
||||
public class QueryHouseholderInfoByUserIdResponse
|
||||
{
|
||||
[JsonProperty("userData")] public HouseholderItem HouseholderItem { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryHouseholderInfoByUserIdExtension
|
||||
{
|
||||
public static async Task<HouseholderItem> QueryHouseholderInfoByUserId(this BaseInfoHttpClient client
|
||||
, int ownerId, int userId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?OwnerID={ownerId}&Data.userId={userId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryHouseholderInfoByUserIdResponse>>().Data.HouseholderItem;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据UserId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HouseholderItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new HouseholderItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,130 +1,130 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Response.Manage
|
||||
{
|
||||
public class ManageItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 管理员id
|
||||
/// <summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// <summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// <summary>
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除标记
|
||||
/// <summary>
|
||||
public int DeleteTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属物业ID
|
||||
/// <summary>
|
||||
public int OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人ID
|
||||
/// <summary>
|
||||
public int UpdatorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人ID
|
||||
/// <summary>
|
||||
public int CreatorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员登录名[16
|
||||
/// </summary>
|
||||
public string LoginCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录密码[20]
|
||||
/// </summary>
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的内部人员id
|
||||
/// </summary>
|
||||
public int workerid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员角色
|
||||
/// </summary>
|
||||
public int roleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public int state { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 头像地址[30
|
||||
/// </summary>
|
||||
public string photourl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信openid[50]
|
||||
/// </summary>
|
||||
public string wxopenid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信昵称
|
||||
/// </summary>
|
||||
public string wxnickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信头像
|
||||
/// </summary>
|
||||
public string wximage { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 注册来源
|
||||
/// </summary>
|
||||
public int source { get; set; }
|
||||
/// <summary>
|
||||
/// 系统ID
|
||||
/// </summary>
|
||||
public int systemid { get; set; }
|
||||
/// <summary>
|
||||
/// 管理员手机号
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
/// <summary>
|
||||
/// 账号code
|
||||
/// </summary>
|
||||
public string managercode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员姓名
|
||||
/// </summary>
|
||||
public string RealName { get; set; }
|
||||
/// <summary>
|
||||
/// 电子邮箱
|
||||
/// </summary>
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目关联
|
||||
/// </summary>
|
||||
public string ProjectContact { get; set; }
|
||||
|
||||
public bool IsIntegrator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否主管理员权限
|
||||
/// </summary>
|
||||
public bool Isroot { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Response.Manage
|
||||
{
|
||||
public class ManageItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 管理员id
|
||||
/// <summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// <summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// <summary>
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除标记
|
||||
/// <summary>
|
||||
public int DeleteTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属物业ID
|
||||
/// <summary>
|
||||
public int OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人ID
|
||||
/// <summary>
|
||||
public int UpdatorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人ID
|
||||
/// <summary>
|
||||
public int CreatorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员登录名[16
|
||||
/// </summary>
|
||||
public string LoginCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录密码[20]
|
||||
/// </summary>
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的内部人员id
|
||||
/// </summary>
|
||||
public int workerid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员角色
|
||||
/// </summary>
|
||||
public int roleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public int state { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 头像地址[30
|
||||
/// </summary>
|
||||
public string photourl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信openid[50]
|
||||
/// </summary>
|
||||
public string wxopenid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信昵称
|
||||
/// </summary>
|
||||
public string wxnickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信头像
|
||||
/// </summary>
|
||||
public string wximage { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 注册来源
|
||||
/// </summary>
|
||||
public int source { get; set; }
|
||||
/// <summary>
|
||||
/// 系统ID
|
||||
/// </summary>
|
||||
public int systemid { get; set; }
|
||||
/// <summary>
|
||||
/// 管理员手机号
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
/// <summary>
|
||||
/// 账号code
|
||||
/// </summary>
|
||||
public string managercode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员姓名
|
||||
/// </summary>
|
||||
public string RealName { get; set; }
|
||||
/// <summary>
|
||||
/// 电子邮箱
|
||||
/// </summary>
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目关联
|
||||
/// </summary>
|
||||
public string ProjectContact { get; set; }
|
||||
|
||||
public bool IsIntegrator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否主管理员权限
|
||||
/// </summary>
|
||||
public bool Isroot { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Response.Manage
|
||||
{
|
||||
public class PermissionProjectByManagerItem
|
||||
{
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// <summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属物业ID
|
||||
/// <summary>
|
||||
public int OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员数据库ID
|
||||
/// </summary>
|
||||
public int ManagerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目编码
|
||||
/// </summary>
|
||||
public int ProjectCode { get; set; }
|
||||
/// <summary>
|
||||
/// 小区名称
|
||||
/// </summary>
|
||||
public string ProjectName { get; set; }
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Response.Manage
|
||||
{
|
||||
public class PermissionProjectByManagerItem
|
||||
{
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// <summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属物业ID
|
||||
/// <summary>
|
||||
public int OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员数据库ID
|
||||
/// </summary>
|
||||
public int ManagerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目编码
|
||||
/// </summary>
|
||||
public int ProjectCode { get; set; }
|
||||
/// <summary>
|
||||
/// 小区名称
|
||||
/// </summary>
|
||||
public string ProjectName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Manage;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Manage
|
||||
{
|
||||
|
||||
}
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllManageByOwnerIdResponse
|
||||
{
|
||||
public static async Task<ManageItem> QueryManageById(this BaseInfoHttpClient client
|
||||
, int Id, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/manage/v1/Manager/GetOneManage?Id={Id}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<ManageItem>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ManageItem();
|
||||
}
|
||||
}
|
||||
return new ManageItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Manage;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Manage
|
||||
{
|
||||
|
||||
}
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllManageByOwnerIdResponse
|
||||
{
|
||||
public static async Task<ManageItem> QueryManageById(this BaseInfoHttpClient client
|
||||
, int Id, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/manage/v1/Manager/GetOneManage?Id={Id}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<ManageItem>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ManageItem();
|
||||
}
|
||||
}
|
||||
return new ManageItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Manage;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryPermissionProjectByManagerIdResponse
|
||||
{
|
||||
public static async Task<List<PermissionProjectByManagerItem>> QueryProjectCodeByManageId(this BaseInfoHttpClient client
|
||||
, int Id, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/manage/v1/Manager/GetByManageId?ManagerId={Id}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<List<PermissionProjectByManagerItem>>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<PermissionProjectByManagerItem>();
|
||||
}
|
||||
}
|
||||
return new List<PermissionProjectByManagerItem>();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Manage;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryPermissionProjectByManagerIdResponse
|
||||
{
|
||||
public static async Task<List<PermissionProjectByManagerItem>> QueryProjectCodeByManageId(this BaseInfoHttpClient client
|
||||
, int Id, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/manage/v1/Manager/GetByManageId?ManagerId={Id}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<List<PermissionProjectByManagerItem>>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<PermissionProjectByManagerItem>();
|
||||
}
|
||||
}
|
||||
return new List<PermissionProjectByManagerItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BaseInfoClient.Response.Project
|
||||
{
|
||||
public class ProjectItem
|
||||
{
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Ð¡ÇøµØÖ·
|
||||
/// </summary>
|
||||
[JsonProperty("location")] public string Location { get; set; } = "";
|
||||
|
||||
|
||||
[JsonProperty("projectType")] public int projectType { get; set; }
|
||||
}
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BaseInfoClient.Response.Project
|
||||
{
|
||||
public class ProjectItem
|
||||
{
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Ð¡ÇøµØÖ·
|
||||
/// </summary>
|
||||
[JsonProperty("location")] public string Location { get; set; } = "";
|
||||
|
||||
|
||||
[JsonProperty("projectType")] public int projectType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,55 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Project;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Project
|
||||
{
|
||||
|
||||
|
||||
public class QueryAllProjectsByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("projectData")] public List<ProjectItem> ProjectItems { get; set; } = new List<ProjectItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllProjectsByOwnerIdExtension
|
||||
{
|
||||
public static async Task<List<ProjectItem>> QueryAllProjectsByOwnerIdAsync(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBaseProject?OwnerID={ownerId}&Data.IsGetproject=true");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllProjectsByOwnerIdResponse>>().Data.ProjectItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取小区", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取小区信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<ProjectItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<ProjectItem>();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Project;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Project
|
||||
{
|
||||
|
||||
|
||||
public class QueryAllProjectsByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("projectData")] public List<ProjectItem> ProjectItems { get; set; } = new List<ProjectItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllProjectsByOwnerIdExtension
|
||||
{
|
||||
public static async Task<List<ProjectItem>> QueryAllProjectsByOwnerIdAsync(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBaseProject?OwnerID={ownerId}&Data.IsGetproject=true");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllProjectsByOwnerIdResponse>>().Data.ProjectItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取小区", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取小区信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<ProjectItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<ProjectItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Project;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Project
|
||||
{
|
||||
public class QueryOneProjectByCodeResponse
|
||||
{
|
||||
[JsonProperty("projectData")] public ProjectItem ProjectItem { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryProjectByCodeResponseExtension
|
||||
{
|
||||
public static async Task<ProjectItem> QueryOneProjectByCodeAsync(this BaseInfoHttpClient client
|
||||
, int ownerId, int projectCode, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBaseProject?OwnerID={ownerId}&Data.projectCode={projectCode}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryOneProjectByCodeResponse>>().Data.ProjectItem;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据ProjectCode获取小区", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取小区信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ProjectItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new ProjectItem();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Project;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Project
|
||||
{
|
||||
public class QueryOneProjectByCodeResponse
|
||||
{
|
||||
[JsonProperty("projectData")] public ProjectItem ProjectItem { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryProjectByCodeResponseExtension
|
||||
{
|
||||
public static async Task<ProjectItem> QueryOneProjectByCodeAsync(this BaseInfoHttpClient client
|
||||
, int ownerId, int projectCode, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBaseProject?OwnerID={ownerId}&Data.projectCode={projectCode}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryOneProjectByCodeResponse>>().Data.ProjectItem;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据ProjectCode获取小区", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取小区信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ProjectItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new ProjectItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.PropertyEmployee
|
||||
{
|
||||
public class EmployeeItem
|
||||
{
|
||||
[JsonProperty("ID")] public int UserId { get; set; }
|
||||
|
||||
[JsonProperty("mobile")] public string Mobile { get; set; } = "";
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("isInternal")] public bool IsInternal { get; set; }
|
||||
}
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.PropertyEmployee
|
||||
{
|
||||
public class EmployeeItem
|
||||
{
|
||||
[JsonProperty("ID")] public int UserId { get; set; }
|
||||
|
||||
[JsonProperty("mobile")] public string Mobile { get; set; } = "";
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("isInternal")] public bool IsInternal { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,57 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.PropertyEmployee;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
namespace ServiceClient.Response.PropertyEmployee
|
||||
{
|
||||
public class QueryAllEmployeesByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("staffData")]
|
||||
public List<EmployeeItem> EmployeeInfos { get; set; }=new List<EmployeeItem>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllEmployeesByOwnerIdResponseExtension
|
||||
{
|
||||
public static async Task<List<EmployeeItem>> QueryAllEmployeesByOwnerId(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBasePerson?Data.IsGetSaff=true&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllEmployeesByOwnerIdResponse>>().Data.EmployeeInfos;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取物业员工",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取员工信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<EmployeeItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<EmployeeItem>();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.PropertyEmployee;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
namespace ServiceClient.Response.PropertyEmployee
|
||||
{
|
||||
public class QueryAllEmployeesByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("staffData")]
|
||||
public List<EmployeeItem> EmployeeInfos { get; set; }=new List<EmployeeItem>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllEmployeesByOwnerIdResponseExtension
|
||||
{
|
||||
public static async Task<List<EmployeeItem>> QueryAllEmployeesByOwnerId(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBasePerson?Data.IsGetSaff=true&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllEmployeesByOwnerIdResponse>>().Data.EmployeeInfos;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取物业员工",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取员工信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<EmployeeItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<EmployeeItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +1,57 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.PropertyEmployee;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
namespace ServiceClient.Response.PropertyEmployee
|
||||
{
|
||||
|
||||
|
||||
public class QueryEmployeeInfoByUserIdResponse
|
||||
{
|
||||
[JsonProperty("staffData")] public EmployeeItem UserInfo { get; set; } = new EmployeeItem();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryEmployeeInfoByUserIdResponseExtension
|
||||
{
|
||||
public static async Task<EmployeeItem> QueryEmployeeInfoByUserId(this BaseInfoHttpClient client, int ownerId,
|
||||
int userId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?Data.staffId={userId}&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryEmployeeInfoByUserIdResponse>>().Data.UserInfo;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据员工Id获取员工信息",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取员工信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new EmployeeItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new EmployeeItem();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.PropertyEmployee;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
namespace ServiceClient.Response.PropertyEmployee
|
||||
{
|
||||
|
||||
|
||||
public class QueryEmployeeInfoByUserIdResponse
|
||||
{
|
||||
[JsonProperty("staffData")] public EmployeeItem UserInfo { get; set; } = new EmployeeItem();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryEmployeeInfoByUserIdResponseExtension
|
||||
{
|
||||
public static async Task<EmployeeItem> QueryEmployeeInfoByUserId(this BaseInfoHttpClient client, int ownerId,
|
||||
int userId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?Data.staffId={userId}&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryEmployeeInfoByUserIdResponse>>().Data.UserInfo;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据员工Id获取员工信息",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取员工信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new EmployeeItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new EmployeeItem();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,54 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Room;
|
||||
|
||||
namespace ServiceClient.Response.Room
|
||||
{
|
||||
public class QueryAllHouseholderRoomsByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("userToRoomData")]
|
||||
public List<UserRoomItem> UserRoomItems { get; set; } = new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllHouseholderRoomsByOwnerIdResponseExtension
|
||||
{
|
||||
public static async Task<List<UserRoomItem>> QueryAllHouseholderRoomsByOwnerId(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBasePerson?Data.IsGetUserToRoom=true&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllHouseholderRoomsByOwnerIdResponse>>().Data.UserRoomItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据UserId获取用户房间信息", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取用户房间信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Room;
|
||||
|
||||
namespace ServiceClient.Response.Room
|
||||
{
|
||||
public class QueryAllHouseholderRoomsByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("userToRoomData")]
|
||||
public List<UserRoomItem> UserRoomItems { get; set; } = new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllHouseholderRoomsByOwnerIdResponseExtension
|
||||
{
|
||||
public static async Task<List<UserRoomItem>> QueryAllHouseholderRoomsByOwnerId(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBasePerson?Data.IsGetUserToRoom=true&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllHouseholderRoomsByOwnerIdResponse>>().Data.UserRoomItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据UserId获取用户房间信息", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取用户房间信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Room;
|
||||
|
||||
namespace ServiceClient.Response.Room
|
||||
{
|
||||
|
||||
|
||||
public class QueryHouseholderRoomsByUserIdResponse
|
||||
{
|
||||
[JsonProperty("userToRoomData")]
|
||||
public List<UserRoomItem> UserRoomItems { get; set; } = new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryHouseholderRoomsByUserIdExtension
|
||||
{
|
||||
public static async Task<List<UserRoomItem>> QueryHouseholderRoomsByUserId(this BaseInfoHttpClient client
|
||||
, int ownerId, int userId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?Data.userToroomUserId={userId}&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryHouseholderRoomsByUserIdResponse>>().Data.UserRoomItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据UserId获取用户房间信息", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取用户房间信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Room;
|
||||
|
||||
namespace ServiceClient.Response.Room
|
||||
{
|
||||
|
||||
|
||||
public class QueryHouseholderRoomsByUserIdResponse
|
||||
{
|
||||
[JsonProperty("userToRoomData")]
|
||||
public List<UserRoomItem> UserRoomItems { get; set; } = new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryHouseholderRoomsByUserIdExtension
|
||||
{
|
||||
public static async Task<List<UserRoomItem>> QueryHouseholderRoomsByUserId(this BaseInfoHttpClient client
|
||||
, int ownerId, int userId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?Data.userToroomUserId={userId}&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryHouseholderRoomsByUserIdResponse>>().Data.UserRoomItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据UserId获取用户房间信息", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取用户房间信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,25 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.Room
|
||||
{
|
||||
public class UserRoomItem
|
||||
{
|
||||
[JsonProperty("userId")] public int UserId { get; set; }
|
||||
|
||||
[JsonProperty("roomCode")] public string RoomCode { get; set; } = "";
|
||||
|
||||
[JsonProperty("deleteTag")] public int DeleteTag { get; set; }
|
||||
|
||||
[JsonProperty("state")] public int State { get; set; }
|
||||
|
||||
[JsonProperty("floor")] public int Floor { get; set; }
|
||||
|
||||
[JsonProperty("roomNo")] public string RoomNo { get; set; }
|
||||
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("buildCode")] public string BuildCode { get; set; }
|
||||
|
||||
[JsonProperty("unit")] public string Unit { get; set; }
|
||||
}
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.Room
|
||||
{
|
||||
public class UserRoomItem
|
||||
{
|
||||
[JsonProperty("userId")] public int UserId { get; set; }
|
||||
|
||||
[JsonProperty("roomCode")] public string RoomCode { get; set; } = "";
|
||||
|
||||
[JsonProperty("deleteTag")] public int DeleteTag { get; set; }
|
||||
|
||||
[JsonProperty("state")] public int State { get; set; }
|
||||
|
||||
[JsonProperty("floor")] public int Floor { get; set; }
|
||||
|
||||
[JsonProperty("roomNo")] public string RoomNo { get; set; }
|
||||
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("buildCode")] public string BuildCode { get; set; }
|
||||
|
||||
[JsonProperty("unit")] public string Unit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,63 +1,63 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Householder;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
namespace ServiceClient.Response.User
|
||||
{
|
||||
public class QueryVisiterAndUserByWxOpenIdResponse
|
||||
{
|
||||
[JsonProperty("userData")]
|
||||
public HouseholderItem HouseholderItem { get; set; }
|
||||
|
||||
[JsonProperty("visterData")]
|
||||
public VisterItem VisterItem { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryVisiterAndUserByWxOpenIdResponseExtension
|
||||
{
|
||||
public static async Task<QueryVisiterAndUserByWxOpenIdResponse> QueryVisiterAndUserByWxOpenId(
|
||||
this BaseInfoHttpClient client, string openId,bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response =
|
||||
await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetUserVisterByOpenID?openId={openId}");
|
||||
//var response =
|
||||
// await client.CreateHttpClient().GetAsync(
|
||||
// $"https://localhost:44324/api/baseinfo/v1/BaseData/GetUserVisterByOpenID?openId={openId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryVisiterAndUserByWxOpenIdResponse>>().Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据openId查询用户",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取用户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new QueryVisiterAndUserByWxOpenIdResponse();
|
||||
}
|
||||
}
|
||||
|
||||
return new QueryVisiterAndUserByWxOpenIdResponse();
|
||||
}
|
||||
}
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Householder;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
namespace ServiceClient.Response.User
|
||||
{
|
||||
public class QueryVisiterAndUserByWxOpenIdResponse
|
||||
{
|
||||
[JsonProperty("userData")]
|
||||
public HouseholderItem HouseholderItem { get; set; }
|
||||
|
||||
[JsonProperty("visterData")]
|
||||
public VisterItem VisterItem { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryVisiterAndUserByWxOpenIdResponseExtension
|
||||
{
|
||||
public static async Task<QueryVisiterAndUserByWxOpenIdResponse> QueryVisiterAndUserByWxOpenId(
|
||||
this BaseInfoHttpClient client, string openId,bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response =
|
||||
await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetUserVisterByOpenID?openId={openId}");
|
||||
//var response =
|
||||
// await client.CreateHttpClient().GetAsync(
|
||||
// $"https://localhost:44324/api/baseinfo/v1/BaseData/GetUserVisterByOpenID?openId={openId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryVisiterAndUserByWxOpenIdResponse>>().Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据openId查询用户",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取用户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new QueryVisiterAndUserByWxOpenIdResponse();
|
||||
}
|
||||
}
|
||||
|
||||
return new QueryVisiterAndUserByWxOpenIdResponse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +1,53 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
|
||||
namespace ServiceClient.Response.User
|
||||
{
|
||||
public class QueryVisterByVisterIdResponse
|
||||
{
|
||||
[JsonProperty("visterData")] public VisterItem VisterItem { get; set; } = new VisterItem();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryVisterByVisterIdResponseExtension
|
||||
{
|
||||
public static async Task<VisterItem> QueryVisterByVisterId(this BaseInfoHttpClient client, int ownerId,
|
||||
int visterId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?OwnerID={ownerId}&Data.visterId={visterId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryVisterByVisterIdResponse>>().Data.VisterItem;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据访客Id查询访客信息",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取访客信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new VisterItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new VisterItem();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
|
||||
namespace ServiceClient.Response.User
|
||||
{
|
||||
public class QueryVisterByVisterIdResponse
|
||||
{
|
||||
[JsonProperty("visterData")] public VisterItem VisterItem { get; set; } = new VisterItem();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryVisterByVisterIdResponseExtension
|
||||
{
|
||||
public static async Task<VisterItem> QueryVisterByVisterId(this BaseInfoHttpClient client, int ownerId,
|
||||
int visterId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?OwnerID={ownerId}&Data.visterId={visterId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryVisterByVisterIdResponse>>().Data.VisterItem;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据访客Id查询访客信息",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取访客信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new VisterItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new VisterItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,97 +1,97 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.User
|
||||
{
|
||||
public class VisterItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 邀请人姓名
|
||||
/// </summary>
|
||||
[JsonProperty("username")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客姓名
|
||||
/// </summary>
|
||||
[JsonProperty("visitorname")]
|
||||
public string VisitorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客电话
|
||||
/// </summary>
|
||||
[JsonProperty("visitorphone")]
|
||||
public string VisitorPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 20 前台登记 10 用户邀请 30 人脸访问 40员工端邀请
|
||||
/// </summary>
|
||||
[JsonProperty("visitortype")]
|
||||
public int VisitorType { get; set; }
|
||||
|
||||
[JsonProperty("openid")] public string OpenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来访日期
|
||||
/// </summary>
|
||||
[JsonProperty("entrytime")]
|
||||
public DateTime EntryTime { get; set; }
|
||||
|
||||
[JsonProperty("expirytime")] public DateTime ExpiryTime { get; set; }
|
||||
|
||||
[JsonProperty("projectcode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("buildcode")] public string BuildCode { get; set; }
|
||||
|
||||
[JsonProperty("unit")] public string Unit { get; set; }
|
||||
|
||||
[JsonProperty("room")] public string Room { get; set; }
|
||||
|
||||
[JsonProperty("reason")] public string Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邀请函模板类型
|
||||
/// </summary>
|
||||
[JsonProperty("templatetype")]
|
||||
public int TemplateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 10:申请中 20:申请通过 30: 黑名单用户 40:申请作废
|
||||
/// </summary>
|
||||
[JsonProperty("stats")]
|
||||
public int Stats { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客接受时间
|
||||
/// </summary>
|
||||
[JsonProperty("accepttime")]
|
||||
public DateTime AcceptTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[JsonProperty("bak")]
|
||||
public string Bak { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信头像
|
||||
/// </summary>
|
||||
[JsonProperty("wxImgUrl")]
|
||||
public string WxImgUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人脸地址
|
||||
/// </summary>
|
||||
[JsonProperty("faceUrl")]
|
||||
public string FaceUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客人员ID
|
||||
/// </summary>
|
||||
[JsonProperty("userId")]
|
||||
public System.Int32? UserId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("ID")]
|
||||
public int Id { get; set; }
|
||||
}
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.User
|
||||
{
|
||||
public class VisterItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 邀请人姓名
|
||||
/// </summary>
|
||||
[JsonProperty("username")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客姓名
|
||||
/// </summary>
|
||||
[JsonProperty("visitorname")]
|
||||
public string VisitorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客电话
|
||||
/// </summary>
|
||||
[JsonProperty("visitorphone")]
|
||||
public string VisitorPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 20 前台登记 10 用户邀请 30 人脸访问 40员工端邀请
|
||||
/// </summary>
|
||||
[JsonProperty("visitortype")]
|
||||
public int VisitorType { get; set; }
|
||||
|
||||
[JsonProperty("openid")] public string OpenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来访日期
|
||||
/// </summary>
|
||||
[JsonProperty("entrytime")]
|
||||
public DateTime EntryTime { get; set; }
|
||||
|
||||
[JsonProperty("expirytime")] public DateTime ExpiryTime { get; set; }
|
||||
|
||||
[JsonProperty("projectcode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("buildcode")] public string BuildCode { get; set; }
|
||||
|
||||
[JsonProperty("unit")] public string Unit { get; set; }
|
||||
|
||||
[JsonProperty("room")] public string Room { get; set; }
|
||||
|
||||
[JsonProperty("reason")] public string Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邀请函模板类型
|
||||
/// </summary>
|
||||
[JsonProperty("templatetype")]
|
||||
public int TemplateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 10:申请中 20:申请通过 30: 黑名单用户 40:申请作废
|
||||
/// </summary>
|
||||
[JsonProperty("stats")]
|
||||
public int Stats { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客接受时间
|
||||
/// </summary>
|
||||
[JsonProperty("accepttime")]
|
||||
public DateTime AcceptTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[JsonProperty("bak")]
|
||||
public string Bak { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信头像
|
||||
/// </summary>
|
||||
[JsonProperty("wxImgUrl")]
|
||||
public string WxImgUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人脸地址
|
||||
/// </summary>
|
||||
[JsonProperty("faceUrl")]
|
||||
public string FaceUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客人员ID
|
||||
/// </summary>
|
||||
[JsonProperty("userId")]
|
||||
public System.Int32? UserId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("ID")]
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,145 +1,145 @@
|
||||
using BaseInfoClient.Response.Visitor;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using ServiceClient;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryVisitorByOpenidOrId
|
||||
{
|
||||
public static async Task<List<VisitorResponseItem>> QueryVisitorByOpenId(this BaseInfoHttpClient client
|
||||
, QueryMenJinVisitorRequest param, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/visitor/v1/Request/QueryByOpenId?OwnerId={param.OwnerId}&Data.OpenId={param.OpenId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<List<VisitorResponseItem>>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<VisitorResponseItem>();
|
||||
}
|
||||
}
|
||||
return new List<VisitorResponseItem>();
|
||||
}
|
||||
|
||||
public static async Task<VisitorResponseItem> QueryVisitorById(this BaseInfoHttpClient client
|
||||
, QueryMenJinVisitorRequest param, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/visitor/v1/Request/QueryById?OwnerId={param.OwnerId}&Data.Id={param.Id}&Data.Type={param.Type}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<VisitorResponseItem>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
}
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据人脸ID获取访客信息
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="throwException"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<VisitorResponseItem> QueryVisitorByFaceId(this BaseInfoHttpClient client
|
||||
, int ownerId,string faceId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/visitor/v1/Request/QueryByFaceId?OwnerId={ownerId}&Data.FaceId={faceId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<VisitorResponseItem>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
}
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据人脸ID获取访客信息
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="throwException"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<QueryDeviceByBuildResponse>> QueryVisitorProFace(this BaseInfoHttpClient client
|
||||
, int projectCode, string buildCode,string unit,int operaterID, int ownerID, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/doorway/v1/device/GetFacesClient?OperaterID={operaterID}&OwnerID={ownerID}&Data.ProjectCode={projectCode}&Data.BuildCode={buildCode}&Data.Unit={unit}&Data.UserType=0");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<List<QueryDeviceByBuildResponse>>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户设备信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<QueryDeviceByBuildResponse>();
|
||||
}
|
||||
}
|
||||
return new List<QueryDeviceByBuildResponse>();
|
||||
}
|
||||
}
|
||||
}
|
||||
using BaseInfoClient.Response.Visitor;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using ServiceClient;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryVisitorByOpenidOrId
|
||||
{
|
||||
public static async Task<List<VisitorResponseItem>> QueryVisitorByOpenId(this BaseInfoHttpClient client
|
||||
, QueryMenJinVisitorRequest param, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/visitor/v1/Request/QueryByOpenId?OwnerId={param.OwnerId}&Data.OpenId={param.OpenId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<List<VisitorResponseItem>>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<VisitorResponseItem>();
|
||||
}
|
||||
}
|
||||
return new List<VisitorResponseItem>();
|
||||
}
|
||||
|
||||
public static async Task<VisitorResponseItem> QueryVisitorById(this BaseInfoHttpClient client
|
||||
, QueryMenJinVisitorRequest param, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/visitor/v1/Request/QueryById?OwnerId={param.OwnerId}&Data.Id={param.Id}&Data.Type={param.Type}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<VisitorResponseItem>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
}
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据人脸ID获取访客信息
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="throwException"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<VisitorResponseItem> QueryVisitorByFaceId(this BaseInfoHttpClient client
|
||||
, int ownerId,string faceId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/visitor/v1/Request/QueryByFaceId?OwnerId={ownerId}&Data.FaceId={faceId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<VisitorResponseItem>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
}
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据人脸ID获取访客信息
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="throwException"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<QueryDeviceByBuildResponse>> QueryVisitorProFace(this BaseInfoHttpClient client
|
||||
, int projectCode, string buildCode,string unit,int operaterID, int ownerID, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/doorway/v1/device/GetFacesClient?OperaterID={operaterID}&OwnerID={ownerID}&Data.ProjectCode={projectCode}&Data.BuildCode={buildCode}&Data.Unit={unit}&Data.UserType=0");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<List<QueryDeviceByBuildResponse>>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户设备信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<QueryDeviceByBuildResponse>();
|
||||
}
|
||||
}
|
||||
return new List<QueryDeviceByBuildResponse>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Response.Visitor
|
||||
{
|
||||
public class VisitorResponseItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public DateTime ExpiryTime { get; set; }
|
||||
public DateTime EntryTime { get; set; }
|
||||
public string Unit { get; set; }
|
||||
public string BuildCode { get; set; }
|
||||
public int ProjectCode { get; set; }
|
||||
/// <summary>
|
||||
/// 10邀约 20申请
|
||||
/// </summary>
|
||||
public int Type { get; set; }
|
||||
public string Reason { get; set; }
|
||||
public string VisitorName { get; set; }
|
||||
/// <summary>
|
||||
/// 访客电话
|
||||
/// </summary>
|
||||
public string VisitorPhone { get; set; }
|
||||
public int CheckUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 审核人姓名
|
||||
/// </summary>
|
||||
public string CheckUserName { get; set; }
|
||||
public string Room { get; set; }
|
||||
/// <summary>
|
||||
/// 状态 10 审核中 20 已通过 30 已拒绝
|
||||
/// </summary>
|
||||
public int State { get; set; }
|
||||
}
|
||||
public class QueryMenJinVisitorRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string OpenId { get; set; }
|
||||
public DateTime InTime { get; set; }
|
||||
/// <summary>
|
||||
/// 10 申请 20 邀约
|
||||
/// </summary>
|
||||
public int Type { get; set; }
|
||||
public int OwnerId { get; set; }
|
||||
}
|
||||
|
||||
public class QueryDeviceByBuildResponse
|
||||
{
|
||||
public string Ip { get; set; }
|
||||
public string PassWord { get; set; }
|
||||
public string DeviceNo { get; set; }
|
||||
public int Port { get; set; }
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Response.Visitor
|
||||
{
|
||||
public class VisitorResponseItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public DateTime ExpiryTime { get; set; }
|
||||
public DateTime EntryTime { get; set; }
|
||||
public string Unit { get; set; }
|
||||
public string BuildCode { get; set; }
|
||||
public int ProjectCode { get; set; }
|
||||
/// <summary>
|
||||
/// 10邀约 20申请
|
||||
/// </summary>
|
||||
public int Type { get; set; }
|
||||
public string Reason { get; set; }
|
||||
public string VisitorName { get; set; }
|
||||
/// <summary>
|
||||
/// 访客电话
|
||||
/// </summary>
|
||||
public string VisitorPhone { get; set; }
|
||||
public int CheckUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 审核人姓名
|
||||
/// </summary>
|
||||
public string CheckUserName { get; set; }
|
||||
public string Room { get; set; }
|
||||
/// <summary>
|
||||
/// 状态 10 审核中 20 已通过 30 已拒绝
|
||||
/// </summary>
|
||||
public int State { get; set; }
|
||||
}
|
||||
public class QueryMenJinVisitorRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string OpenId { get; set; }
|
||||
public DateTime InTime { get; set; }
|
||||
/// <summary>
|
||||
/// 10 申请 20 邀约
|
||||
/// </summary>
|
||||
public int Type { get; set; }
|
||||
public int OwnerId { get; set; }
|
||||
}
|
||||
|
||||
public class QueryDeviceByBuildResponse
|
||||
{
|
||||
public string Ip { get; set; }
|
||||
public string PassWord { get; set; }
|
||||
public string DeviceNo { get; set; }
|
||||
public int Port { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BaseInfoClient.Response.Build
|
||||
{
|
||||
public class BuildItem
|
||||
{
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("buildCode")] public string BuildCode { get; set; } = "";
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
}
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BaseInfoClient.Response.Build
|
||||
{
|
||||
public class BuildItem
|
||||
{
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("buildCode")] public string BuildCode { get; set; } = "";
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -1,55 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Build;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Build
|
||||
{
|
||||
|
||||
|
||||
public class QueryAllBuildsByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("buildData")] public List<BuildItem> BuildItems { get; set; } = new List<BuildItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QuerAllyBuildsByOwnerIdExtension
|
||||
{
|
||||
public static async Task<List<BuildItem>> QueryAllBuildsByOwnerIdAsync(this BaseInfoHttpClient client, int ownerId,
|
||||
bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBaseProject?OwnerID={ownerId}&Data.IsGetBuild=true");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllBuildsByOwnerIdResponse>>().Data.BuildItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取楼宇", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取楼宇信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<BuildItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<BuildItem>();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Build;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Build
|
||||
{
|
||||
|
||||
|
||||
public class QueryAllBuildsByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("buildData")] public List<BuildItem> BuildItems { get; set; } = new List<BuildItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QuerAllyBuildsByOwnerIdExtension
|
||||
{
|
||||
public static async Task<List<BuildItem>> QueryAllBuildsByOwnerIdAsync(this BaseInfoHttpClient client, int ownerId,
|
||||
bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBaseProject?OwnerID={ownerId}&Data.IsGetBuild=true");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllBuildsByOwnerIdResponse>>().Data.BuildItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取楼宇", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取楼宇信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<BuildItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<BuildItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace MsgCenterClient
|
||||
{
|
||||
public class DataBodyAttribute : Attribute
|
||||
{
|
||||
public int Order { get; }
|
||||
|
||||
public DataBodyAttribute(int order)
|
||||
{
|
||||
Order = order;
|
||||
}
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace MsgCenterClient
|
||||
{
|
||||
public class DataBodyAttribute : Attribute
|
||||
{
|
||||
public int Order { get; }
|
||||
|
||||
public DataBodyAttribute(int order)
|
||||
{
|
||||
Order = order;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace MsgCenterClient
|
||||
{
|
||||
public static class IServiceCollectionExtension
|
||||
{
|
||||
public static void AddMsgCenterClient(this IServiceCollection service, string baseUrl)
|
||||
{
|
||||
MsgCenterHttpClient._BaseUrl = baseUrl;
|
||||
|
||||
service.AddSingleton<MsgCenterHttpClient>();
|
||||
}
|
||||
}
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace MsgCenterClient
|
||||
{
|
||||
public static class IServiceCollectionExtension
|
||||
{
|
||||
public static void AddMsgCenterClient(this IServiceCollection service, string baseUrl)
|
||||
{
|
||||
MsgCenterHttpClient._BaseUrl = baseUrl;
|
||||
|
||||
service.AddSingleton<MsgCenterHttpClient>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Hncore.Infrastructure\Hncore.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Hncore.Infrastructure\Hncore.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,79 +1,79 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Common;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using MsgCenterClient.WechatMpTplMsg;
|
||||
|
||||
namespace MsgCenterClient
|
||||
{
|
||||
public class MsgCenterHttpClient
|
||||
{
|
||||
private IHttpClientFactory _httpClientFactory;
|
||||
|
||||
internal static string _BaseUrl = "";
|
||||
|
||||
public string BaseUrl => _BaseUrl;
|
||||
|
||||
public MsgCenterHttpClient(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
private HttpClient CreateHttpClient()
|
||||
{
|
||||
return _httpClientFactory.CreateClient();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送微信公众号模板消息
|
||||
/// </summary>
|
||||
/// <param name="msgBase"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult> SendWechatMpTplMsg(MsgBase msgBase)
|
||||
{
|
||||
var body = msgBase.ToRequestObject();
|
||||
|
||||
try
|
||||
{
|
||||
var res = await CreateHttpClient()
|
||||
.PostAsJsonGetString(BaseUrl + "/api/msgcenter/v1/msg/SendMPTplMessage", body);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("发送微信公众号模板消息失败", e + "\n消息内容:\n" + body.ToJson(true));
|
||||
|
||||
return new ApiResult(ResultCode.C_UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送微信小程序模板消息
|
||||
/// </summary>
|
||||
/// <param name="msgBase"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult> SendMiniAppTplMsg(MiniAppMsgBase msgBase)
|
||||
{
|
||||
var body = msgBase.ToRequestObject();
|
||||
|
||||
try
|
||||
{
|
||||
var res = await CreateHttpClient()
|
||||
.PostAsJsonGetString(BaseUrl + "/api/msgcenter/v1/msg/SendMiniAppTplMessage", body);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("发送小程序模板消息失败", e + "\n消息内容:\n" + body.ToJson(true));
|
||||
|
||||
return new ApiResult(ResultCode.C_UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Common;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using MsgCenterClient.WechatMpTplMsg;
|
||||
|
||||
namespace MsgCenterClient
|
||||
{
|
||||
public class MsgCenterHttpClient
|
||||
{
|
||||
private IHttpClientFactory _httpClientFactory;
|
||||
|
||||
internal static string _BaseUrl = "";
|
||||
|
||||
public string BaseUrl => _BaseUrl;
|
||||
|
||||
public MsgCenterHttpClient(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
private HttpClient CreateHttpClient()
|
||||
{
|
||||
return _httpClientFactory.CreateClient();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送微信公众号模板消息
|
||||
/// </summary>
|
||||
/// <param name="msgBase"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult> SendWechatMpTplMsg(MsgBase msgBase)
|
||||
{
|
||||
var body = msgBase.ToRequestObject();
|
||||
|
||||
try
|
||||
{
|
||||
var res = await CreateHttpClient()
|
||||
.PostAsJsonGetString(BaseUrl + "/api/msgcenter/v1/msg/SendMPTplMessage", body);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("发送微信公众号模板消息失败", e + "\n消息内容:\n" + body.ToJson(true));
|
||||
|
||||
return new ApiResult(ResultCode.C_UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送微信小程序模板消息
|
||||
/// </summary>
|
||||
/// <param name="msgBase"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult> SendMiniAppTplMsg(MiniAppMsgBase msgBase)
|
||||
{
|
||||
var body = msgBase.ToRequestObject();
|
||||
|
||||
try
|
||||
{
|
||||
var res = await CreateHttpClient()
|
||||
.PostAsJsonGetString(BaseUrl + "/api/msgcenter/v1/msg/SendMiniAppTplMessage", body);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("发送小程序模板消息失败", e + "\n消息内容:\n" + body.ToJson(true));
|
||||
|
||||
return new ApiResult(ResultCode.C_UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,50 +1,50 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 访客审核通知
|
||||
/// 模板编号:ku4vArgTpMOvwBeKQpjj6iE1nhVJyHL9xeQUjkUv5sY
|
||||
/// 公众号模板库模板标题:认证成功通知
|
||||
/// </summary>
|
||||
public class FangKeShenHeMsg : MiniAppMsgBase
|
||||
{
|
||||
public FangKeShenHeMsg(int ownerId, string appId, string openId)
|
||||
: base("ku4vArgTpMOvwBeKQpjj6iE1nhVJyHL9xeQUjkUv5sY", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核结果
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem ShenHeJieGuo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 受访单位
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShouFangDanWei { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 事由
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShiYou { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客姓名
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem FangKeXingMing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
[DataBody(5)]
|
||||
public DataItem ShouJi { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[DataBody(6)]
|
||||
public DataItem BeiZhu { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 访客审核通知
|
||||
/// 模板编号:ku4vArgTpMOvwBeKQpjj6iE1nhVJyHL9xeQUjkUv5sY
|
||||
/// 公众号模板库模板标题:认证成功通知
|
||||
/// </summary>
|
||||
public class FangKeShenHeMsg : MiniAppMsgBase
|
||||
{
|
||||
public FangKeShenHeMsg(int ownerId, string appId, string openId)
|
||||
: base("ku4vArgTpMOvwBeKQpjj6iE1nhVJyHL9xeQUjkUv5sY", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核结果
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem ShenHeJieGuo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 受访单位
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShouFangDanWei { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 事由
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShiYou { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客姓名
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem FangKeXingMing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
[DataBody(5)]
|
||||
public DataItem ShouJi { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[DataBody(6)]
|
||||
public DataItem BeiZhu { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,102 +1,102 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
public class MiniAppMsgBase
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="templateId">模板Id</param>
|
||||
/// <param name="ownerId">物业Id</param>
|
||||
/// <param name="appId">公众号AppId</param>
|
||||
/// <param name="openId">用户OpenId</param>
|
||||
public MiniAppMsgBase(string templateId, int ownerId, string appId, string openId)
|
||||
{
|
||||
TemplateId = templateId;
|
||||
OwnerId = ownerId;
|
||||
AppId = appId;
|
||||
OpenId = openId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 模板Id
|
||||
/// </summary>
|
||||
public string TemplateId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 物业Id
|
||||
/// </summary>
|
||||
public int OwnerId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 公众号AppId
|
||||
/// </summary>
|
||||
public string AppId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户openId
|
||||
/// </summary>
|
||||
public string OpenId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 跳转的小程序页面
|
||||
/// </summary>
|
||||
public string Page { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表单id
|
||||
/// </summary>
|
||||
public string FormId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 强调的字,可以为空
|
||||
/// </summary>
|
||||
public string EmphasisKeyword { get; set; }
|
||||
|
||||
public object ToRequestObject()
|
||||
{
|
||||
SortedDictionary<int, DataItem> bodyDic = new SortedDictionary<int, DataItem>();
|
||||
|
||||
var type = GetType();
|
||||
var properties = type.GetProperties();
|
||||
|
||||
foreach (var property in properties)
|
||||
{
|
||||
var bodyAttr = property.GetCustomAttributes(typeof(DataBodyAttribute), false);
|
||||
|
||||
if (!bodyAttr.Any())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int order = ((DataBodyAttribute) bodyAttr[0]).Order;
|
||||
|
||||
DataItem value = property.GetValue(this, null) as DataItem;
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
value = new DataItem();
|
||||
}
|
||||
|
||||
bodyDic[order] = value;
|
||||
}
|
||||
|
||||
return new
|
||||
{
|
||||
key = TemplateId,
|
||||
OwnerId = OwnerId,
|
||||
From = AppId,
|
||||
To = OpenId,
|
||||
Content = new
|
||||
{
|
||||
page=this.Page,
|
||||
form_id=this.FormId,
|
||||
emphasis_keyword=this.EmphasisKeyword,
|
||||
items = bodyDic.Values.Select(t => new {value = t.Value, color = t.Color}).ToList()
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
public class MiniAppMsgBase
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="templateId">模板Id</param>
|
||||
/// <param name="ownerId">物业Id</param>
|
||||
/// <param name="appId">公众号AppId</param>
|
||||
/// <param name="openId">用户OpenId</param>
|
||||
public MiniAppMsgBase(string templateId, int ownerId, string appId, string openId)
|
||||
{
|
||||
TemplateId = templateId;
|
||||
OwnerId = ownerId;
|
||||
AppId = appId;
|
||||
OpenId = openId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 模板Id
|
||||
/// </summary>
|
||||
public string TemplateId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 物业Id
|
||||
/// </summary>
|
||||
public int OwnerId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 公众号AppId
|
||||
/// </summary>
|
||||
public string AppId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户openId
|
||||
/// </summary>
|
||||
public string OpenId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 跳转的小程序页面
|
||||
/// </summary>
|
||||
public string Page { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表单id
|
||||
/// </summary>
|
||||
public string FormId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 强调的字,可以为空
|
||||
/// </summary>
|
||||
public string EmphasisKeyword { get; set; }
|
||||
|
||||
public object ToRequestObject()
|
||||
{
|
||||
SortedDictionary<int, DataItem> bodyDic = new SortedDictionary<int, DataItem>();
|
||||
|
||||
var type = GetType();
|
||||
var properties = type.GetProperties();
|
||||
|
||||
foreach (var property in properties)
|
||||
{
|
||||
var bodyAttr = property.GetCustomAttributes(typeof(DataBodyAttribute), false);
|
||||
|
||||
if (!bodyAttr.Any())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int order = ((DataBodyAttribute) bodyAttr[0]).Order;
|
||||
|
||||
DataItem value = property.GetValue(this, null) as DataItem;
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
value = new DataItem();
|
||||
}
|
||||
|
||||
bodyDic[order] = value;
|
||||
}
|
||||
|
||||
return new
|
||||
{
|
||||
key = TemplateId,
|
||||
OwnerId = OwnerId,
|
||||
From = AppId,
|
||||
To = OpenId,
|
||||
Content = new
|
||||
{
|
||||
page=this.Page,
|
||||
form_id=this.FormId,
|
||||
emphasis_keyword=this.EmphasisKeyword,
|
||||
items = bodyDic.Values.Select(t => new {value = t.Value, color = t.Color}).ToList()
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,68 +1,68 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 虚拟资产冲抵成功通知
|
||||
/// 模板编号:OPENTM417732701
|
||||
/// </summary>
|
||||
public class AssetDeductSuccessMsg : MsgBase
|
||||
{
|
||||
public AssetDeductSuccessMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM417732701", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 账单应缴总金额
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前余额(账单金额冲抵后结存金额)
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem BalanceAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扣款时间(账单冲抵完成时间)
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem SuccessTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扣款方式(默认为:余额冲抵)
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem PayType { get; set; }=new DataItem(){Value = "余额冲抵"};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 虚拟资产冲抵失败通知
|
||||
/// 模板编号:OPENTM414769357
|
||||
/// </summary>
|
||||
public class AssetDeductFailMsg : MsgBase
|
||||
{
|
||||
public AssetDeductFailMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM414769357", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扣费时间(所有账单扣费失败时间)
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem FailTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扣费金额(所有冲抵失败账单的金额总和)
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账户余额(虚拟帐户中剩余金额)
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem BalanceAmount { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 虚拟资产冲抵成功通知
|
||||
/// 模板编号:OPENTM417732701
|
||||
/// </summary>
|
||||
public class AssetDeductSuccessMsg : MsgBase
|
||||
{
|
||||
public AssetDeductSuccessMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM417732701", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 账单应缴总金额
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前余额(账单金额冲抵后结存金额)
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem BalanceAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扣款时间(账单冲抵完成时间)
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem SuccessTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扣款方式(默认为:余额冲抵)
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem PayType { get; set; }=new DataItem(){Value = "余额冲抵"};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 虚拟资产冲抵失败通知
|
||||
/// 模板编号:OPENTM414769357
|
||||
/// </summary>
|
||||
public class AssetDeductFailMsg : MsgBase
|
||||
{
|
||||
public AssetDeductFailMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM414769357", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扣费时间(所有账单扣费失败时间)
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem FailTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扣费金额(所有冲抵失败账单的金额总和)
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账户余额(虚拟帐户中剩余金额)
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem BalanceAmount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 车辆审核不通过通知
|
||||
/// 模板编号:OPENTM408157154
|
||||
/// 公众号模板库模板标题:审核不过通知
|
||||
/// </summary>
|
||||
public class CheLiangShenHeShiBaiMsg: MsgBase
|
||||
{
|
||||
public CheLiangShenHeShiBaiMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM408157154", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem XingMing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShouJiHao { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 车辆审核不通过通知
|
||||
/// 模板编号:OPENTM408157154
|
||||
/// 公众号模板库模板标题:审核不过通知
|
||||
/// </summary>
|
||||
public class CheLiangShenHeShiBaiMsg: MsgBase
|
||||
{
|
||||
public CheLiangShenHeShiBaiMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM408157154", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem XingMing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShouJiHao { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 车辆审核申请提交成功通知
|
||||
/// 模板编号:OPENTM411517700
|
||||
/// 公众号模板库模板标题:申请提交成功通知
|
||||
/// </summary>
|
||||
public class CheLiangShenHeTiJiaoMsg: MsgBase
|
||||
{
|
||||
public CheLiangShenHeTiJiaoMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM411517700", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 服务类型
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem FuWuLeiXing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 提交时间
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem TiJiaoShiJian { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 车辆审核申请提交成功通知
|
||||
/// 模板编号:OPENTM411517700
|
||||
/// 公众号模板库模板标题:申请提交成功通知
|
||||
/// </summary>
|
||||
public class CheLiangShenHeTiJiaoMsg: MsgBase
|
||||
{
|
||||
public CheLiangShenHeTiJiaoMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM411517700", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 服务类型
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem FuWuLeiXing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 提交时间
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem TiJiaoShiJian { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,39 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 车辆审核通过通知
|
||||
/// 模板编号:OPENTM416664350
|
||||
/// 公众号模板库模板标题:审核通过提醒
|
||||
/// </summary>
|
||||
public class CheLiangShenHeTongGuoMsg: MsgBase
|
||||
{
|
||||
public CheLiangShenHeTongGuoMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM416664350", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem XingMing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShouJiHao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车牌号
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ChePaiHao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem ShenHeShiJian { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 车辆审核通过通知
|
||||
/// 模板编号:OPENTM416664350
|
||||
/// 公众号模板库模板标题:审核通过提醒
|
||||
/// </summary>
|
||||
public class CheLiangShenHeTongGuoMsg: MsgBase
|
||||
{
|
||||
public CheLiangShenHeTongGuoMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM416664350", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem XingMing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShouJiHao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车牌号
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ChePaiHao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem ShenHeShiJian { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,28 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
public class DataItem
|
||||
{
|
||||
public string Value { get; set; } = "";
|
||||
|
||||
//
|
||||
// 摘要:
|
||||
// 16进制颜色代码,如:#FF0000
|
||||
public string Color { get; set; } = "#173177";
|
||||
|
||||
public DataItem()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DataItem(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public DataItem(string value, string color)
|
||||
{
|
||||
Value = value;
|
||||
Color = color;
|
||||
}
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
public class DataItem
|
||||
{
|
||||
public string Value { get; set; } = "";
|
||||
|
||||
//
|
||||
// 摘要:
|
||||
// 16进制颜色代码,如:#FF0000
|
||||
public string Color { get; set; } = "#173177";
|
||||
|
||||
public DataItem()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DataItem(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public DataItem(string value, string color)
|
||||
{
|
||||
Value = value;
|
||||
Color = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
public class FangKeDengJiTongZhi : MsgBase
|
||||
{
|
||||
public FangKeDengJiTongZhi(int ownerId, string appId, string openId)
|
||||
: base("OPENTM417110808", ownerId, appId, openId)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem Name { get; set; }
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem Company { get; set; }
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem Reason { get; set; }
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem Time { get; set; }
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
public class FangKeDengJiTongZhi : MsgBase
|
||||
{
|
||||
public FangKeDengJiTongZhi(int ownerId, string appId, string openId)
|
||||
: base("OPENTM417110808", ownerId, appId, openId)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem Name { get; set; }
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem Company { get; set; }
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem Reason { get; set; }
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem Time { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 房屋认证成功通知
|
||||
/// 模板编号:OPENTM403179452
|
||||
/// 公众号模板库模板标题:认证成功通知
|
||||
/// </summary>
|
||||
public class FangWuRenZhengChengGongMsg : MsgBase
|
||||
{
|
||||
public FangWuRenZhengChengGongMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM403179452", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 认证类型
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem RenZhengLeiXing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核结果
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShenHeJieGuo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShenHeShiJian { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 房屋认证成功通知
|
||||
/// 模板编号:OPENTM403179452
|
||||
/// 公众号模板库模板标题:认证成功通知
|
||||
/// </summary>
|
||||
public class FangWuRenZhengChengGongMsg : MsgBase
|
||||
{
|
||||
public FangWuRenZhengChengGongMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM403179452", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 认证类型
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem RenZhengLeiXing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核结果
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShenHeJieGuo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShenHeShiJian { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,39 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 房屋认证失败通知
|
||||
/// 模板编号:OPENTM403179639
|
||||
/// 公众号模板库模板标题:认证失败通知
|
||||
/// </summary>
|
||||
public class FangWuRenZhengShiBaiMsg: MsgBase
|
||||
{
|
||||
public FangWuRenZhengShiBaiMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM403179639", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 认证类型
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem RenZhengLeiXing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核结果
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShenHeJieGuo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShenHeShiJian { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结果描述
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem JieGuoMiaoShu { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 房屋认证失败通知
|
||||
/// 模板编号:OPENTM403179639
|
||||
/// 公众号模板库模板标题:认证失败通知
|
||||
/// </summary>
|
||||
public class FangWuRenZhengShiBaiMsg: MsgBase
|
||||
{
|
||||
public FangWuRenZhengShiBaiMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM403179639", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 认证类型
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem RenZhengLeiXing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核结果
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShenHeJieGuo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShenHeShiJian { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结果描述
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem JieGuoMiaoShu { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 工单处理完结
|
||||
/// 模板编号:OPENTM201820050
|
||||
/// 公众号模板库模板标题:工单进度通知
|
||||
/// </summary>
|
||||
public class GongDanWanJieMsg: MsgBase
|
||||
{
|
||||
public GongDanWanJieMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM201820050", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem GongDanHao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单进度
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem GongDanJinDu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单处理人
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem GongDanChuLiRen { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 工单处理完结
|
||||
/// 模板编号:OPENTM201820050
|
||||
/// 公众号模板库模板标题:工单进度通知
|
||||
/// </summary>
|
||||
public class GongDanWanJieMsg: MsgBase
|
||||
{
|
||||
public GongDanWanJieMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM201820050", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem GongDanHao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单进度
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem GongDanJinDu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单处理人
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem GongDanChuLiRen { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 缴费成功通知
|
||||
/// 模板编号:OPENTM412117951
|
||||
/// 公众号模板库模板标题:缴费成功通知
|
||||
/// </summary>
|
||||
public class JiaoFeiChengGongMsg : MsgBase
|
||||
{
|
||||
public JiaoFeiChengGongMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM412117951", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缴费时间
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem JiaoFeiShiJian { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 缴费方式
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem JiaoFeiFangShi { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 缴费金额
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem JiaoFeiJinE { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 缴费成功通知
|
||||
/// 模板编号:OPENTM412117951
|
||||
/// 公众号模板库模板标题:缴费成功通知
|
||||
/// </summary>
|
||||
public class JiaoFeiChengGongMsg : MsgBase
|
||||
{
|
||||
public JiaoFeiChengGongMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM412117951", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缴费时间
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem JiaoFeiShiJian { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 缴费方式
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem JiaoFeiFangShi { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 缴费金额
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem JiaoFeiJinE { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 接单通知
|
||||
/// 模板编号:OPENTM201820050
|
||||
/// 公众号模板库模板标题:工单进度通知
|
||||
/// </summary>
|
||||
public class JieDanMsg: MsgBase
|
||||
{
|
||||
public JieDanMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM201820050", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem GongDanHao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单进度
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem GongDanJinDu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单处理人
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem GongDanChuLiRen { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 接单通知
|
||||
/// 模板编号:OPENTM201820050
|
||||
/// 公众号模板库模板标题:工单进度通知
|
||||
/// </summary>
|
||||
public class JieDanMsg: MsgBase
|
||||
{
|
||||
public JieDanMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM201820050", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem GongDanHao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单进度
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem GongDanJinDu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单处理人
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem GongDanChuLiRen { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 临时到访通知
|
||||
/// 模板编号:5NE7oojOE4jhUpv8bixYqWgfkqcOInVBTjb_lHWPrSw
|
||||
/// 公众号模板库模板标题:物业管理通知
|
||||
/// </summary>
|
||||
public class LinShiDaoFangMsg: MsgBase
|
||||
{
|
||||
public LinShiDaoFangMsg(int ownerId, string appId, string openId)
|
||||
: base("5NE7oojOE4jhUpv8bixYqWgfkqcOInVBTjb_lHWPrSw", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem BiaoTi { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布时间
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem FaBuShiJian { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem NeiRong { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 临时到访通知
|
||||
/// 模板编号:5NE7oojOE4jhUpv8bixYqWgfkqcOInVBTjb_lHWPrSw
|
||||
/// 公众号模板库模板标题:物业管理通知
|
||||
/// </summary>
|
||||
public class LinShiDaoFangMsg: MsgBase
|
||||
{
|
||||
public LinShiDaoFangMsg(int ownerId, string appId, string openId)
|
||||
: base("5NE7oojOE4jhUpv8bixYqWgfkqcOInVBTjb_lHWPrSw", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem BiaoTi { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布时间
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem FaBuShiJian { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem NeiRong { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 门禁钥匙授权通知
|
||||
/// 模板编号:OPENTM408634701
|
||||
/// 公众号模板库模板标题:授权成功通知
|
||||
/// </summary>
|
||||
public class MenJinYaoShiShouQuanMsg: MsgBase
|
||||
{
|
||||
public MenJinYaoShiShouQuanMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM408634701", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 授权人
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem ShouQunRen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 被授权人
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem BeiShouQunRen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 授权状态
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShouQuanZhuangTai { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 门禁钥匙授权通知
|
||||
/// 模板编号:OPENTM408634701
|
||||
/// 公众号模板库模板标题:授权成功通知
|
||||
/// </summary>
|
||||
public class MenJinYaoShiShouQuanMsg: MsgBase
|
||||
{
|
||||
public MenJinYaoShiShouQuanMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM408634701", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 授权人
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem ShouQunRen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 被授权人
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem BeiShouQunRen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 授权状态
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShouQuanZhuangTai { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,117 +1,117 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
public class MsgBase
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="templateId">模板Id</param>
|
||||
/// <param name="ownerId">物业Id</param>
|
||||
/// <param name="appId">公众号AppId</param>
|
||||
/// <param name="openId">用户OpenId</param>
|
||||
public MsgBase(string templateId, int ownerId, string appId, string openId)
|
||||
{
|
||||
TemplateId = templateId;
|
||||
OwnerId = ownerId;
|
||||
AppId = appId;
|
||||
OpenId = openId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 头部内容
|
||||
/// </summary>
|
||||
public DataItem Head { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 底部内容
|
||||
/// </summary>
|
||||
public DataItem Foot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板Id
|
||||
/// </summary>
|
||||
public string TemplateId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 物业Id
|
||||
/// </summary>
|
||||
public int OwnerId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 公众号AppId
|
||||
/// </summary>
|
||||
public string AppId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户openId
|
||||
/// </summary>
|
||||
public string OpenId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 跳转的Url
|
||||
/// </summary>
|
||||
public string Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 跳转的小程序的Appid,为空的话默认跳转h5指定的url
|
||||
/// </summary>
|
||||
public string MiniAppId { get; set; }
|
||||
|
||||
|
||||
public object ToRequestObject()
|
||||
{
|
||||
SortedDictionary<int, DataItem> bodyDic = new SortedDictionary<int, DataItem>();
|
||||
|
||||
var type = GetType();
|
||||
var properties = type.GetProperties();
|
||||
|
||||
foreach (var property in properties)
|
||||
{
|
||||
var bodyAttr = property.GetCustomAttributes(typeof(DataBodyAttribute), false);
|
||||
|
||||
if (!bodyAttr.Any())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int order = ((DataBodyAttribute) bodyAttr[0]).Order;
|
||||
|
||||
DataItem value = property.GetValue(this, null) as DataItem;
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
value = new DataItem();
|
||||
}
|
||||
|
||||
bodyDic[order] = value;
|
||||
}
|
||||
|
||||
return new
|
||||
{
|
||||
key = TemplateId,
|
||||
Content = new
|
||||
{
|
||||
Url,
|
||||
MiniAppId,
|
||||
first = new
|
||||
{
|
||||
value = Head?.Value,
|
||||
color = Head?.Color
|
||||
},
|
||||
remark = new
|
||||
{
|
||||
value = Foot?.Value,
|
||||
color = Foot?.Color
|
||||
},
|
||||
items = bodyDic.Values.Select(t => new {value = t.Value, color = t.Color}).ToList()
|
||||
},
|
||||
OwnerId = OwnerId,
|
||||
From = AppId,
|
||||
To = OpenId
|
||||
};
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
public class MsgBase
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="templateId">模板Id</param>
|
||||
/// <param name="ownerId">物业Id</param>
|
||||
/// <param name="appId">公众号AppId</param>
|
||||
/// <param name="openId">用户OpenId</param>
|
||||
public MsgBase(string templateId, int ownerId, string appId, string openId)
|
||||
{
|
||||
TemplateId = templateId;
|
||||
OwnerId = ownerId;
|
||||
AppId = appId;
|
||||
OpenId = openId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 头部内容
|
||||
/// </summary>
|
||||
public DataItem Head { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 底部内容
|
||||
/// </summary>
|
||||
public DataItem Foot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板Id
|
||||
/// </summary>
|
||||
public string TemplateId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 物业Id
|
||||
/// </summary>
|
||||
public int OwnerId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 公众号AppId
|
||||
/// </summary>
|
||||
public string AppId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户openId
|
||||
/// </summary>
|
||||
public string OpenId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 跳转的Url
|
||||
/// </summary>
|
||||
public string Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 跳转的小程序的Appid,为空的话默认跳转h5指定的url
|
||||
/// </summary>
|
||||
public string MiniAppId { get; set; }
|
||||
|
||||
|
||||
public object ToRequestObject()
|
||||
{
|
||||
SortedDictionary<int, DataItem> bodyDic = new SortedDictionary<int, DataItem>();
|
||||
|
||||
var type = GetType();
|
||||
var properties = type.GetProperties();
|
||||
|
||||
foreach (var property in properties)
|
||||
{
|
||||
var bodyAttr = property.GetCustomAttributes(typeof(DataBodyAttribute), false);
|
||||
|
||||
if (!bodyAttr.Any())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int order = ((DataBodyAttribute) bodyAttr[0]).Order;
|
||||
|
||||
DataItem value = property.GetValue(this, null) as DataItem;
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
value = new DataItem();
|
||||
}
|
||||
|
||||
bodyDic[order] = value;
|
||||
}
|
||||
|
||||
return new
|
||||
{
|
||||
key = TemplateId,
|
||||
Content = new
|
||||
{
|
||||
Url,
|
||||
MiniAppId,
|
||||
first = new
|
||||
{
|
||||
value = Head?.Value,
|
||||
color = Head?.Color
|
||||
},
|
||||
remark = new
|
||||
{
|
||||
value = Foot?.Value,
|
||||
color = Foot?.Color
|
||||
},
|
||||
items = bodyDic.Values.Select(t => new {value = t.Value, color = t.Color}).ToList()
|
||||
},
|
||||
OwnerId = OwnerId,
|
||||
From = AppId,
|
||||
To = OpenId
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 派工通知
|
||||
/// 模板编号:OPENTM201820050
|
||||
/// 公众号模板库模板标题:工单进度通知
|
||||
/// </summary>
|
||||
public class PaiGongMsg: MsgBase
|
||||
{
|
||||
public PaiGongMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM201820050", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem GongDanHao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单进度
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem GongDanJinDu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单处理人
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem GongDanChuLiRen { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 派工通知
|
||||
/// 模板编号:OPENTM201820050
|
||||
/// 公众号模板库模板标题:工单进度通知
|
||||
/// </summary>
|
||||
public class PaiGongMsg: MsgBase
|
||||
{
|
||||
public PaiGongMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM201820050", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem GongDanHao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单进度
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem GongDanJinDu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单处理人
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem GongDanChuLiRen { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 人脸钥匙认证成功通知
|
||||
/// 模板编号:OPENTM403179452
|
||||
/// 公众号模板库模板标题:认证成功通知
|
||||
/// </summary>
|
||||
public class RenLianRenZhengChengGongMsg: MsgBase
|
||||
{
|
||||
public RenLianRenZhengChengGongMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM403179452", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 认证类型
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem RenZhengLeiXing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核结果
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShenHeJieGuo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShenHeShiJian { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 人脸钥匙认证成功通知
|
||||
/// 模板编号:OPENTM403179452
|
||||
/// 公众号模板库模板标题:认证成功通知
|
||||
/// </summary>
|
||||
public class RenLianRenZhengChengGongMsg: MsgBase
|
||||
{
|
||||
public RenLianRenZhengChengGongMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM403179452", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 认证类型
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem RenZhengLeiXing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核结果
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShenHeJieGuo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShenHeShiJian { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,39 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 人脸钥匙认证失败通知
|
||||
/// 模板编号:OPENTM403179639
|
||||
/// 公众号模板库模板标题:认证失败通知
|
||||
/// </summary>
|
||||
public class RenLianRenZhengShiBaiMsg: MsgBase
|
||||
{
|
||||
public RenLianRenZhengShiBaiMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM403179639", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 认证类型
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem RenZhengLeiXing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核结果
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShenHeJieGuo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShenHeShiJian { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结果描述
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem JieGuoMiaoShu { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 人脸钥匙认证失败通知
|
||||
/// 模板编号:OPENTM403179639
|
||||
/// 公众号模板库模板标题:认证失败通知
|
||||
/// </summary>
|
||||
public class RenLianRenZhengShiBaiMsg: MsgBase
|
||||
{
|
||||
public RenLianRenZhengShiBaiMsg( int ownerId, string appId, string openId)
|
||||
: base("OPENTM403179639", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 认证类型
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem RenZhengLeiXing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核结果
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ShenHeJieGuo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem ShenHeShiJian { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结果描述
|
||||
/// </summary>
|
||||
[DataBody(4)]
|
||||
public DataItem JieGuoMiaoShu { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 催费通知(手动催缴)
|
||||
/// 模板编号:OPENTM411227201
|
||||
/// 公众号模板库模板标题:待付账单通知
|
||||
/// </summary>
|
||||
public class ShouDongCuiJiaoMsg : MsgBase
|
||||
{
|
||||
public ShouDongCuiJiaoMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM411227201", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 账单金额
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem ZhangDanJinE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账单日期
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ZhangDanRiQi { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 催费通知(手动催缴)
|
||||
/// 模板编号:OPENTM411227201
|
||||
/// 公众号模板库模板标题:待付账单通知
|
||||
/// </summary>
|
||||
public class ShouDongCuiJiaoMsg : MsgBase
|
||||
{
|
||||
public ShouDongCuiJiaoMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM411227201", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 账单金额
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem ZhangDanJinE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账单日期
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ZhangDanRiQi { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 邀请访客到访通知
|
||||
/// 模板编号:rKssp0BPmK-XmGXCbrh3f6e9NVpb75Zqzui8Hcx26dE
|
||||
/// 公众号模板库模板标题:来访通知
|
||||
/// </summary>
|
||||
public class YaoYueDaoFangMsg: MsgBase
|
||||
{
|
||||
public YaoYueDaoFangMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM408101810", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 访客名称
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem FangKeMingCheng { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客电话
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem FangKeDianHua { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来访时间
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem LaiFangShiJian { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 邀请访客到访通知
|
||||
/// 模板编号:rKssp0BPmK-XmGXCbrh3f6e9NVpb75Zqzui8Hcx26dE
|
||||
/// 公众号模板库模板标题:来访通知
|
||||
/// </summary>
|
||||
public class YaoYueDaoFangMsg: MsgBase
|
||||
{
|
||||
public YaoYueDaoFangMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM408101810", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 访客名称
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem FangKeMingCheng { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客电话
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem FangKeDianHua { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来访时间
|
||||
/// </summary>
|
||||
[DataBody(3)]
|
||||
public DataItem LaiFangShiJian { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 催费通知(自动催缴)
|
||||
/// 模板编号:OPENTM411227201
|
||||
/// 公众号模板库模板标题:待付账单通知
|
||||
/// </summary>
|
||||
public class ZiDongCuiJiaoMsg : MsgBase
|
||||
{
|
||||
public ZiDongCuiJiaoMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM411227201", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 账单金额
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem ZhangDanJinE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账单日期
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ZhangDanRiQi { get; set; }
|
||||
}
|
||||
namespace MsgCenterClient.WechatMpTplMsg
|
||||
{
|
||||
/// <summary>
|
||||
/// 催费通知(自动催缴)
|
||||
/// 模板编号:OPENTM411227201
|
||||
/// 公众号模板库模板标题:待付账单通知
|
||||
/// </summary>
|
||||
public class ZiDongCuiJiaoMsg : MsgBase
|
||||
{
|
||||
public ZiDongCuiJiaoMsg(int ownerId, string appId, string openId)
|
||||
: base("OPENTM411227201", ownerId, appId, openId)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 账单金额
|
||||
/// </summary>
|
||||
[DataBody(1)]
|
||||
public DataItem ZhangDanJinE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账单日期
|
||||
/// </summary>
|
||||
[DataBody(2)]
|
||||
public DataItem ZhangDanRiQi { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,26 @@
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Request;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class DaiFu
|
||||
{
|
||||
/// <summary>
|
||||
/// 单笔代付
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult> SingleDaiFu(this PaymentCenterHttpClient client, SingleDaiFuRequest request)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.PostAsJsonGetString($"{client.BaseUrl}api/paymentcenter/v1/ZhongXin/DaiFu/SingleDaiFu", request);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
}
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Request;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class DaiFu
|
||||
{
|
||||
/// <summary>
|
||||
/// 单笔代付
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult> SingleDaiFu(this PaymentCenterHttpClient client, SingleDaiFuRequest request)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.PostAsJsonGetString($"{client.BaseUrl}api/paymentcenter/v1/ZhongXin/DaiFu/SingleDaiFu", request);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
using Hncore.Payment.Request;
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class EPay
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建Pos机订单(推送订单到Pos机)
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult> CreatePosOrder(this PaymentCenterHttpClient client,
|
||||
EPayCreateOrderRequest request)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.PostAsJsonGetString($"{client.BaseUrl}api/paymentcenter/v1/EPay/PushOrder", request);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
}
|
||||
using Hncore.Payment.Request;
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class EPay
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建Pos机订单(推送订单到Pos机)
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult> CreatePosOrder(this PaymentCenterHttpClient client,
|
||||
EPayCreateOrderRequest request)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.PostAsJsonGetString($"{client.BaseUrl}api/paymentcenter/v1/EPay/PushOrder", request);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,26 @@
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Request;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 线下支付
|
||||
/// </summary>
|
||||
public static class OffLinePay
|
||||
{
|
||||
public static async Task<ApiResult> CreateOffLinePaySuccessedRecord(this PaymentCenterHttpClient client,
|
||||
CreateOffLinePaySuccessedRecordRequest request)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.PostAsJsonGetString(
|
||||
$"{client.BaseUrl}api/paymentcenter/v1/Payment/CreateOffLinePaySuccessedRecord",
|
||||
request);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
}
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Request;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 线下支付
|
||||
/// </summary>
|
||||
public static class OffLinePay
|
||||
{
|
||||
public static async Task<ApiResult> CreateOffLinePaySuccessedRecord(this PaymentCenterHttpClient client,
|
||||
CreateOffLinePaySuccessedRecordRequest request)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.PostAsJsonGetString(
|
||||
$"{client.BaseUrl}api/paymentcenter/v1/Payment/CreateOffLinePaySuccessedRecord",
|
||||
request);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,30 @@
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Request;
|
||||
using Hncore.Payment.Response;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class QrPay
|
||||
{
|
||||
/// <summary>
|
||||
/// 扫码支付下单
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult<QrPayCreateOrderResponse>> QrPayCreateOrder(
|
||||
this PaymentCenterHttpClient client,
|
||||
QrPayCreateOrderRequest request)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.PostAsJsonGetString($"{client.BaseUrl}api/paymentcenter/v1/QrPay/CreateOrder",
|
||||
request);
|
||||
|
||||
return res.FromJsonTo<ApiResult<QrPayCreateOrderResponse>>();
|
||||
}
|
||||
}
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Request;
|
||||
using Hncore.Payment.Response;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class QrPay
|
||||
{
|
||||
/// <summary>
|
||||
/// 扫码支付下单
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult<QrPayCreateOrderResponse>> QrPayCreateOrder(
|
||||
this PaymentCenterHttpClient client,
|
||||
QrPayCreateOrderRequest request)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.PostAsJsonGetString($"{client.BaseUrl}api/paymentcenter/v1/QrPay/CreateOrder",
|
||||
request);
|
||||
|
||||
return res.FromJsonTo<ApiResult<QrPayCreateOrderResponse>>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,26 @@
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Response;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class QueryOrderExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单查询
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="orderNo"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult<QueryOrderResponse>> QueryOrder(this PaymentCenterHttpClient client,
|
||||
string orderNo)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.GetStringAsync($"{client.BaseUrl}api/paymentcenter/v1/Payment/QueryOrder?orderNo={orderNo}");
|
||||
|
||||
return res.FromJsonTo<ApiResult<QueryOrderResponse>>();
|
||||
}
|
||||
}
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Response;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class QueryOrderExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单查询
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="orderNo"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult<QueryOrderResponse>> QueryOrder(this PaymentCenterHttpClient client,
|
||||
string orderNo)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.GetStringAsync($"{client.BaseUrl}api/paymentcenter/v1/Payment/QueryOrder?orderNo={orderNo}");
|
||||
|
||||
return res.FromJsonTo<ApiResult<QueryOrderResponse>>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,26 @@
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Request;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class SwipeCard
|
||||
{
|
||||
/// <summary>
|
||||
/// 刷卡支付下单
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult> SwipeCardCreateOrder(this PaymentCenterHttpClient client, SwipeCardCreateOrderRequest request)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.PostAsJsonGetString($"{client.BaseUrl}api/paymentcenter/v1/SwipeCard/CreateOrder", request);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
}
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Request;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class SwipeCard
|
||||
{
|
||||
/// <summary>
|
||||
/// 刷卡支付下单
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult> SwipeCardCreateOrder(this PaymentCenterHttpClient client, SwipeCardCreateOrderRequest request)
|
||||
{
|
||||
var res = await client.CreateHttpClient()
|
||||
.PostAsJsonGetString($"{client.BaseUrl}api/paymentcenter/v1/SwipeCard/CreateOrder", request);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,30 @@
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.Service;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Request;
|
||||
using Hncore.Payment.Response;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class WechatJsPay
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信小程序、公众号支付下单
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult> WechatJsPayCreateOrder(this ServiceHttpClient client,
|
||||
WechatJsPayCreateOrderRequest request)
|
||||
{
|
||||
var res = await client.CreateInternalClient()
|
||||
.PostAsJsonGetString($"{client.BaseUrl}/api/paymentcenter/v1/WechatJsPay/CreateOrder",
|
||||
request);
|
||||
//WechatJsPayCreateOrderResponse
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
}
|
||||
using System.Threading.Tasks;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.Service;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Payment.Request;
|
||||
using Hncore.Payment.Response;
|
||||
using PaymentCenterClient;
|
||||
|
||||
namespace Hncore.Payment.ClientExtension
|
||||
{
|
||||
public static class WechatJsPay
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信小程序、公众号支付下单
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ApiResult> WechatJsPayCreateOrder(this ServiceHttpClient client,
|
||||
WechatJsPayCreateOrderRequest request)
|
||||
{
|
||||
var res = await client.CreateInternalClient()
|
||||
.PostAsJsonGetString($"{client.BaseUrl}/api/paymentcenter/v1/WechatJsPay/CreateOrder",
|
||||
request);
|
||||
//WechatJsPayCreateOrderResponse
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,25 @@
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
public enum OrderType
|
||||
{
|
||||
/// <summary>
|
||||
/// 短信订单
|
||||
/// </summary>
|
||||
SmsOrder = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 产品订单
|
||||
/// </summary>
|
||||
Product = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 课程订单
|
||||
/// </summary>
|
||||
Course = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 课程套餐订单
|
||||
/// </summary>
|
||||
CoursePackage =3,
|
||||
}
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
public enum OrderType
|
||||
{
|
||||
/// <summary>
|
||||
/// 短信订单
|
||||
/// </summary>
|
||||
SmsOrder = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 产品订单
|
||||
/// </summary>
|
||||
Product = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 课程订单
|
||||
/// </summary>
|
||||
Course = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 课程套餐订单
|
||||
/// </summary>
|
||||
CoursePackage =3,
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
public enum PaymentChannel
|
||||
{
|
||||
/// <summary>
|
||||
/// 全付通
|
||||
/// </summary>
|
||||
QuanFuTong = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 汇旺财
|
||||
/// </summary>
|
||||
WeiFuTong = 10
|
||||
}
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
public enum PaymentChannel
|
||||
{
|
||||
/// <summary>
|
||||
/// 全付通
|
||||
/// </summary>
|
||||
QuanFuTong = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 汇旺财
|
||||
/// </summary>
|
||||
WeiFuTong = 10
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,30 @@
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 支付方式
|
||||
/// </summary>
|
||||
public enum PaymentMethod
|
||||
{
|
||||
None = 0,
|
||||
/// <summary>
|
||||
/// 微信付款码支付
|
||||
/// </summary>
|
||||
WechatSwipeCardPay = 1,
|
||||
/// <summary>
|
||||
/// 微信扫码支付
|
||||
/// </summary>
|
||||
WechatQrPay = 2,
|
||||
/// <summary>
|
||||
/// 支付宝付款码支付
|
||||
/// </summary>
|
||||
AliSwipeCardPay = 3,
|
||||
/// <summary>
|
||||
/// 支付宝扫码支付
|
||||
/// </summary>
|
||||
AliQrPay = 4,
|
||||
/// <summary>
|
||||
/// 微信公众号支付
|
||||
/// </summary>
|
||||
WechatJsAppPay = 5
|
||||
}
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 支付方式
|
||||
/// </summary>
|
||||
public enum PaymentMethod
|
||||
{
|
||||
None = 0,
|
||||
/// <summary>
|
||||
/// 微信付款码支付
|
||||
/// </summary>
|
||||
WechatSwipeCardPay = 1,
|
||||
/// <summary>
|
||||
/// 微信扫码支付
|
||||
/// </summary>
|
||||
WechatQrPay = 2,
|
||||
/// <summary>
|
||||
/// 支付宝付款码支付
|
||||
/// </summary>
|
||||
AliSwipeCardPay = 3,
|
||||
/// <summary>
|
||||
/// 支付宝扫码支付
|
||||
/// </summary>
|
||||
AliQrPay = 4,
|
||||
/// <summary>
|
||||
/// 微信公众号支付
|
||||
/// </summary>
|
||||
WechatJsAppPay = 5
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,35 @@
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
public enum PaymentStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 未支付
|
||||
/// </summary>
|
||||
NotPay = 10,
|
||||
|
||||
/// <summary>
|
||||
/// 已支付
|
||||
/// </summary>
|
||||
OkPay = 20,
|
||||
|
||||
/// <summary>
|
||||
/// 过期
|
||||
/// </summary>
|
||||
Expire = 30,
|
||||
|
||||
/// <summary>
|
||||
/// 支付失败
|
||||
/// </summary>
|
||||
Fail = 40,
|
||||
|
||||
/// <summary>
|
||||
/// 支付成功,回调失败
|
||||
/// </summary>
|
||||
CallbackFail = 50,
|
||||
|
||||
/// <summary>
|
||||
/// 支付中
|
||||
/// </summary>
|
||||
Paying = 60
|
||||
}
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
public enum PaymentStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 未支付
|
||||
/// </summary>
|
||||
NotPay = 10,
|
||||
|
||||
/// <summary>
|
||||
/// 已支付
|
||||
/// </summary>
|
||||
OkPay = 20,
|
||||
|
||||
/// <summary>
|
||||
/// 过期
|
||||
/// </summary>
|
||||
Expire = 30,
|
||||
|
||||
/// <summary>
|
||||
/// 支付失败
|
||||
/// </summary>
|
||||
Fail = 40,
|
||||
|
||||
/// <summary>
|
||||
/// 支付成功,回调失败
|
||||
/// </summary>
|
||||
CallbackFail = 50,
|
||||
|
||||
/// <summary>
|
||||
/// 支付中
|
||||
/// </summary>
|
||||
Paying = 60
|
||||
}
|
||||
}
|
||||
@@ -1,72 +1,72 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
public enum PaymentType
|
||||
{
|
||||
/// <summary>
|
||||
/// 线下支付-现金
|
||||
/// </summary>
|
||||
[Description("线下支付-现金")] OfflinePayCash = 10,
|
||||
|
||||
/// <summary>
|
||||
/// 线下支付-支票
|
||||
/// </summary>
|
||||
[Description("线下支付-支票")] OfflinePayCheck = 20,
|
||||
|
||||
/// <summary>
|
||||
/// 线下支付-银行转账
|
||||
/// </summary>
|
||||
[Description("线下支付-银行转账")] OfflinePayBank = 30,
|
||||
|
||||
/// <summary>
|
||||
/// 线下支付-pos机刷卡
|
||||
/// </summary>
|
||||
[Description("线下支付-pos机刷卡")] OfflinePayPOS = 40,
|
||||
|
||||
/// <summary>
|
||||
/// 线下支付-支付宝直接转账
|
||||
/// </summary>
|
||||
[Description("线下支付-支付宝直接转账")] OfflinePayAlipay = 50,
|
||||
|
||||
/// <summary>
|
||||
/// 线下支付-微信直接转账
|
||||
/// </summary>
|
||||
[Description("线下支付-微信直接转账")] OfflinePayWechat = 60,
|
||||
|
||||
/// <summary>
|
||||
/// 线上支付-微信支付
|
||||
/// </summary>
|
||||
[Description("线上支付-微信支付")] OnlinePayWechart = 70,
|
||||
|
||||
/// <summary>
|
||||
/// 线上支付-POS机储蓄卡刷卡
|
||||
/// </summary>
|
||||
[Description("线上支付-POS机储蓄卡刷卡")] OnlinePosDeposit = 80,
|
||||
|
||||
/// <summary>
|
||||
/// 线上支付-POS机信用卡刷卡
|
||||
/// </summary>
|
||||
[Description("线上支付-POS机信用卡刷卡")] OnlinePosCredit = 90,
|
||||
|
||||
/// <summary>
|
||||
/// 线上支付-支付宝
|
||||
/// </summary>
|
||||
[Description("线上支付-支付宝")] OnlineAlipay = 100,
|
||||
|
||||
/// <summary>
|
||||
/// 停车劵免费
|
||||
/// </summary>
|
||||
[Description("停车劵免费")] ParkTicketFree = 110,
|
||||
|
||||
/// <summary>
|
||||
/// 余额冲抵
|
||||
/// </summary>
|
||||
[Description("余额冲抵")] BalanceOffset =120,
|
||||
|
||||
/// <summary>
|
||||
/// 其他支付方式
|
||||
/// </summary>
|
||||
[Description("其他支付方式")] Other = 250
|
||||
}
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
public enum PaymentType
|
||||
{
|
||||
/// <summary>
|
||||
/// 线下支付-现金
|
||||
/// </summary>
|
||||
[Description("线下支付-现金")] OfflinePayCash = 10,
|
||||
|
||||
/// <summary>
|
||||
/// 线下支付-支票
|
||||
/// </summary>
|
||||
[Description("线下支付-支票")] OfflinePayCheck = 20,
|
||||
|
||||
/// <summary>
|
||||
/// 线下支付-银行转账
|
||||
/// </summary>
|
||||
[Description("线下支付-银行转账")] OfflinePayBank = 30,
|
||||
|
||||
/// <summary>
|
||||
/// 线下支付-pos机刷卡
|
||||
/// </summary>
|
||||
[Description("线下支付-pos机刷卡")] OfflinePayPOS = 40,
|
||||
|
||||
/// <summary>
|
||||
/// 线下支付-支付宝直接转账
|
||||
/// </summary>
|
||||
[Description("线下支付-支付宝直接转账")] OfflinePayAlipay = 50,
|
||||
|
||||
/// <summary>
|
||||
/// 线下支付-微信直接转账
|
||||
/// </summary>
|
||||
[Description("线下支付-微信直接转账")] OfflinePayWechat = 60,
|
||||
|
||||
/// <summary>
|
||||
/// 线上支付-微信支付
|
||||
/// </summary>
|
||||
[Description("线上支付-微信支付")] OnlinePayWechart = 70,
|
||||
|
||||
/// <summary>
|
||||
/// 线上支付-POS机储蓄卡刷卡
|
||||
/// </summary>
|
||||
[Description("线上支付-POS机储蓄卡刷卡")] OnlinePosDeposit = 80,
|
||||
|
||||
/// <summary>
|
||||
/// 线上支付-POS机信用卡刷卡
|
||||
/// </summary>
|
||||
[Description("线上支付-POS机信用卡刷卡")] OnlinePosCredit = 90,
|
||||
|
||||
/// <summary>
|
||||
/// 线上支付-支付宝
|
||||
/// </summary>
|
||||
[Description("线上支付-支付宝")] OnlineAlipay = 100,
|
||||
|
||||
/// <summary>
|
||||
/// 停车劵免费
|
||||
/// </summary>
|
||||
[Description("停车劵免费")] ParkTicketFree = 110,
|
||||
|
||||
/// <summary>
|
||||
/// 余额冲抵
|
||||
/// </summary>
|
||||
[Description("余额冲抵")] BalanceOffset =120,
|
||||
|
||||
/// <summary>
|
||||
/// 其他支付方式
|
||||
/// </summary>
|
||||
[Description("其他支付方式")] Other = 250
|
||||
}
|
||||
}
|
||||
@@ -1,156 +1,156 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
public enum ResultCode
|
||||
{
|
||||
/// <summary>
|
||||
/// 未知错误
|
||||
/// </summary>
|
||||
[Description("服务正在更新中,请稍后再试")] C_UNKNOWN_ERROR = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 成功
|
||||
/// </summary>
|
||||
[Description("成功")] C_SUCCESS = 10000,
|
||||
|
||||
/// <summary>
|
||||
/// 验证码
|
||||
/// </summary>
|
||||
[Description("验证码错误")] C_VERIFY_CODE_ERROR = 10001,
|
||||
|
||||
/// <summary>
|
||||
/// 参数
|
||||
/// </summary>
|
||||
[Description("服务正在更新中,请稍后再试")] C_PARAM_ERROR = 10002,
|
||||
|
||||
/// <summary>
|
||||
/// 登录名
|
||||
/// </summary>
|
||||
[Description("登录名错误")] C_LONGIN_NAME_ERROR = 10003,
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
[Description("密码错误")] C_PASSWORD_ERROR = 10004,
|
||||
|
||||
/// <summary>
|
||||
/// 无效操作
|
||||
/// </summary>
|
||||
[Description("非法操作")] C_INVALID_ERROR = 10005,
|
||||
|
||||
/// <summary>
|
||||
/// 文件
|
||||
/// </summary>
|
||||
[Description("文件错误")] C_FILE_ERROR = 10006,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在错误
|
||||
/// </summary>
|
||||
[Description("资源已存在错误")] C_ALREADY_EXISTS_ERROR = 10007,
|
||||
|
||||
/// <summary>
|
||||
/// 资源无法访问:不是资源的拥有者
|
||||
/// </summary>
|
||||
[Description("不是资源的拥有者,资源无法访问")] C_OWNER_ERROR = 10008,
|
||||
|
||||
/// <summary>
|
||||
/// 资源不存在
|
||||
/// </summary>
|
||||
[Description("资源不存在")] C_NOT_EXISTS_ERROR = 10009,
|
||||
|
||||
/// <summary>
|
||||
/// 新建角色出错
|
||||
/// </summary>
|
||||
[Description("创建角色出错")] C_ROLE_CREATE_ERROR = 10010,
|
||||
|
||||
/// <summary>
|
||||
/// 新建权限出错
|
||||
/// </summary>
|
||||
[Description("新建权限错误")] C_PERMISSION_CREATE_ERROR = 10011,
|
||||
|
||||
/// <summary>
|
||||
/// 绑定角色和权限出错
|
||||
/// </summary>
|
||||
[Description("绑定角色和权限出错")] C_ROLE_PERMISSION_CREATE_ERROR = 10012,
|
||||
|
||||
/// <summary>
|
||||
/// 服务器繁忙,请稍后再试!
|
||||
/// </summary>
|
||||
[Description("服务器繁忙")] C_Server_Is_Busy = 10013,
|
||||
|
||||
/// <summary>
|
||||
/// 访问被禁止
|
||||
/// </summary>
|
||||
[Description("禁止访问")] C_Access_Forbidden = 10014,
|
||||
|
||||
/// <summary>
|
||||
/// 非法操作
|
||||
/// </summary>
|
||||
[Description("非法操作")] C_Illegal_Operation = 10015,
|
||||
|
||||
/// <summary>
|
||||
/// 无效的openID
|
||||
/// </summary>
|
||||
[Description("OpenID无效")] C_OPENID_ERROR = 10016,
|
||||
|
||||
/// <summary>
|
||||
/// 返回错误,但无需理会
|
||||
/// </summary>
|
||||
[Description("可忽略的错误")] C_IGNORE_ERROR = 10017,
|
||||
|
||||
/// <summary>
|
||||
/// 用户信息错误
|
||||
/// </summary>
|
||||
[Description("用户信息错误")] C_USERINFO_ERROR = 10018,
|
||||
|
||||
/// <summary>
|
||||
/// 用户需要认证
|
||||
/// </summary>
|
||||
[Description("用户需要认证")] C_USER_SELECT_ERROR = 10019,
|
||||
|
||||
/// <summary>
|
||||
/// 过期
|
||||
/// </summary>
|
||||
[Description("超时错误")] C_TIMEOUT_ERROR = 10020,
|
||||
|
||||
/// <summary>
|
||||
/// 手机和验证码不匹配
|
||||
/// </summary>
|
||||
[Description("手机和验证码不匹配")] C_PHONE_CODE_ERROR = 10021,
|
||||
|
||||
/// <summary>
|
||||
/// 微信没有选择楼
|
||||
/// </summary>
|
||||
[Description("微信没有选择楼")] C_WX_UNIT_UNSELECT_ERROR = 10022,
|
||||
|
||||
/// <summary>
|
||||
/// 黑名单错误
|
||||
/// </summary>
|
||||
[Description("黑名单错误")] C_BLACKLIST_ERROR = 10023,
|
||||
|
||||
/// <summary>
|
||||
/// 支付失败
|
||||
/// </summary>
|
||||
[Description("支付失败")] C_PAY_FAIL = 10024,
|
||||
|
||||
/// <summary>
|
||||
/// 重定向
|
||||
/// </summary>
|
||||
[Description("重定向")] C_REDIRECT_URL = 100302,
|
||||
|
||||
[Description("用户重定向")] C_USER_REDIRECT_URL = 900302,
|
||||
|
||||
|
||||
[Description("人脸已经存在")] C_FACEKEY_EXIST_ERROR = 900303,
|
||||
|
||||
[Description("人脸角度不正确")] C_FACE_ANGLE_ERROR = 900304,
|
||||
|
||||
[Description("退款失败")] C_PAY_Refund = 900305,
|
||||
|
||||
/// <summary>
|
||||
/// 用户支付中
|
||||
/// </summary>
|
||||
[Description("用户支付中")] C_USERPAYING = 900306
|
||||
}
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Hncore.Payment.Enum
|
||||
{
|
||||
public enum ResultCode
|
||||
{
|
||||
/// <summary>
|
||||
/// 未知错误
|
||||
/// </summary>
|
||||
[Description("服务正在更新中,请稍后再试")] C_UNKNOWN_ERROR = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 成功
|
||||
/// </summary>
|
||||
[Description("成功")] C_SUCCESS = 10000,
|
||||
|
||||
/// <summary>
|
||||
/// 验证码
|
||||
/// </summary>
|
||||
[Description("验证码错误")] C_VERIFY_CODE_ERROR = 10001,
|
||||
|
||||
/// <summary>
|
||||
/// 参数
|
||||
/// </summary>
|
||||
[Description("服务正在更新中,请稍后再试")] C_PARAM_ERROR = 10002,
|
||||
|
||||
/// <summary>
|
||||
/// 登录名
|
||||
/// </summary>
|
||||
[Description("登录名错误")] C_LONGIN_NAME_ERROR = 10003,
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
[Description("密码错误")] C_PASSWORD_ERROR = 10004,
|
||||
|
||||
/// <summary>
|
||||
/// 无效操作
|
||||
/// </summary>
|
||||
[Description("非法操作")] C_INVALID_ERROR = 10005,
|
||||
|
||||
/// <summary>
|
||||
/// 文件
|
||||
/// </summary>
|
||||
[Description("文件错误")] C_FILE_ERROR = 10006,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在错误
|
||||
/// </summary>
|
||||
[Description("资源已存在错误")] C_ALREADY_EXISTS_ERROR = 10007,
|
||||
|
||||
/// <summary>
|
||||
/// 资源无法访问:不是资源的拥有者
|
||||
/// </summary>
|
||||
[Description("不是资源的拥有者,资源无法访问")] C_OWNER_ERROR = 10008,
|
||||
|
||||
/// <summary>
|
||||
/// 资源不存在
|
||||
/// </summary>
|
||||
[Description("资源不存在")] C_NOT_EXISTS_ERROR = 10009,
|
||||
|
||||
/// <summary>
|
||||
/// 新建角色出错
|
||||
/// </summary>
|
||||
[Description("创建角色出错")] C_ROLE_CREATE_ERROR = 10010,
|
||||
|
||||
/// <summary>
|
||||
/// 新建权限出错
|
||||
/// </summary>
|
||||
[Description("新建权限错误")] C_PERMISSION_CREATE_ERROR = 10011,
|
||||
|
||||
/// <summary>
|
||||
/// 绑定角色和权限出错
|
||||
/// </summary>
|
||||
[Description("绑定角色和权限出错")] C_ROLE_PERMISSION_CREATE_ERROR = 10012,
|
||||
|
||||
/// <summary>
|
||||
/// 服务器繁忙,请稍后再试!
|
||||
/// </summary>
|
||||
[Description("服务器繁忙")] C_Server_Is_Busy = 10013,
|
||||
|
||||
/// <summary>
|
||||
/// 访问被禁止
|
||||
/// </summary>
|
||||
[Description("禁止访问")] C_Access_Forbidden = 10014,
|
||||
|
||||
/// <summary>
|
||||
/// 非法操作
|
||||
/// </summary>
|
||||
[Description("非法操作")] C_Illegal_Operation = 10015,
|
||||
|
||||
/// <summary>
|
||||
/// 无效的openID
|
||||
/// </summary>
|
||||
[Description("OpenID无效")] C_OPENID_ERROR = 10016,
|
||||
|
||||
/// <summary>
|
||||
/// 返回错误,但无需理会
|
||||
/// </summary>
|
||||
[Description("可忽略的错误")] C_IGNORE_ERROR = 10017,
|
||||
|
||||
/// <summary>
|
||||
/// 用户信息错误
|
||||
/// </summary>
|
||||
[Description("用户信息错误")] C_USERINFO_ERROR = 10018,
|
||||
|
||||
/// <summary>
|
||||
/// 用户需要认证
|
||||
/// </summary>
|
||||
[Description("用户需要认证")] C_USER_SELECT_ERROR = 10019,
|
||||
|
||||
/// <summary>
|
||||
/// 过期
|
||||
/// </summary>
|
||||
[Description("超时错误")] C_TIMEOUT_ERROR = 10020,
|
||||
|
||||
/// <summary>
|
||||
/// 手机和验证码不匹配
|
||||
/// </summary>
|
||||
[Description("手机和验证码不匹配")] C_PHONE_CODE_ERROR = 10021,
|
||||
|
||||
/// <summary>
|
||||
/// 微信没有选择楼
|
||||
/// </summary>
|
||||
[Description("微信没有选择楼")] C_WX_UNIT_UNSELECT_ERROR = 10022,
|
||||
|
||||
/// <summary>
|
||||
/// 黑名单错误
|
||||
/// </summary>
|
||||
[Description("黑名单错误")] C_BLACKLIST_ERROR = 10023,
|
||||
|
||||
/// <summary>
|
||||
/// 支付失败
|
||||
/// </summary>
|
||||
[Description("支付失败")] C_PAY_FAIL = 10024,
|
||||
|
||||
/// <summary>
|
||||
/// 重定向
|
||||
/// </summary>
|
||||
[Description("重定向")] C_REDIRECT_URL = 100302,
|
||||
|
||||
[Description("用户重定向")] C_USER_REDIRECT_URL = 900302,
|
||||
|
||||
|
||||
[Description("人脸已经存在")] C_FACEKEY_EXIST_ERROR = 900303,
|
||||
|
||||
[Description("人脸角度不正确")] C_FACE_ANGLE_ERROR = 900304,
|
||||
|
||||
[Description("退款失败")] C_PAY_Refund = 900305,
|
||||
|
||||
/// <summary>
|
||||
/// 用户支付中
|
||||
/// </summary>
|
||||
[Description("用户支付中")] C_USERPAYING = 900306
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace PaymentCenterClient
|
||||
{
|
||||
public static class IServiceCollectionExtension
|
||||
{
|
||||
public static void AddPaymentCenterClient(this IServiceCollection service, string baseUrl = "")
|
||||
{
|
||||
if (!baseUrl.Has())
|
||||
{
|
||||
baseUrl = "http://paymentcenter/";
|
||||
}
|
||||
|
||||
PaymentCenterHttpClient._BaseUrl = baseUrl;
|
||||
|
||||
service.AddHttpClient();
|
||||
service.AddSingleton<PaymentCenterHttpClient>();
|
||||
}
|
||||
}
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace PaymentCenterClient
|
||||
{
|
||||
public static class IServiceCollectionExtension
|
||||
{
|
||||
public static void AddPaymentCenterClient(this IServiceCollection service, string baseUrl = "")
|
||||
{
|
||||
if (!baseUrl.Has())
|
||||
{
|
||||
baseUrl = "http://paymentcenter/";
|
||||
}
|
||||
|
||||
PaymentCenterHttpClient._BaseUrl = baseUrl;
|
||||
|
||||
service.AddHttpClient();
|
||||
service.AddSingleton<PaymentCenterHttpClient>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Hncore.Infrastructure\Hncore.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
</Project>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Hncore.Infrastructure\Hncore.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
using System.Net.Http;
|
||||
|
||||
namespace PaymentCenterClient
|
||||
{
|
||||
public class PaymentCenterHttpClient
|
||||
{
|
||||
private IHttpClientFactory _httpClientFactory;
|
||||
|
||||
internal static string _BaseUrl = "";
|
||||
|
||||
public PaymentCenterHttpClient(){}
|
||||
|
||||
public PaymentCenterHttpClient(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
public string BaseUrl => _BaseUrl;
|
||||
|
||||
public HttpClient CreateHttpClient()
|
||||
{
|
||||
return _httpClientFactory.CreateClient("PaymentCenterClient");
|
||||
}
|
||||
}
|
||||
using System.Net.Http;
|
||||
|
||||
namespace PaymentCenterClient
|
||||
{
|
||||
public class PaymentCenterHttpClient
|
||||
{
|
||||
private IHttpClientFactory _httpClientFactory;
|
||||
|
||||
internal static string _BaseUrl = "";
|
||||
|
||||
public PaymentCenterHttpClient(){}
|
||||
|
||||
public PaymentCenterHttpClient(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
public string BaseUrl => _BaseUrl;
|
||||
|
||||
public HttpClient CreateHttpClient()
|
||||
{
|
||||
return _httpClientFactory.CreateClient("PaymentCenterClient");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +1,58 @@
|
||||
using System.Collections.Generic;
|
||||
using Hncore.Payment.Enum;
|
||||
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
public class CreateOffLinePaySuccessedRecordRequest: PaymentRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 总金额,单位:分
|
||||
/// </summary>
|
||||
public int TotalFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品描述
|
||||
/// </summary>
|
||||
public string Body { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付类型
|
||||
/// </summary>
|
||||
public PaymentType PaymentType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付方式
|
||||
/// </summary>
|
||||
public PaymentMethod PaymentMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务订单号
|
||||
/// </summary>
|
||||
public string OrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单类型
|
||||
/// </summary>
|
||||
public OrderType OrderType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否来自POS机
|
||||
/// </summary>
|
||||
public bool FromPos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回调地址
|
||||
/// </summary>
|
||||
public string CallbackUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务方附加信息,回调时原样返回
|
||||
/// </summary>
|
||||
public string Attach { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付成功后要发送的mqtt消息
|
||||
/// </summary>
|
||||
public List<MqttMessage> MqttMessages { get; set; } = new List<MqttMessage>();
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using Hncore.Payment.Enum;
|
||||
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
public class CreateOffLinePaySuccessedRecordRequest: PaymentRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 总金额,单位:分
|
||||
/// </summary>
|
||||
public int TotalFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品描述
|
||||
/// </summary>
|
||||
public string Body { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付类型
|
||||
/// </summary>
|
||||
public PaymentType PaymentType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付方式
|
||||
/// </summary>
|
||||
public PaymentMethod PaymentMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务订单号
|
||||
/// </summary>
|
||||
public string OrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单类型
|
||||
/// </summary>
|
||||
public OrderType OrderType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否来自POS机
|
||||
/// </summary>
|
||||
public bool FromPos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回调地址
|
||||
/// </summary>
|
||||
public string CallbackUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务方附加信息,回调时原样返回
|
||||
/// </summary>
|
||||
public string Attach { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付成功后要发送的mqtt消息
|
||||
/// </summary>
|
||||
public List<MqttMessage> MqttMessages { get; set; } = new List<MqttMessage>();
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,37 @@
|
||||
using Hncore.Payment.Enum;
|
||||
using System.Collections.Generic;
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
public class CreateOrderRequestBase: PaymentRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 业务方附加信息,回调时原样返回
|
||||
/// </summary>
|
||||
public string Attach { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总金额,单位:分
|
||||
/// </summary>
|
||||
public int TotalFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付类型
|
||||
/// </summary>
|
||||
public PaymentType PaymentType { get; set; } = PaymentType.OnlinePayWechart;
|
||||
|
||||
/// <summary>
|
||||
/// 回调地址
|
||||
/// </summary>
|
||||
public string CallbackUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品描述
|
||||
/// </summary>
|
||||
public string Body { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务订单号
|
||||
/// </summary>
|
||||
public string OrderId { get; set; }
|
||||
}
|
||||
using Hncore.Payment.Enum;
|
||||
using System.Collections.Generic;
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
public class CreateOrderRequestBase: PaymentRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 业务方附加信息,回调时原样返回
|
||||
/// </summary>
|
||||
public string Attach { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总金额,单位:分
|
||||
/// </summary>
|
||||
public int TotalFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付类型
|
||||
/// </summary>
|
||||
public PaymentType PaymentType { get; set; } = PaymentType.OnlinePayWechart;
|
||||
|
||||
/// <summary>
|
||||
/// 回调地址
|
||||
/// </summary>
|
||||
public string CallbackUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品描述
|
||||
/// </summary>
|
||||
public string Body { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务订单号
|
||||
/// </summary>
|
||||
public string OrderId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// POS机推送订单请求
|
||||
/// </summary>
|
||||
public class EPayCreateOrderRequest : CreateOrderRequestBase
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// POS机推送订单请求
|
||||
/// </summary>
|
||||
public class EPayCreateOrderRequest : CreateOrderRequestBase
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
public class MqttMessage
|
||||
{
|
||||
public string Topic { get; set; }
|
||||
|
||||
public string Payload { get; set; }
|
||||
}
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
public class MqttMessage
|
||||
{
|
||||
public string Topic { get; set; }
|
||||
|
||||
public string Payload { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
using Hncore.Payment.Enum;
|
||||
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
public class PaymentRequestBase
|
||||
{
|
||||
public int TenantId { get; set; }
|
||||
|
||||
public int StoreId { get; set; } = 0;
|
||||
|
||||
}
|
||||
using Hncore.Payment.Enum;
|
||||
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
public class PaymentRequestBase
|
||||
{
|
||||
public int TenantId { get; set; }
|
||||
|
||||
public int StoreId { get; set; } = 0;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,28 @@
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// 扫码支付请求
|
||||
/// </summary>
|
||||
public class QrPayCreateOrderRequest: CreateOrderRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 目标平台,微信、支付宝
|
||||
/// </summary>
|
||||
public TargetPlatform TargetPlatform { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 目标平台,微信、支付宝
|
||||
/// </summary>
|
||||
public enum TargetPlatform
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信
|
||||
/// </summary>
|
||||
Wechat=1,
|
||||
/// <summary>
|
||||
/// 支付宝
|
||||
/// </summary>
|
||||
Alipay=2
|
||||
}
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// 扫码支付请求
|
||||
/// </summary>
|
||||
public class QrPayCreateOrderRequest: CreateOrderRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 目标平台,微信、支付宝
|
||||
/// </summary>
|
||||
public TargetPlatform TargetPlatform { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 目标平台,微信、支付宝
|
||||
/// </summary>
|
||||
public enum TargetPlatform
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信
|
||||
/// </summary>
|
||||
Wechat=1,
|
||||
/// <summary>
|
||||
/// 支付宝
|
||||
/// </summary>
|
||||
Alipay=2
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// 单笔代付请求
|
||||
/// </summary>
|
||||
public class SingleDaiFuRequest : PaymentRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单Id
|
||||
/// </summary>
|
||||
public string OrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 收款人姓名
|
||||
/// </summary>
|
||||
public string AccName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 收款人账号
|
||||
/// </summary>
|
||||
public string AccNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 转账金额,单位:分
|
||||
/// </summary>
|
||||
public int Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用途
|
||||
/// </summary>
|
||||
public string Purpose { get; set; }
|
||||
}
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// 单笔代付请求
|
||||
/// </summary>
|
||||
public class SingleDaiFuRequest : PaymentRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单Id
|
||||
/// </summary>
|
||||
public string OrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 收款人姓名
|
||||
/// </summary>
|
||||
public string AccName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 收款人账号
|
||||
/// </summary>
|
||||
public string AccNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 转账金额,单位:分
|
||||
/// </summary>
|
||||
public int Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用途
|
||||
/// </summary>
|
||||
public string Purpose { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// 刷卡支付请求
|
||||
/// </summary>
|
||||
public class SwipeCardCreateOrderRequest : CreateOrderRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 扫码支付授权码, 设备读取用户展示的条码或者二维码信息
|
||||
/// </summary>
|
||||
public string AuthCode { get; set; }
|
||||
}
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// 刷卡支付请求
|
||||
/// </summary>
|
||||
public class SwipeCardCreateOrderRequest : CreateOrderRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 扫码支付授权码, 设备读取用户展示的条码或者二维码信息
|
||||
/// </summary>
|
||||
public string AuthCode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,40 +1,40 @@
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信小程序、公众号支付请求
|
||||
/// </summary>
|
||||
public class WechatJsPayCreateOrderRequest: CreateOrderRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 支付环境
|
||||
/// </summary>
|
||||
public PayEnvironment PayEnvironment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信用户关注商家公众号的openid
|
||||
/// </summary>
|
||||
public string UserOpenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 公众账号或小程序ID
|
||||
/// </summary>
|
||||
public string AppId { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 支付环境
|
||||
/// </summary>
|
||||
public enum PayEnvironment
|
||||
{
|
||||
/// <summary>
|
||||
/// 小程序支付
|
||||
/// </summary>
|
||||
WeApp=1,
|
||||
/// <summary>
|
||||
/// 公众号支付
|
||||
/// </summary>
|
||||
H5=2
|
||||
}
|
||||
namespace Hncore.Payment.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信小程序、公众号支付请求
|
||||
/// </summary>
|
||||
public class WechatJsPayCreateOrderRequest: CreateOrderRequestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 支付环境
|
||||
/// </summary>
|
||||
public PayEnvironment PayEnvironment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信用户关注商家公众号的openid
|
||||
/// </summary>
|
||||
public string UserOpenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 公众账号或小程序ID
|
||||
/// </summary>
|
||||
public string AppId { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 支付环境
|
||||
/// </summary>
|
||||
public enum PayEnvironment
|
||||
{
|
||||
/// <summary>
|
||||
/// 小程序支付
|
||||
/// </summary>
|
||||
WeApp=1,
|
||||
/// <summary>
|
||||
/// 公众号支付
|
||||
/// </summary>
|
||||
H5=2
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
namespace Hncore.Payment.Response
|
||||
{
|
||||
public class QrPayCreateOrderResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 商户可用此参数自定义去生成二维码后展示出来进行扫码支付
|
||||
/// </summary>
|
||||
public string CodeUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 此参数的值即是根据code_url生成的可以扫码支付的二维码图片地址
|
||||
/// </summary>
|
||||
public string CodeImgUrl { get; set; }
|
||||
}
|
||||
namespace Hncore.Payment.Response
|
||||
{
|
||||
public class QrPayCreateOrderResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 商户可用此参数自定义去生成二维码后展示出来进行扫码支付
|
||||
/// </summary>
|
||||
public string CodeUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 此参数的值即是根据code_url生成的可以扫码支付的二维码图片地址
|
||||
/// </summary>
|
||||
public string CodeImgUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
using Hncore.Payment.Enum;
|
||||
|
||||
namespace Hncore.Payment.Response
|
||||
{
|
||||
public class QueryOrderResponse
|
||||
{
|
||||
public PaymentStatus PaymentStatus { get; set; }
|
||||
public PaymentType PayType { get; set; }
|
||||
public string PaymentMessage { get; set; }
|
||||
}
|
||||
using Hncore.Payment.Enum;
|
||||
|
||||
namespace Hncore.Payment.Response
|
||||
{
|
||||
public class QueryOrderResponse
|
||||
{
|
||||
public PaymentStatus PaymentStatus { get; set; }
|
||||
public PaymentType PayType { get; set; }
|
||||
public string PaymentMessage { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace Hncore.Payment.Response
|
||||
{
|
||||
public class WechatJsPayCreateOrderResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 原生态js支付信息或小程序支付信息
|
||||
/// </summary>
|
||||
public string PayInfo { get; set; }
|
||||
}
|
||||
namespace Hncore.Payment.Response
|
||||
{
|
||||
public class WechatJsPayCreateOrderResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 原生态js支付信息或小程序支付信息
|
||||
/// </summary>
|
||||
public string PayInfo { get; set; }
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,14 +1,14 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
public static class IServiceCollectionExtension
|
||||
{
|
||||
public static void AddMsgCenterClient(this IServiceCollection service, string baseUrl="http://scheduledtask")
|
||||
{
|
||||
ScheduledTaskHttpClient._BaseUrl = baseUrl;
|
||||
|
||||
service.AddSingleton<ScheduledTaskHttpClient>();
|
||||
}
|
||||
}
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
public static class IServiceCollectionExtension
|
||||
{
|
||||
public static void AddMsgCenterClient(this IServiceCollection service, string baseUrl="http://scheduledtask")
|
||||
{
|
||||
ScheduledTaskHttpClient._BaseUrl = baseUrl;
|
||||
|
||||
service.AddSingleton<ScheduledTaskHttpClient>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,35 @@
|
||||
using System;
|
||||
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 计划消息
|
||||
/// </summary>
|
||||
public class ScheduledMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息名称
|
||||
/// </summary>
|
||||
public string MessageName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划类型
|
||||
/// </summary>
|
||||
public ScheduledType ScheduledType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 延迟计划延迟时间
|
||||
/// </summary>
|
||||
public TimeSpan Delaye { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 定期计划cron表达式
|
||||
/// </summary>
|
||||
public string Cron { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息内容
|
||||
/// </summary>
|
||||
public string Content { get; set; }
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 计划消息
|
||||
/// </summary>
|
||||
public class ScheduledMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息名称
|
||||
/// </summary>
|
||||
public string MessageName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划类型
|
||||
/// </summary>
|
||||
public ScheduledType ScheduledType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 延迟计划延迟时间
|
||||
/// </summary>
|
||||
public TimeSpan Delaye { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 定期计划cron表达式
|
||||
/// </summary>
|
||||
public string Cron { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息内容
|
||||
/// </summary>
|
||||
public string Content { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Etor.Infrastructure\Etor.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Etor.Infrastructure\Etor.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Extension;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
public class ScheduledTaskHttpClient
|
||||
{
|
||||
private IHttpClientFactory _httpClientFactory;
|
||||
|
||||
internal static string _BaseUrl = "";
|
||||
|
||||
public ScheduledTaskHttpClient(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
public string BaseUrl => _BaseUrl;
|
||||
|
||||
private HttpClient CreateHttpClient()
|
||||
{
|
||||
return _httpClientFactory.CreateClient();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置计划消息
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult> SetScheduledMmessage(ScheduledMessage message)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = await CreateHttpClient()
|
||||
.PostAsJsonGetString("/api/scheduledtask/v1/message/Set", message);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("设置计划消息失败", $"{e}\n消息内容:\n{message.ToJson(true)}");
|
||||
return new ApiResult(ResultCode.C_UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Extension;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
public class ScheduledTaskHttpClient
|
||||
{
|
||||
private IHttpClientFactory _httpClientFactory;
|
||||
|
||||
internal static string _BaseUrl = "";
|
||||
|
||||
public ScheduledTaskHttpClient(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
public string BaseUrl => _BaseUrl;
|
||||
|
||||
private HttpClient CreateHttpClient()
|
||||
{
|
||||
return _httpClientFactory.CreateClient();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置计划消息
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult> SetScheduledMmessage(ScheduledMessage message)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = await CreateHttpClient()
|
||||
.PostAsJsonGetString("/api/scheduledtask/v1/message/Set", message);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("设置计划消息失败", $"{e}\n消息内容:\n{message.ToJson(true)}");
|
||||
return new ApiResult(ResultCode.C_UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 计划类型
|
||||
/// </summary>
|
||||
public enum ScheduledType
|
||||
{
|
||||
/// <summary>
|
||||
/// 延迟
|
||||
/// </summary>
|
||||
Delayed = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 定期
|
||||
/// </summary>
|
||||
Recurring = 2
|
||||
}
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 计划类型
|
||||
/// </summary>
|
||||
public enum ScheduledType
|
||||
{
|
||||
/// <summary>
|
||||
/// 延迟
|
||||
/// </summary>
|
||||
Delayed = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 定期
|
||||
/// </summary>
|
||||
Recurring = 2
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user