Skip to content

Commit

Permalink
Merge pull request #5 from JeffreySu/master
Browse files Browse the repository at this point in the history
pull
  • Loading branch information
mojinxun authored Jun 17, 2022
2 parents 0708e98 + 4788608 commit 6c84704
Show file tree
Hide file tree
Showing 2,540 changed files with 196,964 additions and 141,416 deletions.
13 changes: 6 additions & 7 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,17 @@

- [ ] .net 3.5
- [ ] .net 4.0
- [ ] .net 4.5
- [ ] .net standard 2.0
- [ ] .net 4.5+
- [ ] .net standard 2.0 / 2.1
- [ ] .net core 1.x
- [ ] .net core 2.x
- [x] .net core 3.x
- [ ] .net 5.x / 6.x
- [ ] .net core 3.x
- [x] .net 5.x / 6.x

##### 开发环境

- [ ] Visual Studio 2015
- [ ] Visual Studio 2017
- [x] Visual Studio 2019
- [ ] Visual Studio 2019
- [x] Visual Studio 2022
- [ ] Visual Studio Code
- [ ] 其他:

Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/master_SenparcWeixinSampleNetCore3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,34 @@ jobs:
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.5

- name: Set up .NET Core 2.1
- name: Set up .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.1.807'
dotnet-version: '3.1.301'


- name: Set up .NET Core 3.1
- name: Set up .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.301'
dotnet-version: '6.0.100'

- name: CMD1
run: dir

- name: CMD2
run: cd ./samples/netcore3.0-mvc/

- name: Restore NuGet packages
run: nuget restore
#-SolutionDirectory ./samples/netcore3.0-mvc/
#- name: CMD1
# run: dir
#`n cd ./Samples/net6-mvc/ `n dir `n nuget restore `n msbuild /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="\published\"

#- name: CMD2
# run: cd ./Samples/net6-mvc/

#- name: CMD3
# run: dir

- name: Restore NuGet packages
run: nuget restore "./Samples/All/net6-mvc/"
#-SolutionDirectory ./Samples/All/net6-mvc/

- name: Publish to folder
run: msbuild /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="\published\"
run: msbuild "Samples/All/net6-mvc/Senparc.Weixin.Sample.Net6.sln" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="\published\"

- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
Expand Down
76 changes: 12 additions & 64 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,81 +17,29 @@ bak.zip
#/Tools/*
*.DotSettings
.vs
.vscode
applicationhost.config
packages/
*/**/App_Data/SenparcTraceLog/
/src/Senparc.Weixin.QY/Senparc.Weixin.QY.Test/test.config
/src/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/.vscode
/src/Senparc.Weixin.MP.BuildOutPut
/src/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample.Libraries.VC.VC.opendb
/src/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample.Libraries.VC.db
/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/Config
/src/Senparc.Weixin.MP.BuildOutPut
/src/Senparc.Weixin.MP.Sample.vs2017/Senparc.Weixin.MP.CoreSample/Properties/PublishProfiles
/src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/Config
/src/Senparc.Weixin.MP.BuildOutPut/readme.txt
/src/Senparc.Weixin.MP.Sample.vs2017/Senparc.Weixin.MP.CoreSample/App_Data/Document/Files
/Samples/Senparc.Weixin.MP.Sample/UpgradeLog2.htm
/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.AppDemo/project.config.json
/src/Senparc.WebSocket/src/Senparc.Weixin.MP.BuildOutPut/netcoreapp2.0
/src/Senparc.WebSocket/src/Senparc.Weixin.MP.BuildOutPut/netcoreapp2.1
/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.MP.BuildOutPut/netcoreapp2.0
/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.MP.BuildOutPut/netcoreapp2.1

/Samples/Senparc.Weixin.MP.Sample.vs2017/Senparc.Weixin.MP.CoreSample/App_Data/SenparcTraceLog/*
/Samples/Senparc.Weixin.MP.Sample.vs2017/Senparc.Weixin.MP.CoreSample/appsettings.Development.json
/Samples/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/App_Data/SenparcTraceLog/*
/src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/App_Data/SenparcTraceLog/*
/src/Senparc.Weixin.Open/Senparc.Weixin.Open.Test/App_Data/SenparcTraceLog/*
/Senparc.Weixin.TenPay.BuildOutPut/*.nupkg
/Senparc.Weixin.TenPay.BuildOutPut/net35
/Senparc.Weixin.TenPay.BuildOutPut/net40
/Senparc.Weixin.TenPay.BuildOutPut/net45
/Senparc.Weixin.TenPay.BuildOutPut/netcoreapp2.0
/Senparc.Weixin.TenPay.BuildOutPut/netcoreapp2.1
/Senparc.Weixin.TenPay.BuildOutPut/netstandard2.0

/Senparc.Weixin.TenPay.BuildOutPut/net35/*
/Senparc.Weixin.TenPay.BuildOutPut/net40/*
/Senparc.Weixin.TenPay.BuildOutPut/net45/*
/Senparc.Weixin.TenPay.BuildOutPut/netcoreapp2.0/*
/Senparc.Weixin.TenPay.BuildOutPut/netcoreapp2.1/*
/Senparc.Weixin.TenPay.BuildOutPut/netstandard2.0/*
/Senparc.Weixin.MP.BuildOutPut/net35
/Senparc.Weixin.MP.BuildOutPut/net45
/Senparc.Weixin.MP.BuildOutPut/net40
/Senparc.Weixin.MP.BuildOutPut/netcoreapp2.0
/Senparc.Weixin.MP.BuildOutPut/netcoreapp2.1
/Senparc.Weixin.MP.BuildOutPut/netstandard2.0
*.nupkg
/src/src/Senparc.Weixin.MP.BuildOutPut/.net4.5/Senparc.Weixin.WxOpen.XML
/Samples/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/App_Data/NeuChar/NeuCharRoot.config
/Samples/Senparc.Weixin.MP.Sample.vs2017 - DPB
/Samples/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/App_Data/NeuChar/NeuCharRoot.bak.*
/Samples/Senparc.Weixin.MP.Sample.vs2017/Senparc.Weixin.MP.CoreSample/Properties/PublishProfiles/FolderProfile.pubxml
/Samples/Senparc.Weixin.MP.Sample.WebForms/Senparc.Weixin.MP.Sample.WebForms/App_Data/SenparcTraceLog/*
/Samples/Senparc.Weixin.MP.Sample.vs2017/Senparc.Weixin.MP.CoreSample/App_Data/NeuChar/NeuCharRoot.config
/src/Senparc.Weixin.MP/Senparc.WeixinTests/App_Data/SenparcTraceLog/*
/src/Senparc.Weixin.Work/Senparc.Weixin.Work.Test/App_Data/SenparcTraceLog/*
/Samples/net45-mvc/Senparc.Weixin.MP.Sample/App_Data/NeuChar/*
/Samples/net45-mvc/Senparc.Weixin.MP.Sample/App_Data/SenparcTraceLog/*
/Samples/netcore3.1-mvc/Senparc.Weixin.Sample.NetCore3/App_Data/SenparcTraceLog
/Samples/netcore3.1-mvc/Senparc.Weixin.Sample.NetCore3/Properties/PublishProfiles/FolderProfile.pubxml
/.opencollective.json
/Senparc.Weixin.MP.BuildOutPut/netcoreapp3.1
/Senparc.Weixin.MP.BuildOutPut/netstandard2.1
/Senparc.Weixin.MP.BuildOutPut/*.snupkg
/Samples/All/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/App_Data/NeuChar/NeuCharRoot.config
/Samples/All/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/App_Data/NeuChar/NeuCharRoot.bak.*
/Samples/All/net45-mvc/Senparc.Weixin.MP.Sample/App_Data/NeuChar/*
/Samples/All/netcore3.1-mvc/Senparc.Weixin.Sample.NetCore3/Properties/PublishProfiles/FolderProfile.pubxml

/src/ProjectFileManager
/Samples/net45-webforms/Senparc.Weixin.MP.Sample.WebForms/App_Data/SenparcTraceLog
/Samples/netcore3.1-mvc/Senparc.Weixin.Sample.NetCore3/App_Data/QrCode
/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis.Tests/App_Data/SenparcTraceLog
/Samples/netcore3.1-mvc/Senparc.Weixin.Sample.NetCore3/appsettings.Development.json
/Samples/netcore3.1-mvc/Senparc.Weixin.Sample.NetCore3/App_Data/WeChat_OfficialAccount
/Samples/netcore3.1-mvc/.idea
/Samples/net6-mvc/Senparc.Weixin.Sample.Net6/App_Data/SenparcTraceLog
/Samples/net6-mvc/Senparc.Weixin.Sample.Net6/App_Data/WeChat_OfficialAccount
/Samples/All/net6-mvc/Senparc.Weixin.Sample.Net6/App_Data/WeChat_OfficialAccount
/src/BuildOutPut
/Samples/net6-mvc/TestResults
/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/App_Data/SenparcTraceLog
/Samples/All/net6-mvc/TestResults
/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.Test.json
/src/ProjectFileManager2
/src/Senparc.Weixin.MP/Senparc.WeixinTests/appsettings.Test.json
/tools/Senparc.Weixin.CLI/BuildOutPut/
/Samples/All/net6-mvc/nuget.exe
/src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/Config/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Senparc.CO2NET.Utilities;
using Senparc.CO2NET.Trace;

#if NET451
#if NET462
using System.Web;
#else
using Microsoft.AspNetCore.Http;
Expand Down Expand Up @@ -112,7 +112,7 @@ public void Save(Config config)
{
doc.Root.Element("Versions").Add(new XElement("Version", version));
}
#if NET451
#if NET462
doc.Save(GetDatabaseFilePath());
#else
using (FileStream fs = new FileStream(GetDatabaseFilePath(), FileMode.OpenOrCreate, FileAccess.ReadWrite))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------
Copyright (C) 2021 Senparc
Copyright (C) 2022 Senparc
文件名:EventService.cs
文件功能描述:事件处理程序,此代码的简化MessageHandler方法已由/CustomerMessageHandler/CustomerMessageHandler_Event.cs完成
Expand All @@ -24,7 +24,7 @@
using Senparc.Weixin.MP.Helpers;
using Senparc.Weixin.MP;
//DPBMARK_END
#if NET451
#if NET462
using System.Web;
using System.Configuration;
using Senparc.Weixin.Sample.CommonService.TemplateMessage;//DPBMARK MP DPBMARK_END
Expand Down Expand Up @@ -69,7 +69,7 @@ public ResponseMessageBase GetResponseMessage(RequestMessageEventBase requestMes
var strongResponseMessage = requestMessage.CreateResponseMessage<ResponseMessageText>();

//获取Senparc.Weixin.MP.dll版本信息
#if NET451
#if NET462
var dllPath = HttpContext.Current.Server.MapPath("~/bin/Senparc.Weixin.MP.dll");
#else
//var dllPath = ServerUtility.ContentRootMapPath("~/bin/Release/netcoreapp2.2/Senparc.Weixin.MP.dll");//本地测试路径
Expand Down
95 changes: 95 additions & 0 deletions Samples/All/Senparc.Weixin.Sample.CommonService/LocationService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*----------------------------------------------------------------
Copyright (C) 2022 Senparc
文件名:LocationService.cs
文件功能描述:地理位置信息处理
创建标识:Senparc - 20150312
----------------------------------------------------------------*/
//DPBMARK_FILE MP

using System.Collections.Generic;
using Senparc.Weixin.MP.Entities;
using Senparc.CO2NET.Helpers.BaiduMap;
using Senparc.CO2NET.Helpers.GoogleMap;
using Senparc.Weixin.MP.Helpers;
using Senparc.CO2NET.Helpers;
using Senparc.NeuChar.Entities;

namespace Senparc.Weixin.Sample.CommonService
{
public class LocationService
{
public ResponseMessageNews GetResponseMessage(RequestMessageLocation requestMessage)
{
var responseMessage = ResponseMessageBase.CreateFromRequestMessage<ResponseMessageNews>(requestMessage);

#region 百度地图

{
var markersList = new List<BaiduMarkers>();
markersList.Add(new BaiduMarkers()
{
Longitude = requestMessage.Location_X,
Latitude = requestMessage.Location_Y,
Color = "red",
Label = "S",
Size = BaiduMarkerSize.m
});

var mapUrl = BaiduMapHelper.GetBaiduStaticMap(requestMessage.Location_X, requestMessage.Location_Y, 1, 6, markersList);
responseMessage.Articles.Add(new Article()
{
Description = string.Format("【来自百度地图】您刚才发送了地理位置信息。Location_X:{0},Location_Y:{1},Scale:{2},标签:{3}",
requestMessage.Location_X, requestMessage.Location_Y,
requestMessage.Scale, requestMessage.Label),
PicUrl = mapUrl,
Title = "定位地点周边地图",
Url = mapUrl
});
}

#endregion

#region GoogleMap

{
var markersList = new List<GoogleMapMarkers>();
markersList.Add(new GoogleMapMarkers()
{
X = requestMessage.Location_X,
Y = requestMessage.Location_Y,
Color = "red",
Label = "S",
Size = GoogleMapMarkerSize.Default,
});
var mapSize = "480x600";
var mapUrl = GoogleMapHelper.GetGoogleStaticMap(19 /*requestMessage.Scale*//*微信和GoogleMap的Scale不一致,这里建议使用固定值*/,
markersList, mapSize);
responseMessage.Articles.Add(new Article()
{
Description = string.Format("【来自GoogleMap】您刚才发送了地理位置信息。Location_X:{0},Location_Y:{1},Scale:{2},标签:{3}",
requestMessage.Location_X, requestMessage.Location_Y,
requestMessage.Scale, requestMessage.Label),
PicUrl = mapUrl,
Title = "定位地点周边地图",
Url = mapUrl
});
}

#endregion


responseMessage.Articles.Add(new Article()
{
Title = "微信公众平台SDK 官网链接",
Description = "Senparc.Weixin.MK SDK地址",
PicUrl = "https://sdk.weixin.senparc.com/images/logo.jpg",
Url = "https://sdk.weixin.senparc.com"
});

return responseMessage;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------
Copyright (C) 2021 Senparc
Copyright (C) 2022 Senparc
文件名:CustomMessageHandlerAsync.cs
文件功能描述:自定义MessageHandler(异步方法)
Expand All @@ -12,7 +12,7 @@
using System.Threading;
using System.Threading.Tasks;

#if NET451
#if NET462
using System.Web;
#else
#endif
Expand Down
Loading

0 comments on commit 6c84704

Please sign in to comment.