Skip to content

Commit

Permalink
feat(wxapi): 新增视频号小店会员功能相关接口
Browse files Browse the repository at this point in the history
  • Loading branch information
fudiwei committed Jan 12, 2024
1 parent 9022b32 commit 41908b9
Show file tree
Hide file tree
Showing 59 changed files with 1,883 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
{
/// <summary>
/// <para>表示 EVENT.channels_ec_vip_close 事件的数据。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/vip/callback/member/user_join_vip.html </para>
/// </summary>
public class ChannelsECVipCloseEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable
{
public static class Types
{
public class User
{
/// <summary>
/// 获取或设置注销时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("close_time")]
[System.Text.Json.Serialization.JsonPropertyName("close_time")]
[System.Xml.Serialization.XmlElement("close_time")]
public long CloseTimestamp { get; set; }
}
}

/// <summary>
/// 获取或设置用户信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_info")]
[System.Text.Json.Serialization.JsonPropertyName("user_info")]
[System.Xml.Serialization.XmlElement("user_info")]
public Types.User User { get; set; } = default!;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
{
/// <summary>
/// <para>表示 EVENT.channels_ec_vip_grade_info_update 事件的数据。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/vip/callback/member/usergrade_update.html </para>
/// </summary>
public class ChannelsECVipGradeInfoUpgradeEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable
{
public static class Types
{
public class User
{
/// <summary>
/// 获取或设置会员等级。
/// </summary>
[Newtonsoft.Json.JsonProperty("grade")]
[System.Text.Json.Serialization.JsonPropertyName("grade")]
[System.Xml.Serialization.XmlElement("grade")]
public int Grade { get; set; }

/// <summary>
/// 获取或设置经验值。
/// </summary>
[Newtonsoft.Json.JsonProperty("experience_value")]
[System.Text.Json.Serialization.JsonPropertyName("experience_value")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
[System.Xml.Serialization.XmlElement("experience_value")]
public int ExperienceValue { get; set; }
}
}

/// <summary>
/// 获取或设置用户信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_info")]
[System.Text.Json.Serialization.JsonPropertyName("user_info")]
[System.Xml.Serialization.XmlElement("user_info")]
public Types.User User { get; set; } = default!;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
{
/// <summary>
/// <para>表示 EVENT.channels_ec_vip_join 事件的数据。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/vip/callback/member/user_join_vip.html </para>
/// </summary>
public class ChannelsECVipJoinEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable
{
public static class Types
{
public class User
{
/// <summary>
/// 获取或设置手机号码。
/// </summary>
[Newtonsoft.Json.JsonProperty("phone_number")]
[System.Text.Json.Serialization.JsonPropertyName("phone_number")]
[System.Xml.Serialization.XmlElement("phone_number")]
public string PhoneNumber { get; set; } = default!;

/// <summary>
/// 获取或设置加入时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("join_time")]
[System.Text.Json.Serialization.JsonPropertyName("join_time")]
[System.Xml.Serialization.XmlElement("join_time")]
public long JoinTimestamp { get; set; }
}
}

/// <summary>
/// 获取或设置用户信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_info")]
[System.Text.Json.Serialization.JsonPropertyName("user_info")]
[System.Xml.Serialization.XmlElement("user_info")]
public Types.User User { get; set; } = default!;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
{
/// <summary>
/// <para>表示 EVENT.channels_ec_vip_score_exchange 事件的数据。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/vip/callback/score/user_score_exchange.html </para>
/// </summary>
public class ChannelsECVipScoreExchangeEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable
{
public static class Types
{
public class Exchange
{
public static class Types
{
public class Coupon
{
/// <summary>
/// 获取或设置优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("related_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("related_coupon_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
[System.Xml.Serialization.XmlElement("related_coupon_id")]
public long CouponId { get; set; }
}

public class Product
{
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("related_product_id")]
[System.Text.Json.Serialization.JsonPropertyName("related_product_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
[System.Xml.Serialization.XmlElement("related_product_id")]
public long CouponId { get; set; }
}
}

/// <summary>
/// 获取或设置兑换类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("score_item_type")]
[System.Text.Json.Serialization.JsonPropertyName("score_item_type")]
[System.Xml.Serialization.XmlElement("score_item_type")]
public int ScoreItemType { get; set; }

/// <summary>
/// 获取或设置兑换积分。
/// </summary>
[Newtonsoft.Json.JsonProperty("pay_score")]
[System.Text.Json.Serialization.JsonPropertyName("pay_score")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
[System.Xml.Serialization.XmlElement("pay_score")]
public int PayScore { get; set; }

/// <summary>
/// 获取或设置兑换的优惠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon_info")]
[System.Text.Json.Serialization.JsonPropertyName("coupon_info")]
[System.Xml.Serialization.XmlElement("coupon_info", IsNullable = true)]
public Types.Coupon? Coupon { get; set; }

/// <summary>
/// 获取或设置兑换的商品信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_info")]
[System.Text.Json.Serialization.JsonPropertyName("product_info")]
[System.Xml.Serialization.XmlElement("product_info", IsNullable = true)]
public Types.Product? Product { get; set; }
}
}

/// <summary>
/// 获取或设置兑换信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("exchange_info")]
[System.Text.Json.Serialization.JsonPropertyName("exchange_info")]
[System.Xml.Serialization.XmlElement("exchange_info")]
public Types.Exchange Exchange { get; set; } = default!;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
{
/// <summary>
/// <para>表示 EVENT.channels_ec_vip_score_update 事件的数据。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/vip/callback/score/user_score_update.html </para>
/// </summary>
public class ChannelsECVipScoreUpdateEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable
{
public static class Types
{
public class User
{
/// <summary>
/// 获取或设置会员等级。
/// </summary>
[Newtonsoft.Json.JsonProperty("grade")]
[System.Text.Json.Serialization.JsonPropertyName("grade")]
[System.Xml.Serialization.XmlElement("grade")]
public int Grade { get; set; }

/// <summary>
/// 获取或设置当前积分。
/// </summary>
[Newtonsoft.Json.JsonProperty("score")]
[System.Text.Json.Serialization.JsonPropertyName("score")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
[System.Xml.Serialization.XmlElement("score")]
public int Score { get; set; }

/// <summary>
/// 获取或设置本次改动积分。
/// </summary>
[Newtonsoft.Json.JsonProperty("delta_score")]
[System.Text.Json.Serialization.JsonPropertyName("delta_score")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
[System.Xml.Serialization.XmlElement("delta_score")]
public int DeltaScore { get; set; }

/// <summary>
/// 获取或设置流水类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("flow_type")]
[System.Text.Json.Serialization.JsonPropertyName("flow_type")]
[System.Xml.Serialization.XmlElement("flow_type")]
public int FlowType { get; set; }
}
}

/// <summary>
/// 获取或设置用户信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_info")]
[System.Text.Json.Serialization.JsonPropertyName("user_info")]
[System.Xml.Serialization.XmlElement("user_info")]
public Types.User User { get; set; } = default!;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
{
/// <summary>
/// <para>表示 EVENT.channels_ec_vip_task_award 事件的数据。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/vip/callback/member/user_finish_task.html </para>
/// </summary>
public class ChannelsECVipTaskAwardEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable
{
public static class Types
{
public class Task
{
public static class Types
{
public class AwardInfo
{
/// <summary>
/// 获取或设置奖励类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("award_type")]
[System.Text.Json.Serialization.JsonPropertyName("award_type")]
[System.Xml.Serialization.XmlElement("award_type")]
public int AwardType { get; set; }

/// <summary>
/// 获取或设置奖励的优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("coupon_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
[System.Xml.Serialization.XmlElement("coupon_id", IsNullable = true)]
public long? CouponId { get; set; }

/// <summary>
/// 获取或设置奖励的积分。
/// </summary>
[Newtonsoft.Json.JsonProperty("gain_score")]
[System.Text.Json.Serialization.JsonPropertyName("gain_score")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
[System.Xml.Serialization.XmlElement("gain_score", IsNullable = true)]
public int? GainScore { get; set; }
}
}

/// <summary>
/// 获取或设置任务 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("task_id")]
[System.Text.Json.Serialization.JsonPropertyName("task_id")]
[System.Xml.Serialization.XmlElement("task_id")]
public long TaskId { get; set; }

/// <summary>
/// 获取或设置任务名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("task_name")]
[System.Text.Json.Serialization.JsonPropertyName("task_name")]
[System.Xml.Serialization.XmlElement("task_name")]
public string TaskName { get; set; } = default!;

/// <summary>
/// 获取或设置奖励信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("award_info")]
[System.Text.Json.Serialization.JsonPropertyName("award_info")]
[System.Xml.Serialization.XmlElement("award_info")]
public Types.AwardInfo AwardInfo { get; set; } = default!;
}
}

/// <summary>
/// 获取或设置任务信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("task_info")]
[System.Text.Json.Serialization.JsonPropertyName("task_info")]
[System.Xml.Serialization.XmlElement("task_info")]
public Types.Task Task { get; set; } = default!;
}
}
Loading

0 comments on commit 41908b9

Please sign in to comment.