26 lines
506 B
Go
26 lines
506 B
Go
package controller
|
|
|
|
import (
|
|
"context"
|
|
|
|
"rag-local/kb/model/dto"
|
|
"rag-local/kb/service"
|
|
)
|
|
|
|
type kgEntity struct{}
|
|
|
|
var KgEntity = &kgEntity{}
|
|
|
|
func (c *kgEntity) List(ctx context.Context, req *dto.ListKgEntityReq) (*dto.ListKgEntityRes, error) {
|
|
list, total, err := service.KgEntityService.List(ctx, req.DatasetId, req.Page, req.PageSize)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &dto.ListKgEntityRes{
|
|
List: list,
|
|
Total: total,
|
|
Page: req.Page,
|
|
PageSize: req.PageSize,
|
|
}, nil
|
|
}
|