Skip to content

Commit

Permalink
Upgrade to ABP 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlcf88 committed Jan 12, 2023
1 parent 7f0d9f2 commit 55a2a98
Show file tree
Hide file tree
Showing 78 changed files with 375 additions and 79 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: NuGet/setup-nuget@v1.0.5
- uses: actions/setup-dotnet@v1
- uses: NuGet/setup-nuget@v1
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '7.0.x'

- name: read common.props
id: commonProps
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>

<AbpVersion>6.0.1</AbpVersion>
<AbpVersion>7.0.0</AbpVersion>
<MicrosoftNetTestSdkVersion>17.2.0</MicrosoftNetTestSdkVersion>

</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>2.1.0</Version>
<Version>2.2.0</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="7.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Volo.Abp.Caching" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.Core" Version="$(AbpVersion)" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
using System.Text.Json.Serialization;
using Newtonsoft.Json;

namespace EasyAbp.Abp.WeChat.MiniProgram.Models
{
public interface IMiniProgramResponse
{
[JsonProperty("errmsg")] string ErrorMessage { get; set; }
[JsonPropertyName("errmsg")]
[JsonProperty("errmsg")]
string ErrorMessage { get; set; }

[JsonProperty("errcode")] int ErrorCode { get; set; }
[JsonPropertyName("errcode")]
[JsonProperty("errcode")]
int ErrorCode { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
using System.Text.Json.Serialization;
using Newtonsoft.Json;

namespace EasyAbp.Abp.WeChat.MiniProgram.Models
{
public class MiniProgramCommonResponse : IMiniProgramResponse
{
[JsonProperty("errmsg")] public string ErrorMessage { get; set; }
[JsonPropertyName("errmsg")]
[JsonProperty("errmsg")]
public string ErrorMessage { get; set; }

[JsonProperty("errcode")] public int ErrorCode { get; set; }
[JsonPropertyName("errcode")]
[JsonProperty("errcode")]
public int ErrorCode { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Text.Json.Serialization;
using EasyAbp.Abp.WeChat.MiniProgram.Models;
using Newtonsoft.Json;

Expand All @@ -11,36 +12,42 @@ public class GetUnlimitedACodeRequest : MiniProgramCommonRequest
/// <summary>
/// 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式)
/// </summary>
[JsonPropertyName("scene")]
[JsonProperty("scene")]
public string Scene { get; protected set; }

/// <summary>
/// 必须是已经发布的小程序存在的页面(否则报错),例如 pages/index/index, 根路径前不要填加 /,不能携带参数(参数请放在scene字段里),如果不填写这个字段,默认跳主页面
/// </summary>
[JsonPropertyName("page")]
[JsonProperty("page")]
public string Page { get; protected set; }

/// <summary>
/// 二维码的宽度,单位 px,最小 280px,最大 1280px
/// </summary>
[JsonPropertyName("width")]
[JsonProperty("width")]
public short Width { get; protected set; }

/// <summary>
/// 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false
/// </summary>
[JsonPropertyName("auto_color")]
[JsonProperty("auto_color")]
public bool AutoColor { get; set; }

/// <summary>
/// auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
/// </summary>
[JsonPropertyName("line_color")]
[JsonProperty("line_color")]
public LineColorModel LineColor { get; set; }

/// <summary>
/// 是否需要透明底色,为 true 时,生成透明底色的小程序
/// </summary>
[JsonPropertyName("is_hyaline")]
[JsonProperty("is_hyaline")]
public bool IsHyaline { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Text.Json.Serialization;
using EasyAbp.Abp.WeChat.MiniProgram.Models;
using Newtonsoft.Json;

Expand All @@ -11,24 +12,28 @@ public class Code2SessionRequest : MiniProgramCommonRequest
/// <summary>
/// 小程序 appId
/// </summary>
[JsonPropertyName("appid")]
[JsonProperty("appid")]
public string AppId { get; protected set; }

/// <summary>
/// 小程序 appSecret
/// </summary>
[JsonPropertyName("secret")]
[JsonProperty("secret")]
public string AppSecret { get; protected set; }

/// <summary>
/// 登录时获取的 code
/// </summary>
[JsonPropertyName("js_code")]
[JsonProperty("js_code")]
public string JsCode { get; protected set; }

/// <summary>
/// 授权类型,此处只需填写 authorization_code
/// </summary>
[JsonPropertyName("grant_type")]
[JsonProperty("grant_type")]
public string GrantType { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Text.Json.Serialization;
using EasyAbp.Abp.WeChat.MiniProgram.Models;
using Newtonsoft.Json;

Expand All @@ -9,12 +10,15 @@ public class Code2SessionResponse : IMiniProgramResponse

public int ErrorCode { get; set; }

[JsonPropertyName("openid")]
[JsonProperty("openid")]
public string OpenId { get; set; }

[JsonPropertyName("session_key")]
[JsonProperty("session_key")]
public string SessionKey { get; set; }

[JsonPropertyName("unionid")]
[JsonProperty("unionid")]
public string UnionId { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using EasyAbp.Abp.WeChat.MiniProgram.Models;
using System.Text.Json.Serialization;
using EasyAbp.Abp.WeChat.MiniProgram.Models;
using Newtonsoft.Json;

namespace EasyAbp.Abp.WeChat.MiniProgram.Services.PhoneNumber
Expand All @@ -11,6 +12,7 @@ public class GetPhoneNumberRequest : MiniProgramCommonRequest
/// <summary>
/// 小程序获取的 code
/// </summary>
[JsonPropertyName("code")]
[JsonProperty("code")]
public string Code { get; protected set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using EasyAbp.Abp.WeChat.MiniProgram.Models;
using System.Text.Json.Serialization;
using EasyAbp.Abp.WeChat.MiniProgram.Models;
using Newtonsoft.Json;

namespace EasyAbp.Abp.WeChat.MiniProgram.Services.PhoneNumber
Expand All @@ -9,30 +10,37 @@ public class GetPhoneNumberResponse : IMiniProgramResponse

public int ErrorCode { get; set; }

[JsonPropertyName("phone_info")]
[JsonProperty("phone_info")]
public PhoneInfo PhoneInfo { get; set; }
}

public class PhoneInfo
{
[JsonPropertyName("phoneNumber")]
[JsonProperty("phoneNumber")]
public string PhoneNumber { get; set; }

[JsonPropertyName("purePhoneNumber")]
[JsonProperty("purePhoneNumber")]
public string PurePhoneNumber { get; set; }

[JsonPropertyName("countryCode")]
[JsonProperty("countryCode")]
public string CountryCode { get; set; }

[JsonPropertyName("watermark")]
[JsonProperty("watermark")]
public WaterMark WaterMark { get; set; }
}

public class WaterMark
{
[JsonPropertyName("appid")]
[JsonProperty("appid")]
public string AppId { get; set; }

[JsonPropertyName("timestamp")]
[JsonProperty("timestamp")]
public int TimeStamp { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Text.Json.Serialization;
using EasyAbp.Abp.WeChat.MiniProgram.Models;
using JetBrains.Annotations;
using Newtonsoft.Json;
Expand All @@ -13,41 +14,47 @@ public class SendSubscribeMessageRequest : MiniProgramCommonRequest
/// 接收者(用户)的 openid
/// </summary>
[NotNull]
[JsonPropertyName("touser")]
[JsonProperty("touser")]
public string ToUser { get; protected set; }

/// <summary>
/// 所需下发的订阅模板id
/// </summary>
[NotNull]
[JsonPropertyName("template_id")]
[JsonProperty("template_id")]
public string TemplateId { get; protected set; }

/// <summary>
/// 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。
/// </summary>
[CanBeNull]
[JsonPropertyName("page")]
[JsonProperty("page")]
public string Page { get; protected set; }

/// <summary>
/// 模板内容,格式形如 { "key1": { "value": any }, "key2": { "value": any } }
/// </summary>
[NotNull]
[JsonPropertyName("data")]
[JsonProperty("data")]
public SubscribeMessageData Data { get; protected set; }

/// <summary>
/// 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
/// </summary>
[CanBeNull]
[JsonPropertyName("miniprogram_state")]
[JsonProperty("miniprogram_state")]
public string MiniProgramState { get; protected set; }

/// <summary>
/// 进入小程序查看”的语言类型,支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),默认为zh_CN
/// </summary>
[CanBeNull]
[JsonPropertyName("lang")]
[JsonProperty("lang")]
public string Lang { get; protected set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Newtonsoft.Json;

namespace EasyAbp.Abp.WeChat.MiniProgram.Services.SubscribeMessage
{
public class SubscribeMessageDataItem
{
[JsonPropertyName("value")]
[JsonProperty("value")]
public string Value { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\..\common.props" />

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>EasyAbp.Abp.WeChat.Official</RootNamespace>
<Description>ABP vNext微信公众号模块,提供对微信公众号业务的支持。</Description>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
using System.Text.Json.Serialization;
using Newtonsoft.Json;

namespace EasyAbp.Abp.WeChat.Official.Models
{
public interface IOfficialResponse
{
[JsonProperty("errmsg")] string ErrorMessage { get; set; }
[JsonPropertyName("errmsg")]
[JsonProperty("errmsg")]
string ErrorMessage { get; set; }

[JsonProperty("errcode")] int ErrorCode { get; set; }
[JsonPropertyName("errcode")]
[JsonProperty("errcode")]
int ErrorCode { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
using System.Text.Json.Serialization;
using Newtonsoft.Json;

namespace EasyAbp.Abp.WeChat.Official.Models
{
public class OfficialCommonResponse : IOfficialResponse
{
[JsonPropertyName("errmsg")]
[JsonProperty("errmsg")]
public string ErrorMessage { get; set; }

[JsonPropertyName("errcode")]
[JsonProperty("errcode")]
public int ErrorCode { get; set; }
}
Expand Down
Loading

0 comments on commit 55a2a98

Please sign in to comment.