26 lines
522 B
Go
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
|
|
}
|