30 lines
719 B
Go
30 lines
719 B
Go
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
|
|
}
|