feat: rag初始版
This commit is contained in:
29
controller/document_chunk.go
Normal file
29
controller/document_chunk.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"rag/model/dto"
|
||||
"rag/service"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type documentChunk struct{}
|
||||
|
||||
var DocumentChunk = new(documentChunk)
|
||||
|
||||
// Update 更新文件片段
|
||||
func (c *documentChunk) Update(ctx context.Context, req *dto.UpdateDocumentChunkReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = service.DocumentChunk.Update(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// List 文件片段列表
|
||||
func (c *documentChunk) List(ctx context.Context, req *dto.ListDocumentChunkReq) (res *dto.ListDocumentChunkRes, err error) {
|
||||
if !g.IsEmpty(req.Page) {
|
||||
req.Page = &beans.Page{PageNum: 1, PageSize: 20}
|
||||
}
|
||||
res, err = service.DocumentChunk.List(ctx, req)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user