init push
This commit is contained in:
26
backend/api/crawler/v1/confluence.go
Normal file
26
backend/api/crawler/v1/confluence.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package v1
|
||||
|
||||
type ConfluenceParseReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
}
|
||||
|
||||
type ConfluenceParseItem struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
type ConfluenceParseResp struct {
|
||||
ID string `json:"id"`
|
||||
Docs []ConfluenceParseItem `json:"docs"`
|
||||
}
|
||||
|
||||
type ConfluenceScrapeReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
ID string `json:"id" validate:"required"`
|
||||
DocID string `json:"doc_id" validate:"required"`
|
||||
}
|
||||
|
||||
type ConfluenceScrapeResp struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
55
backend/api/crawler/v1/crawler.go
Normal file
55
backend/api/crawler/v1/crawler.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/chaitin/panda-wiki/consts"
|
||||
"github.com/chaitin/panda-wiki/pkg/anydoc"
|
||||
)
|
||||
|
||||
type CrawlerParseReq struct {
|
||||
Key string `json:"key"`
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
CrawlerSource consts.CrawlerSource `json:"crawler_source" validate:"required"`
|
||||
Filename string `json:"filename"`
|
||||
FeishuSetting anydoc.FeishuSetting `json:"feishu_setting"`
|
||||
DingtalkSetting anydoc.DingtalkSetting `json:"dingtalk_setting"`
|
||||
}
|
||||
|
||||
type CrawlerParseResp struct {
|
||||
ID string `json:"id"`
|
||||
Docs anydoc.Child `json:"docs"`
|
||||
}
|
||||
|
||||
type CrawlerExportReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
ID string `json:"id" validate:"required"`
|
||||
DocID string `json:"doc_id" validate:"required"`
|
||||
SpaceId string `json:"space_id"`
|
||||
FileType string `json:"file_type"`
|
||||
}
|
||||
|
||||
type CrawlerExportResp struct {
|
||||
TaskId string `json:"task_id"`
|
||||
}
|
||||
|
||||
type CrawlerResultReq struct {
|
||||
TaskId string `json:"task_id" query:"task_id" validate:"required"`
|
||||
}
|
||||
|
||||
type CrawlerResultResp struct {
|
||||
Status consts.CrawlerStatus `json:"status" validate:"required"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type CrawlerResultsReq struct {
|
||||
TaskIds []string `json:"task_ids" validate:"required"`
|
||||
}
|
||||
|
||||
type CrawlerResultsResp struct {
|
||||
Status consts.CrawlerStatus `json:"status"`
|
||||
List []CrawlerResultItem `json:"list"`
|
||||
}
|
||||
type CrawlerResultItem struct {
|
||||
TaskId string `json:"task_id"`
|
||||
Status consts.CrawlerStatus `json:"status"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
11
backend/api/crawler/v1/epub.go
Normal file
11
backend/api/crawler/v1/epub.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package v1
|
||||
|
||||
type EpubParseReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
Filename string `json:"filename" validate:"required"`
|
||||
Key string `json:"key" validate:"required"`
|
||||
}
|
||||
|
||||
type EpubParseResp struct {
|
||||
TaskID string `json:"task_id"`
|
||||
}
|
||||
52
backend/api/crawler/v1/feishu.go
Normal file
52
backend/api/crawler/v1/feishu.go
Normal file
@@ -0,0 +1,52 @@
|
||||
package v1
|
||||
|
||||
type FeishuSpaceListReq struct {
|
||||
UserAccessToken string `json:"user_access_token" validate:"required"`
|
||||
AppID string `json:"app_id" validate:"required"`
|
||||
AppSecret string `json:"app_secret" validate:"required"`
|
||||
}
|
||||
type FeishuSpaceListResp struct {
|
||||
Name string `json:"name"`
|
||||
SpaceId string `json:"space_id"`
|
||||
}
|
||||
|
||||
type FeishuSearchWikiReq struct {
|
||||
UserAccessToken string `json:"user_access_token" validate:"required"`
|
||||
AppID string `json:"app_id" validate:"required"`
|
||||
AppSecret string `json:"app_secret" validate:"required"`
|
||||
SpaceId string `json:"space_id"`
|
||||
}
|
||||
|
||||
type FeishuSearchWikiResp struct {
|
||||
ID string `json:"id" validate:"required"`
|
||||
DocId string `json:"doc_id" validate:"required"`
|
||||
Title string `json:"title"`
|
||||
FileType string `json:"file_type"`
|
||||
SpaceId string `json:"space_id"`
|
||||
}
|
||||
|
||||
type FeishuListCloudDocReq struct {
|
||||
UserAccessToken string `json:"user_access_token" validate:"required"`
|
||||
AppID string `json:"app_id" validate:"required"`
|
||||
AppSecret string `json:"app_secret" validate:"required"`
|
||||
}
|
||||
|
||||
type FeishuListCloudDocResp struct {
|
||||
ID string `json:"id" validate:"required"`
|
||||
DocId string `json:"doc_id" validate:"required"`
|
||||
Title string `json:"title"`
|
||||
FileType string `json:"file_type"`
|
||||
SpaceId string `json:"space_id"`
|
||||
}
|
||||
|
||||
type FeishuGetDocReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
ID string `json:"id" validate:"required"`
|
||||
DocId string `json:"doc_id" validate:"required"`
|
||||
FileType string `json:"file_type"`
|
||||
SpaceId string `json:"space_id"`
|
||||
}
|
||||
|
||||
type FeishuGetDocResp struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
26
backend/api/crawler/v1/mindoc.go
Normal file
26
backend/api/crawler/v1/mindoc.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package v1
|
||||
|
||||
type MindocParseReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
}
|
||||
|
||||
type MindocParseItem struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
type MindocParseResp struct {
|
||||
ID string `json:"id"`
|
||||
Docs []MindocParseItem `json:"docs"`
|
||||
}
|
||||
|
||||
type MindocScrapeReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
ID string `json:"id" validate:"required"`
|
||||
DocID string `json:"doc_id" validate:"required"`
|
||||
}
|
||||
|
||||
type MindocScrapeResp struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
24
backend/api/crawler/v1/notion.go
Normal file
24
backend/api/crawler/v1/notion.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package v1
|
||||
|
||||
type NotionParseReq struct {
|
||||
Integration string `json:"integration" validate:"required"`
|
||||
}
|
||||
type NotionParseResp struct {
|
||||
ID string `json:"id"`
|
||||
Docs []NotionParseItem `json:"docs"`
|
||||
}
|
||||
|
||||
type NotionParseItem struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
type NotionScrapeReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
ID string `json:"id" validate:"required"`
|
||||
DocId string `json:"doc_id" validate:"required"`
|
||||
}
|
||||
|
||||
type NotionScrapeResp struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
26
backend/api/crawler/v1/siyuan.go
Normal file
26
backend/api/crawler/v1/siyuan.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package v1
|
||||
|
||||
type SiyuanParseReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
}
|
||||
|
||||
type SiyuanParseItem struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
type SiyuanParseResp struct {
|
||||
ID string `json:"id"`
|
||||
Docs []SiyuanParseItem `json:"docs"`
|
||||
}
|
||||
|
||||
type SiyuanScrapeReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
ID string `json:"id" validate:"required"`
|
||||
DocID string `json:"doc_id" validate:"required"`
|
||||
}
|
||||
|
||||
type SiyuanScrapeResp struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
25
backend/api/crawler/v1/wikijs.go
Normal file
25
backend/api/crawler/v1/wikijs.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package v1
|
||||
|
||||
type WikijsParseReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
}
|
||||
|
||||
type WikijsParseItem struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
type WikijsParseResp struct {
|
||||
ID string `json:"id"`
|
||||
Docs []WikijsParseItem `json:"docs"`
|
||||
}
|
||||
|
||||
type WikijsScrapeReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
ID string `json:"id" validate:"required"`
|
||||
DocID string `json:"doc_id" validate:"required"`
|
||||
}
|
||||
|
||||
type WikijsScrapeResp struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
16
backend/api/crawler/v1/yuque.go
Normal file
16
backend/api/crawler/v1/yuque.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package v1
|
||||
|
||||
type YuqueParseReq struct {
|
||||
KbID string `json:"kb_id" validate:"required"`
|
||||
Filename string `json:"filename" validate:"required"`
|
||||
Key string `json:"key" validate:"required"`
|
||||
}
|
||||
|
||||
type YuqueParseResp struct {
|
||||
List []YuqueParseItem `json:"list"`
|
||||
}
|
||||
|
||||
type YuqueParseItem struct {
|
||||
TaskID string `json:"task_id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
Reference in New Issue
Block a user