Skip to content

Commit

Permalink
feat(microapp): 废弃小程序、小游戏独立的接入点
Browse files Browse the repository at this point in the history
  • Loading branch information
fudiwei committed Mar 5, 2024
1 parent 2001390 commit 89ba25b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
3 changes: 2 additions & 1 deletion docs/MicroApp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

基于 `Flurl.Http`[抖音小程序开放平台](https://microapp.bytedance.com/) HTTP API SDK。

本模块仅支持抖音小程序专属的 API,如需接入与抖音开放平台共享的 API,请移步 [`SKIT.FlurlHttpClient.ByteDance.DouyinOpen`](../DouyinOpen/README.md) 模块。

---

## 功能
Expand Down Expand Up @@ -36,7 +38,6 @@ using SKIT.FlurlHttpClient.ByteDance.MicroApp;

var options = new DouyinMicroAppClientOptions()
{
Endpoints = DouyinMicroAppEndpoints.API_MINIAPP, // 指定接入点。需注意小程序、小游戏拥有不同的接入点。
AppId = "抖音小程序 AppId",
AppSecret = "抖音小程序 AppSecret",
ECPaySalt = "担保支付相关服务的密钥,不用则不填"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal protected DouyinMicroAppClient(DouyinMicroAppClientOptions options, Htt
EndpointForDefault = options.Endpoint;
EndpointForWebcast = options.EndpointForWebcastAPI;

FlurlClient.BaseUrl = options.Endpoint ?? DouyinMicroAppEndpoints.API_MINIAPP;
FlurlClient.BaseUrl = options.Endpoint ?? DouyinMicroAppEndpoints.DEFAULT;
FlurlClient.WithTimeout(options.Timeout <= 0 ? Timeout.InfiniteTimeSpan : TimeSpan.FromMilliseconds(options.Timeout));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public class DouyinMicroAppClientOptions

/// <summary>
/// 获取或设置抖音小程序 API 入口点。
/// <para>默认值:<see cref="DouyinMicroAppEndpoints.API_MINIAPP"/></para>
/// <para>默认值:<see cref="DouyinMicroAppEndpoints.DEFAULT"/></para>
/// </summary>
public string Endpoint { get; set; } = DouyinMicroAppEndpoints.API_MINIAPP;
public string Endpoint { get; set; } = DouyinMicroAppEndpoints.DEFAULT;

/// <summary>
/// 获取或设置抖音小程序直播小玩法 API 入口点。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@ namespace SKIT.FlurlHttpClient.ByteDance.MicroApp
public static class DouyinMicroAppEndpoints
{
/// <summary>
/// 小程序 API 域名(默认)
/// 默认域名
/// </summary>
public const string API_MINIAPP = "https://developer.toutiao.com/api";
public const string DEFAULT = "https://developer.toutiao.com/api";

/// <summary>
/// 小程序 API 沙盒环境域名。
/// 沙盒环境域名。
/// </summary>
public const string API_MINIAPP_SANDBOX = "https://open-sandbox.douyin.com/api";

/// <summary>
/// 小游戏 API 域名。
/// </summary>
public const string API_MINIGAME = "https://minigame.zijieapi.com/mgplatform/api";
public const string SANGBOX = "https://open-sandbox.douyin.com/api";
}

/// <summary>
Expand Down

0 comments on commit 89ba25b

Please sign in to comment.