Files
rag-local/kb/controller/kg_relation_controller.go
T
2026-08-05 10:28:44 +08:00

26 lines
522 B
Go

package controller
import (
"context"
"rag-local/kb/model/dto"
"rag-local/kb/service"
)
type kgRelation struct{}
var KgRelation = &kgRelation{}
func (c *kgRelation) List(ctx context.Context, req *dto.ListKgRelationReq) (*dto.ListKgRelationRes, error) {
list, total, err := service.KgRelationService.List(ctx, req.DatasetId, req.Page, req.PageSize)
if err != nil {
return nil, err
}
return &dto.ListKgRelationRes{
List: list,
Total: total,
Page: req.Page,
PageSize: req.PageSize,
}, nil
}