feat: add knowledge directory management for documents and FAQs
- Implemented directory validation in Create and Update knowledge document services. - Added directory selection in document and FAQ edit dialogs with a new KnowledgeDirectoryPanel component. - Enhanced API to support fetching, creating, updating, and deleting knowledge directories. - Updated data models to include directory information for knowledge documents and FAQs. - Added translations for directory-related messages in English and Chinese.
This commit is contained in:
@@ -26,8 +26,25 @@ type UpdateKnowledgeBaseRequest struct {
|
||||
CreateKnowledgeBaseRequest
|
||||
}
|
||||
|
||||
type CreateKnowledgeDirectoryRequest struct {
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
ParentID int64 `json:"parentId"`
|
||||
Name string `json:"name"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateKnowledgeDirectoryRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
CreateKnowledgeDirectoryRequest
|
||||
}
|
||||
|
||||
type DeleteKnowledgeDirectoryRequest struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type CreateKnowledgeDocumentRequest struct {
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
DirectoryID int64 `json:"directoryId"`
|
||||
Title string `json:"title"`
|
||||
ContentType enums.KnowledgeDocumentContentType `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
@@ -40,6 +57,7 @@ type UpdateKnowledgeDocumentRequest struct {
|
||||
|
||||
type CreateKnowledgeFAQRequest struct {
|
||||
KnowledgeBaseID int64 `json:"knowledgeBaseId"`
|
||||
DirectoryID int64 `json:"directoryId"`
|
||||
Question string `json:"question"`
|
||||
Answer string `json:"answer"`
|
||||
SimilarQuestions []string `json:"similarQuestions"`
|
||||
|
||||
Reference in New Issue
Block a user