Skip to content

Commit

Permalink
Merge pull request #3038 from JeffreySu/Developer
Browse files Browse the repository at this point in the history
Developer
  • Loading branch information
JeffreySu authored Jun 25, 2024
2 parents 510e605 + ff22e80 commit 2884235
Show file tree
Hide file tree
Showing 48 changed files with 2,378 additions and 183 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
using Senparc.NeuChar.Helpers;
using Senparc.CO2NET.Utilities;
using Senparc.CO2NET.Trace;
//DPBMARK MP

using Senparc.Weixin.MP.Entities;
using Senparc.Weixin.MP.Helpers;
using Senparc.Weixin.MP;
//DPBMARK_END
#if NET462
using System.Web;
using System.Configuration;
using Senparc.Weixin.Sample.CommonService.TemplateMessage;//DPBMARK MP DPBMARK_END
using Senparc.Weixin.Sample.CommonService.TemplateMessage;
#else
using Microsoft.AspNetCore.Http;
using Senparc.Weixin.Sample.CommonService.TemplateMessage;//DPBMARK MP DPBMARK_END
using Senparc.Weixin.Sample.CommonService.TemplateMessage;
#endif


Expand Down Expand Up @@ -196,7 +196,7 @@ public async Task ConfigOnWeixinExceptionFunc(WeixinException ex)
Senparc.Weixin.WeixinTrace.SendCustomLog("异常模板消息发送过程中再次失败", result.Exception?.Message + "\r\n" + result.Exception?.StackTrace);
}
}
} // DPBMARK_END
}
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
using System.Threading.Tasks;
using Senparc.CO2NET.Extensions;
using Senparc.WebSocket;
using Senparc.Weixin.MP.AdvancedAPIs.TemplateMessage;//DPBMARK MP DPBMARK_END
using Senparc.Weixin.WxOpen.Containers;//DPBMARK MiniProgram DPBMARK_END
using Senparc.Weixin.MP.AdvancedAPIs.TemplateMessage;
using Senparc.Weixin.WxOpen.Containers;

namespace Senparc.Weixin.Sample.CommonService.MessageHandlers.WebSocket
{
Expand Down Expand Up @@ -50,7 +50,7 @@ public override async Task OnMessageReceiced(WebSocketHelper webSocketHandler, R

var appId = Config.SenparcWeixinSetting.WxOpenAppId;//与微信小程序账号后台的AppId设置保持一致,区分大小写。

//DPBMARK MiniProgram

try
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using Senparc.CO2NET.Cache;
using Senparc.Weixin.Sample.CommonService.TemplateMessage.WxOpen;
using Senparc.Weixin.TenPay.V3;//DPBMARK TenPay DPBMARK_END
using Senparc.Weixin.TenPay.V3;
using Senparc.Weixin.WxOpen.Containers;
using System;
using System.Threading.Tasks;
Expand All @@ -27,7 +27,7 @@ public async Task<SessionBag> RunTemplateTestAsync(string wxOpenAppId, string se
// formId = formId.Replace("prepay_id=", "");
// title = "这是来自小程序支付的模板消息(仅测试接收,数据不一定真实)";

// //DPBMARK TenPay
//
// var cacheStrategy = CacheStrategyFactory.GetObjectCacheStrategyInstance();
// var unifiedorderRequestData = await cacheStrategy.GetAsync<TenPayV3UnifiedorderRequestData>($"WxOpenUnifiedorderRequestData-{openId}");//获取订单请求信息缓存
// var unifedorderResult = await cacheStrategy.GetAsync<UnifiedorderResult>($"WxOpenUnifiedorderResultData-{openId}");//获取订单信息缓存
Expand All @@ -44,7 +44,7 @@ public async Task<SessionBag> RunTemplateTestAsync(string wxOpenAppId, string se
// orderNumber = "1234567890";
// }
// productName += " | 注意:这条消息是从小程序发起的!仅作为UI上支付成功的演示!不能确定支付真实成功! | prepay_id:";
// productName += unifedorderResult.prepay_id;//DPBMARK TenPay DPBMARK_END
// productName += unifedorderResult.prepay_id;
//}
//else
//{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Senparc.Weixin.Cache;
using Senparc.Weixin.MP.Containers;//DPBMARK MP DPBMARK_END
using Senparc.Weixin.Sample.CommonService.Download;//DPBMARK MP DPBMARK_END
using Senparc.Weixin.MP.Containers;
using Senparc.Weixin.Sample.CommonService.Download;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -53,14 +53,14 @@ public IActionResult Index()
};
var sdkList = new List<Home_IndexVD_AssemblyModel>();
sdkList.Add(new Home_IndexVD_AssemblyModel("SDK 公共基础库", "Senparc.Weixin", typeof(Senparc.Weixin.WeixinRegister), gitHubUrl: sdkGitHubUrl));
sdkList.Add(new Home_IndexVD_AssemblyModel("公众号<br />JSSDK<br />摇一摇周边", "Senparc.Weixin.MP", typeof(Senparc.Weixin.MP.Register), gitHubUrl: sdkGitHubUrl));//DPBMARK MP DPBMARK_END
sdkList.Add(new Home_IndexVD_AssemblyModel("公众号MvcExtension", "Senparc.Weixin.MP.MvcExtension", typeof(Senparc.Weixin.MP.MvcExtension.SenparcOAuthAttribute), "Senparc.Weixin.MP.Mvc", gitHubUrl: sdkGitHubUrl));//DPBMARK MP DPBMARK_END
sdkList.Add(new Home_IndexVD_AssemblyModel("小程序", "Senparc.Weixin.WxOpen", typeof(Senparc.Weixin.WxOpen.Register), gitHubUrl: sdkGitHubUrl));//DPBMARK MiniProgram DPBMARK_END
sdkList.Add(new Home_IndexVD_AssemblyModel("微信支付", "Senparc.Weixin.TenPay", typeof(Senparc.Weixin.TenPay.Register), gitHubUrl: sdkGitHubUrl));//DPBMARK TenPay DPBMARK_END
sdkList.Add(new Home_IndexVD_AssemblyModel("微信支付V3(新)", "Senparc.Weixin.TenPayV3", typeof(Senparc.Weixin.TenPayV3.Register), supportNet45: false, gitHubUrl: sdkGitHubUrl));//DPBMARK TenPay DPBMARK_END
sdkList.Add(new Home_IndexVD_AssemblyModel("开放平台", "Senparc.Weixin.Open", typeof(Senparc.Weixin.Open.Register), gitHubUrl: sdkGitHubUrl));//DPBMARK Open DPBMARK_END
sdkList.Add(new Home_IndexVD_AssemblyModel("公众号<br />JSSDK<br />摇一摇周边", "Senparc.Weixin.MP", typeof(Senparc.Weixin.MP.Register), gitHubUrl: sdkGitHubUrl));
sdkList.Add(new Home_IndexVD_AssemblyModel("公众号MvcExtension", "Senparc.Weixin.MP.MvcExtension", typeof(Senparc.Weixin.MP.MvcExtension.SenparcOAuthAttribute), "Senparc.Weixin.MP.Mvc", gitHubUrl: sdkGitHubUrl));
sdkList.Add(new Home_IndexVD_AssemblyModel("小程序", "Senparc.Weixin.WxOpen", typeof(Senparc.Weixin.WxOpen.Register), gitHubUrl: sdkGitHubUrl));
sdkList.Add(new Home_IndexVD_AssemblyModel("微信支付", "Senparc.Weixin.TenPay", typeof(Senparc.Weixin.TenPay.Register), gitHubUrl: sdkGitHubUrl));
sdkList.Add(new Home_IndexVD_AssemblyModel("微信支付V3(新)", "Senparc.Weixin.TenPayV3", typeof(Senparc.Weixin.TenPayV3.Register), supportNet45: false, gitHubUrl: sdkGitHubUrl));
sdkList.Add(new Home_IndexVD_AssemblyModel("开放平台", "Senparc.Weixin.Open", typeof(Senparc.Weixin.Open.Register), gitHubUrl: sdkGitHubUrl));
//TempData["QYVersion"] = getDisplayVersion(getFileVersionInfo("Senparc.Weixin.QY.dll"));//已经停止更新
sdkList.Add(new Home_IndexVD_AssemblyModel("企业微信", "Senparc.Weixin.Work", typeof(Senparc.Weixin.Work.Register), gitHubUrl: sdkGitHubUrl));//DPBMARK Work DPBMARK_END
sdkList.Add(new Home_IndexVD_AssemblyModel("企业微信", "Senparc.Weixin.Work", typeof(Senparc.Weixin.Work.Register), gitHubUrl: sdkGitHubUrl));
vd.AssemblyModelCollection[sdkGroup] = sdkList;


Expand All @@ -73,9 +73,9 @@ public IActionResult Index()
};
var aspnetList = new List<Home_IndexVD_AssemblyModel>();
aspnetList.Add(new Home_IndexVD_AssemblyModel("ASP.NET<br />运行时基础库", "Senparc.Weixin.AspNet", typeof(Senparc.Weixin.AspNet.WeixinRegister), gitHubUrl: sdkGitHubUrl));//AspNet 运行时基础库
aspnetList.Add(new Home_IndexVD_AssemblyModel("公众号消息中间件", "Senparc.Weixin.MP.Middleware", typeof(Senparc.Weixin.MP.MessageHandlers.Middleware.MessageHandlerMiddlewareExtension), gitHubUrl: sdkGitHubUrl));//DPBMARK MP DPBMARK_END
aspnetList.Add(new Home_IndexVD_AssemblyModel("小程序消息中间件", "Senparc.Weixin.WxOpen.Middleware", typeof(Senparc.Weixin.WxOpen.MessageHandlers.Middleware.MessageHandlerMiddlewareExtension), gitHubUrl: sdkGitHubUrl));//DPBMARK MiniProgram DPBMARK_END
aspnetList.Add(new Home_IndexVD_AssemblyModel("企业微信消息中间件", "Senparc.Weixin.Work.Middleware", typeof(Senparc.Weixin.Work.MessageHandlers.Middleware.MessageHandlerMiddlewareExtension), gitHubUrl: sdkGitHubUrl));//DPBMARK Work DPBMARK_END
aspnetList.Add(new Home_IndexVD_AssemblyModel("公众号消息中间件", "Senparc.Weixin.MP.Middleware", typeof(Senparc.Weixin.MP.MessageHandlers.Middleware.MessageHandlerMiddlewareExtension), gitHubUrl: sdkGitHubUrl));
aspnetList.Add(new Home_IndexVD_AssemblyModel("小程序消息中间件", "Senparc.Weixin.WxOpen.Middleware", typeof(Senparc.Weixin.WxOpen.MessageHandlers.Middleware.MessageHandlerMiddlewareExtension), gitHubUrl: sdkGitHubUrl));
aspnetList.Add(new Home_IndexVD_AssemblyModel("企业微信消息中间件", "Senparc.Weixin.Work.Middleware", typeof(Senparc.Weixin.Work.MessageHandlers.Middleware.MessageHandlerMiddlewareExtension), gitHubUrl: sdkGitHubUrl));
vd.AssemblyModelCollection[aspnetGroup] = aspnetList;

var cacheAndExtensionGroup = new Home_IndexVD_GroupInfo()
Expand All @@ -86,10 +86,10 @@ public IActionResult Index()
"因此,您也可以自行扩展,并对接到微信 SDK 或其他系统中。<br />"
};
var cacheAndExtensionList = new List<Home_IndexVD_AssemblyModel>();
cacheAndExtensionList.Add(new Home_IndexVD_AssemblyModel("Redis 缓存<br />(StackExchange.Redis)", "Senparc.Weixin.Cache.Redis", typeof(Senparc.Weixin.Cache.Redis.Register), gitHubUrl: sdkGitHubUrl));//DPBMARK Redis DPBMARK_END
cacheAndExtensionList.Add(new Home_IndexVD_AssemblyModel("Redis 缓存<br />(CsRedis)", "Senparc.Weixin.Cache.CsRedis", typeof(Senparc.Weixin.Cache.CsRedis.Register), gitHubUrl: sdkGitHubUrl));//DPBMARK CsRedis DPBMARK_END
cacheAndExtensionList.Add(new Home_IndexVD_AssemblyModel("Memcached 缓存", "Senparc.Weixin.Cache.Memcached", typeof(Senparc.Weixin.Cache.Memcached.Register), gitHubUrl: sdkGitHubUrl));//DPBMARK Memcached DPBMARK_END
cacheAndExtensionList.Add(new Home_IndexVD_AssemblyModel("WebSocket 模块", "Senparc.WebSocket", typeof(Senparc.WebSocket.WebSocketConfig), gitHubUrl: sdkGitHubUrl));//DPBMARK WebSocket DPBMARK_END
cacheAndExtensionList.Add(new Home_IndexVD_AssemblyModel("Redis 缓存<br />(StackExchange.Redis)", "Senparc.Weixin.Cache.Redis", typeof(Senparc.Weixin.Cache.Redis.Register), gitHubUrl: sdkGitHubUrl));
cacheAndExtensionList.Add(new Home_IndexVD_AssemblyModel("Redis 缓存<br />(CsRedis)", "Senparc.Weixin.Cache.CsRedis", typeof(Senparc.Weixin.Cache.CsRedis.Register), gitHubUrl: sdkGitHubUrl));
cacheAndExtensionList.Add(new Home_IndexVD_AssemblyModel("Memcached 缓存", "Senparc.Weixin.Cache.Memcached", typeof(Senparc.Weixin.Cache.Memcached.Register), gitHubUrl: sdkGitHubUrl));
cacheAndExtensionList.Add(new Home_IndexVD_AssemblyModel("WebSocket 模块", "Senparc.WebSocket", typeof(Senparc.WebSocket.WebSocketConfig), gitHubUrl: sdkGitHubUrl));
vd.AssemblyModelCollection[cacheAndExtensionGroup] = cacheAndExtensionList;

var neucharGitHubUrl = "https://github.com/Senparc/NeuChar";
Expand Down Expand Up @@ -118,9 +118,9 @@ public IActionResult Index()
var co2netList = new List<Home_IndexVD_AssemblyModel>();
co2netList.Add(new Home_IndexVD_AssemblyModel("CO2NET 基础库", "Senparc.CO2NET", typeof(CO2NET.Config), gitHubUrl: co2netGitHubUrl));//CO2NET 基础库版本信息
co2netList.Add(new Home_IndexVD_AssemblyModel("APM 库", "Senparc.CO2NET.APM", typeof(CO2NET.APM.Config), gitHubUrl: co2netGitHubUrl));//CO2NET.APM 版本信息
co2netList.Add(new Home_IndexVD_AssemblyModel("Redis 库<br />(StackExchange.Redis)", "Senparc.CO2NET.Cache.Redis", typeof(Senparc.CO2NET.Cache.Redis.Register), gitHubUrl: co2netGitHubUrl));//CO2NET.Cache.Redis 版本信息 -- DPBMARK CsRedis DPBMARK_END
co2netList.Add(new Home_IndexVD_AssemblyModel("Redis 库<br />(CSRedis)", "Senparc.CO2NET.Cache.CsRedis", typeof(Senparc.CO2NET.Cache.CsRedis.Register), gitHubUrl: co2netGitHubUrl));//CO2NET.Cache.CsRedis 版本信息 -- DPBMARK CsRedis DPBMARK_END
co2netList.Add(new Home_IndexVD_AssemblyModel("Memcached 库", "Senparc.CO2NET.Cache.Memcached", typeof(Senparc.CO2NET.Cache.Memcached.Register), gitHubUrl: co2netGitHubUrl));//CO2NET.Cache.Memcached 版本信息 -- DPBMARK Memcached DPBMARK_END
co2netList.Add(new Home_IndexVD_AssemblyModel("Redis 库<br />(StackExchange.Redis)", "Senparc.CO2NET.Cache.Redis", typeof(Senparc.CO2NET.Cache.Redis.Register), gitHubUrl: co2netGitHubUrl));//CO2NET.Cache.Redis 版本信息
co2netList.Add(new Home_IndexVD_AssemblyModel("Redis 库<br />(CSRedis)", "Senparc.CO2NET.Cache.CsRedis", typeof(Senparc.CO2NET.Cache.CsRedis.Register), gitHubUrl: co2netGitHubUrl));//CO2NET.Cache.CsRedis 版本信息
co2netList.Add(new Home_IndexVD_AssemblyModel("Memcached 库", "Senparc.CO2NET.Cache.Memcached", typeof(Senparc.CO2NET.Cache.Memcached.Register), gitHubUrl: co2netGitHubUrl));//CO2NET.Cache.Memcached 版本信息
co2netList.Add(new Home_IndexVD_AssemblyModel("CO2NET 的 ASP.NET<br />运行时支持库", "Senparc.CO2NET.AspNet", typeof(Senparc.CO2NET.AspNet.Register), gitHubUrl: co2netGitHubUrl));//CO2NET.AspNet 版本信息
vd.AssemblyModelCollection[co2netGroup] = co2netList;
co2netList.Add(new Home_IndexVD_AssemblyModel("WebApi 引擎库(新)", "Senparc.CO2NET.WebApi", typeof(Senparc.CO2NET.WebApi.Register), supportNet45: false, gitHubUrl: co2netGitHubUrl));//CO2NET.AspNet 版本信息
Expand Down Expand Up @@ -161,7 +161,7 @@ public IActionResult Index()
return View(vd);
}

#region MP 测试 -- DPBMARK MP
#region MP 测试
public ActionResult GetAccessTokenBags()
{
if (!Request.IsLocal())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public ActionResult Redis(int id = 1)
switch (id)
{

case 1://DPBMARK Redis
case 1:
sb.Append("使用Redis(StackExchange.Redis)<br>");
CacheStrategyFactory.RegisterObjectCacheStrategy(() => Senparc.CO2NET.Cache.Redis.RedisObjectCacheStrategy.Instance);
break;//DPBMARK_END
case 2://DPBMARK Redis
case 2:
sb.Append("使用Redis(CsRedis)<br>");
CacheStrategyFactory.RegisterObjectCacheStrategy(() => Senparc.CO2NET.Cache.CsRedis.RedisObjectCacheStrategy.Instance);
break;//DPBMARK_END
Expand Down Expand Up @@ -126,10 +126,10 @@ public async Task<IActionResult> RunTest(int id = 0)
IContainerCacheStrategy containerCacheStrategy;
switch (id)
{
case 1://DPBMARK Redis
case 1:
containerCacheStrategy = Senparc.Weixin.Cache.Redis.RedisContainerCacheStrategy.Instance;
break;//DPBMARK_END
case 2://DPBMARK Redis
case 2:
containerCacheStrategy = Senparc.Weixin.Cache.CsRedis.RedisContainerCacheStrategy.Instance;
break;//DPBMARK_END
case -1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
using System.Text;
using System.Threading.Tasks;

//DPBMARK MP

using Senparc.Weixin.MP;
using Senparc.Weixin.Sample.Net6.Filters;
using Senparc.Weixin.MP.AdvancedAPIs;
Expand Down Expand Up @@ -105,7 +105,7 @@ public IActionResult Index(int productId = 0, int hc = 0)
var state = string.Format("{0}|{1}", productId, hc);
string url = null;

url = OAuthApi.GetAuthorizeUrl(TenPayV3Info.AppId, returnUrl, state, OAuthScope.snsapi_userinfo);// -- DPBMARK MP DPBMARK_END
url = OAuthApi.GetAuthorizeUrl(TenPayV3Info.AppId, returnUrl, state, OAuthScope.snsapi_userinfo);//

if (url.IsNullOrEmpty())
{
Expand Down Expand Up @@ -219,7 +219,7 @@ public IActionResult ProductPayCode(int productId, int hc)

#endregion

//DPBMARK MP

#region OAuth授权
public ActionResult OAuthCallback(string code, string state, string returnUrl)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
using Senparc.Weixin.HttpUtility;
using Senparc.Weixin.TenPay.V2;

//DPBMARK MP

using Senparc.Weixin.MP.AdvancedAPIs;
using Senparc.Weixin.MP.Containers;
using Senparc.Weixin.MP.Helpers;
Expand Down Expand Up @@ -477,7 +477,7 @@ public ActionResult Delivernotify()
return View();
}

//DPBMARK MP

public ActionResult SharedAddress()
{
var accessToken = AccessTokenContainer.TryGetAccessToken(TenPayInfo.AppId, "49b71198b776e18521659a32a97501a6");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
using ZXing.Common;
using TenPayOldV3 = Senparc.Weixin.TenPay.V3.TenPayV3;

//DPBMARK MP

using Senparc.Weixin.MP;
using Senparc.Weixin.MP.AdvancedAPIs;
using Senparc.Weixin.Sample.CommonService.TemplateMessage;
Expand Down Expand Up @@ -110,7 +110,7 @@ public ActionResult Index(int productId = 0, int hc = 0)
var state = string.Format("{0}|{1}", productId, hc);
string url = null;

url = OAuthApi.GetAuthorizeUrl(TenPayV3Info.AppId, returnUrl, state, OAuthScope.snsapi_userinfo);// -- DPBMARK MP DPBMARK_END
url = OAuthApi.GetAuthorizeUrl(TenPayV3Info.AppId, returnUrl, state, OAuthScope.snsapi_userinfo);//

if (url.IsNullOrEmpty())
{
Expand All @@ -124,7 +124,7 @@ public ActionResult BankCode()
return View();
}

//DPBMARK MP

#region JsApi支付

public ActionResult OAuthCallback(string code, string state, string returnUrl)
Expand Down Expand Up @@ -1045,7 +1045,7 @@ public ActionResult ProductPayCode(int productId, int hc)

#endregion

//DPBMARK MP

#region H5支付

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 2. 目前 Senparc.Weixin SDK 已经全面转向异步方法驱动,
using Senparc.Weixin.WxOpen.Helpers;
using System;
using System.IO;
using Senparc.Weixin.TenPay.V3;//DPBMARK TenPay DPBMARK_END
using Senparc.Weixin.TenPay.V3;
using Senparc.Weixin.Sample.CommonService;
using Senparc.CO2NET.Utilities;
using System.Threading.Tasks;
Expand Down Expand Up @@ -512,7 +512,7 @@ public async Task<ActionResult> UniformSend(string sessionId)
//{"touser":"oeaTy0DgoGq-lyqvTauWVjbIVuP0","weapp_template_msg":null,"mp_template_msg":{"appid":"wx669ef95216eef885","template_id":null,"url":"https://dev.senparc.com","miniprogram":{"appid":"wx12b4f63276b14d4c","pagepath":"websocket/websocket"},"data":{"first":{"value":"小程序和公众号统一的服务消息","color":"#173177"},"keyword1":{"value":"2022/1/20 23:22:12","color":"#173177"},"keyword2":{"value":"dev.senparc.com","color":"#173177"},"keyword3":{"value":"小程序接口测试","color":"#173177"},"keyword4":{"value":"正常","color":"#173177"},"keyword5":{"value":"测试“小程序和公众号统一的服务消息”接口,服务正常","color":"#173177"},"remark":{"value":"您的 OpenId:oeaTy0DgoGq-lyqvTauWVjbIVuP0","color":"#173177"},"TemplateId":"ur6TqESOo-32FEUk4qJxeWZZVt4KEOPjqbAFDGWw6gg","Url":"https://dev.senparc.com","TemplateName":"系统异常告警通知"}}}


#region 公众号模板消息信息 -- DPBMARK MP
#region 公众号模板消息信息

//可选参数(需要和公众号模板消息匹配):
templateData = templateData = new
Expand Down
Loading

0 comments on commit 2884235

Please sign in to comment.