mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-11 10:16:20 +08:00
feat(wxads): 封装部分微信广告平台接口
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Ads.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /adcreatives/add 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class AdCreativesAddRequest : WechatAdsRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Element
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置广告文案。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("image")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("image")]
|
||||
public string? ImageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("image_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("image_list")]
|
||||
public IList<string>? ImageIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置链接名称类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("link_name_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("link_name_type")]
|
||||
public string? LinkNameType { get; set; }
|
||||
}
|
||||
|
||||
public class Share
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置分享标题。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("share_title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("share_title")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分享描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("share_description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("share_description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置推广计划 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("campaign_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("campaign_id")]
|
||||
public long CampaignId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_name")]
|
||||
public string AdCreativeName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意规格 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_template_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_template_id")]
|
||||
public int AdCreativeTemplateId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意元素信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_elements")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_elements")]
|
||||
public Types.Element AdCreativeElement { get; set; } = new Types.Element();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置投放站点列表。
|
||||
/// <para>默认值:["SITE_SET_WECHAT"]</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("site_set")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("site_set")]
|
||||
public IList<string> SiteList { get; set; } = new List<string>() { "SITE_SET_WECHAT" };
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置目标 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("destination_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("destination_url")]
|
||||
public string DestinationUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标的物类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_type")]
|
||||
public string ProductType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标的物 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_refs_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_refs_id")]
|
||||
public string? ProductRefId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分享信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("share_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("share_info")]
|
||||
public Types.Share? Share { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Ads.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /adcreatives/add 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class AdCreativesAddResponse : WechatAdsResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_id")]
|
||||
public long AdCreativeId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置返回数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Ads.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /adcreatives/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class AdCreativesGetRequest : WechatAdsRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public long? AdCreativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置过滤条件。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public IList<Abstractions.CommonFilter>? Filters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置页大小。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int? PageSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置页码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int? Page { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Ads.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /adcreatives/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class AdCreativesGetResponse : WechatAdsResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AdCreative
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Element
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置广告文案。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("image")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("image")]
|
||||
public string? ImageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("image_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("image_list")]
|
||||
public string[]? ImageIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置链接名称类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("link_name_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("link_name_type")]
|
||||
public string? LinkNameType { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置推广计划 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("campaign_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("campaign_id")]
|
||||
public long CampaignId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_id")]
|
||||
public long AdCreativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_name")]
|
||||
public string AdCreativeName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意规格 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_template_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_template_id")]
|
||||
public int AdCreativeTemplateId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意元素信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_elements")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_elements")]
|
||||
public Types.Element AdCreativeElement { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置投放站点列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("site_set")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("site_set")]
|
||||
public string[] SiteList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置目标 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("destination_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("destination_url")]
|
||||
public string DestinationUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标的物类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_type")]
|
||||
public string ProductType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标的物 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_refs_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_refs_id")]
|
||||
public string? ProductRefId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置最近修改时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("last_modified_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("last_modified_time")]
|
||||
public long UpdateTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置创建时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("created_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("created_time")]
|
||||
public long CreateTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("list")]
|
||||
public Types.AdCreative[] AdCreativeList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page_info")]
|
||||
public Abstractions.CommonPagination Pagination { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置返回数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Data Data { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Ads.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /adcreatives/update 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class AdCreativesUpdateRequest : WechatAdsRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Element : AdCreativesAddRequest.Types.Element
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_id")]
|
||||
public long AdCreativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_name")]
|
||||
public string? AdCreativeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置广告创意元素信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("adcreative_elements")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("adcreative_elements")]
|
||||
public Types.Element? AdCreativeElement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置目标 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("destination_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("destination_url")]
|
||||
public string? DestinationUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Ads.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /adcreatives/update 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class AdCreativesUpdateResponse : WechatAdsResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user