Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
--type 知识库(wiki)或个人空间云文档(cloudDoc)(可选值:cloudDoc、wiki,为空则默认为wiki).
--saveType 文档导出的文件类型(可选值:docx、md、pdf,为空或其他非可选值则默认为docx).
--folderToken 当type为个人空间云文档时,该项必填.
--apiEndpoint 可以指定 API 的路径,如https://open.larksuite.com ,以支持Lark 环境
```

- win环境
Expand Down
2 changes: 1 addition & 1 deletion src/feishu-doc-export/FeiShuConsts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public static class FeiShuConsts
/// <summary>
/// 飞书开发接口地址
/// </summary>
public const string OpenApiEndPoint = "https://open.feishu.cn";
public const string DefaultOpenApiEndPoint = "https://open.feishu.cn";
}
}
8 changes: 7 additions & 1 deletion src/feishu-doc-export/GlobalConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public static class GlobalConfig

public static string ExportPath { get; set; }

public static string ApiEndpoint { get; set; }

public static string WikiSpaceId { get; set; }

public static string CloudDocFolder { get; set; }
Expand Down Expand Up @@ -60,7 +62,7 @@ private static void InitAsposeLicense()
{
License license = new License();
// 加载本地密钥
license.SetLicense("C:\\Users\\User\\Desktop\\Aspose.lic");
license.SetLicense("/private/tmp/License.lic");
}

/// <summary>
Expand All @@ -78,6 +80,10 @@ public static void Init(string[] args)
WikiSpaceId = GetCommandLineArg(args, "--spaceId=", true);
DocSaveType = GetCommandLineArg(args, "--saveType=", true);
ExportPath = GetCommandLineArg(args, "--exportPath=");
ApiEndpoint = GetCommandLineArg(args, "--apiEndpoint=");
if (string.IsNullOrWhiteSpace(ExportPath)) {
ApiEndpoint = FeiShuConsts.DefaultOpenApiEndPoint;
}
Quit = args.Contains("--quit");
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/feishu-doc-export/HttpApi/FeiShuHttpApiCaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public FeiShuHttpApiCaller(IFeiShuHttpApi feiShuHttpApi)

public async Task<PagedResult<WikiNodeItemDto>> GetWikiNodeList(string spaceId, string pageToken = null, string parentNodeToken = null)
{
StringBuilder urlBuilder = new StringBuilder($"{FeiShuConsts.OpenApiEndPoint}/open-apis/wiki/v2/spaces/{spaceId}/nodes?page_size=50");// page_size=50
StringBuilder urlBuilder = new StringBuilder($"{FeiShuConsts.DefaultOpenApiEndPoint}/open-apis/wiki/v2/spaces/{spaceId}/nodes?page_size=50");// page_size=50
if (!string.IsNullOrWhiteSpace(pageToken))
{
urlBuilder.Append($"&page_token={pageToken}");
Expand Down Expand Up @@ -383,7 +383,7 @@ public async Task<CloudDocFolderMeta> GetFolderMeta(string folderToken)

public async Task<PagedResult<CloudDocDto>> GetCloudDocList(string folderToken = null, string pageToken = null)
{
StringBuilder urlBuilder = new StringBuilder($"{FeiShuConsts.OpenApiEndPoint}/open-apis/drive/v1/files?folder_token={folderToken}&page_size=50");// page_size=50
StringBuilder urlBuilder = new StringBuilder($"{FeiShuConsts.DefaultOpenApiEndPoint}/open-apis/drive/v1/files?folder_token={folderToken}&page_size=50");// page_size=50
if (!string.IsNullOrWhiteSpace(pageToken))
{
urlBuilder.Append($"&page_token={pageToken}");
Expand Down
2 changes: 1 addition & 1 deletion src/feishu-doc-export/HttpApi/IFeiShuHttpApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace feishu_doc_export.HttpApi
{
[HttpHost(FeiShuConsts.OpenApiEndPoint)]
[HttpHost(FeiShuConsts.DefaultOpenApiEndPoint)]
public interface IFeiShuHttpApi : IHttpApi
{
/// <summary>
Expand Down