Documentation ¶
Index ¶
- type FeishuWiki
- func (w *FeishuWiki) CreateExportTask(objType, objToken string) (errResult error, ticket string)
- func (w *FeishuWiki) DownloadExportTask(fileToken string, outputPathFile string) (errResult error)
- func (w *FeishuWiki) GetDocument(documentToken string) (errResult error, doc db.WikiDocs)
- func (w *FeishuWiki) GetDocumentContent(documentToken string) (errResult error, content string)
- func (w *FeishuWiki) GetDocuments(spaceId string) (errResult error, results []db.WikiDocs)
- func (w *FeishuWiki) GetUserAccessTokenByCode(code string) (status bool)
- func (w *FeishuWiki) NewDocument(spaceId, title, comment string, pinIndex int) (errResult error, nodeToken string)
- func (w *FeishuWiki) QueryExportTask(objToken, ticket string) (errResult error, fileToken string)
- func (w *FeishuWiki) RefreshUserAccessToken() (status bool)
- func (w *FeishuWiki) SyncWikiDocument(workspaceId int, spaceId string) (err error, result string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeishuWiki ¶
type FeishuWiki struct {
// contains filtered or unexported fields
}
func (*FeishuWiki) CreateExportTask ¶
func (w *FeishuWiki) CreateExportTask(objType, objToken string) (errResult error, ticket string)
CreateExportTask 创建指定文档的导出任务
func (*FeishuWiki) DownloadExportTask ¶
func (w *FeishuWiki) DownloadExportTask(fileToken string, outputPathFile string) (errResult error)
DownloadExportTask 下载导出任务的结果
func (*FeishuWiki) GetDocument ¶
func (w *FeishuWiki) GetDocument(documentToken string) (errResult error, doc db.WikiDocs)
GetDocument 根据文档Token获取文档内容
func (*FeishuWiki) GetDocumentContent ¶
func (w *FeishuWiki) GetDocumentContent(documentToken string) (errResult error, content string)
GetDocumentContent 获取文档的纯内容,用于分析文档内容 应用频率限制:单个应用调用频率上限为每秒 5 次,超过该频率限制,接口将返回 HTTP 状态码 400 及错误码 99991400。 当请求被限频,应用需要处理限频状态码,并使用指数退避算法或其它一些频控策略降低对 API 的调用速率。
func (*FeishuWiki) GetDocuments ¶
func (w *FeishuWiki) GetDocuments(spaceId string) (errResult error, results []db.WikiDocs)
GetDocuments 从飞书获取指定空间的文档列表
func (*FeishuWiki) GetUserAccessTokenByCode ¶
func (w *FeishuWiki) GetUserAccessTokenByCode(code string) (status bool)
GetUserAccessTokenByCode 根据登录预授权码code获取用户AccessToken 登录预授权码code由Server的WikiController的回调函数获取,coe只能使用一次,获取用户AccessToken后,需要保存refreshToken
func (*FeishuWiki) NewDocument ¶
func (w *FeishuWiki) NewDocument(spaceId, title, comment string, pinIndex int) (errResult error, nodeToken string)
NewDocument 创建新的文档
func (*FeishuWiki) QueryExportTask ¶
func (w *FeishuWiki) QueryExportTask(objToken, ticket string) (errResult error, fileToken string)
QueryExportTask 查询导出任务的状态
func (*FeishuWiki) RefreshUserAccessToken ¶
func (w *FeishuWiki) RefreshUserAccessToken() (status bool)
RefreshUserAccessToken 根据refreshToken刷新用户AccessToken 用户AccessToken一般只有2小时有效期,而RefreshToken有30天有效期
func (*FeishuWiki) SyncWikiDocument ¶
func (w *FeishuWiki) SyncWikiDocument(workspaceId int, spaceId string) (err error, result string)
SyncWikiDocument 从飞书平台同步文档到数据库中
Click to show internal directories.
Click to hide internal directories.