feat: implement Paragraph API for CRUD operations and batch deletion

This commit is contained in:
CaptainB 2025-05-07 13:53:04 +08:00
parent 10105ce5ab
commit 36da813eea

View File

@ -187,7 +187,7 @@ class ParagraphView(APIView):
authentication_classes = [TokenAuth]
@extend_schema(
methods=['PUT'],
methods=['GET'],
summary=_('Disassociation issue'),
description=_('Disassociation issue'),
operation_id=_('Disassociation issue'),
@ -196,7 +196,7 @@ class ParagraphView(APIView):
tags=[_('Knowledge Base/Documentation/Paragraph')]
)
@has_permissions(PermissionConstants.DOCUMENT_EDIT.get_workspace_permission())
def put(self, request: Request,
def get(self, request: Request,
workspace_id: str, knowledge_id: str, document_id: str, paragraph_id: str, problem_id: str):
return result.success(ParagraphSerializers.Association(
data={
@ -212,7 +212,7 @@ class ParagraphView(APIView):
authentication_classes = [TokenAuth]
@extend_schema(
methods=['PUT'],
methods=['GET'],
summary=_('Related questions'),
description=_('Related questions'),
operation_id=_('Related questions'),
@ -221,7 +221,7 @@ class ParagraphView(APIView):
tags=[_('Knowledge Base/Documentation/Paragraph')]
)
@has_permissions(PermissionConstants.DOCUMENT_EDIT.get_workspace_permission())
def put(self, request: Request,
def get(self, request: Request,
workspace_id: str, knowledge_id: str, document_id: str, paragraph_id: str, problem_id: str):
return result.success(ParagraphSerializers.Association(
data={