Skip to content

Commit

Permalink
Merge branch 'dev' into nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
niltor committed Apr 16, 2024
2 parents 857a18c + ef2bf8b commit c835695
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/AspNetCore/PddOpenSdk.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageLicenseUrl></PackageLicenseUrl>
<PackageIcon>logo.jpg</PackageIcon>
<PackageId>MSDev.PddOpenSdk.AspNetCore</PackageId>
<Version>8.0.3</Version>
<Version>8.0.4</Version>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public partial class GetRefundInformationResponse : PddResponseModel
/// </summary>
[JsonPropertyName("after_sales_reason")]
public string AfterSalesReason { get; set; }

/// <summary>
/// 售后状态 0:无售后 2:买家申请退款,待商家处理 3:退货退款,待商家处理 4:商家同意退款,退款中 5:平台同意退款,退款中 6:驳回退款,待买家处理 7:已同意退货退款,待用户发货 8:平台处理中 9:平台拒绝退款,退款关闭 10:退款成功 11:买家撤销 12:买家逾期未处理,退款失败 13:买家逾期,超过有效期 14:换货补寄待商家处理 15:换货补寄待用户处理 16:换货补寄成功 17:换货补寄失败 18:换货补寄待用户确认完成 21:待商家同意维修 22:待用户确认发货 24:维修关闭 25:维修成功 27:待用户确认收货 31:已同意拒收退款,待用户拒收 32:补寄待商家发货 33:待商家召回
/// </summary>
Expand Down Expand Up @@ -138,7 +137,7 @@ public partial class GetRefundInformationResponse : PddResponseModel
/// 商品规格ID
/// </summary>
[JsonPropertyName("sku_id")]
public string SkuId { get; set; }
public long SkuId { get; set; }

/// <summary>
/// 极速退款标志位 1:极速退款,0:非极速退款
Expand All @@ -150,7 +149,7 @@ public partial class GetRefundInformationResponse : PddResponseModel
/// 更新时间
/// </summary>
[JsonPropertyName("updated_time")]
public string UpdatedTime { get; set; }
public long UpdatedTime { get; set; }

/// <summary>
/// 0-未勾选 1-消费者选择的收货状态为未收到货 2-消费者选择的收货状态为已收到货
Expand Down
5 changes: 2 additions & 3 deletions src/PddOpenSdk/PddOpenSdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<Company>Geethin</Company>
<Description>拼多多开放平台.NET SDK核心类库</Description>
<PackageReleaseNotes>同步官方接口到最新(202401);
支持更多的目标框架;
添加文档注释生成;
兼容json的转换
</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/niltor/open-pdd-net-sdk</PackageProjectUrl>
<RepositoryUrl>https://github.com/niltor/open-pdd-net-sdk</RepositoryUrl>
Expand All @@ -20,7 +19,7 @@
<FileVersion>0.1.0.0</FileVersion>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageIcon>logo.jpg</PackageIcon>
<Version>8.0.3</Version>
<Version>8.0.4</Version>
<PackageId>MSDev.PddOpenSdk</PackageId>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Copyright />
Expand Down
35 changes: 34 additions & 1 deletion src/PddOpenSdk/Services/PddCommonApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class PddCommonApi
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All),
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault,
ReferenceHandler = ReferenceHandler.IgnoreCycles,
WriteIndented = true
WriteIndented = true,
Converters = { new CustomStringConverter() }
};

public PddCommonApi()
Expand Down Expand Up @@ -274,3 +275,35 @@ public class CommonReqeustParams
/// </summary>
public string Sign { get; set; }
}

/// <summary>
/// 自定义 转换器,兼容使用字符串接收其它类型
/// </summary>
public class CustomStringConverter : JsonConverter<string>
{
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.String)
{
return reader.GetString();
}
else if (reader.TokenType == JsonTokenType.Number && typeToConvert.FullName == "System.String")
{
if (reader.TryGetInt64(out long longValue))
{
return longValue.ToString();
}
else
{
return reader.GetDouble().ToString();
}
}
return default;
}

public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
writer.WriteStringValue(value);
}
}

0 comments on commit c835695

Please sign in to comment.