s_robot_dataset.go 842 B

1234567891011121314151617181920212223242526272829303132333435
  1. package schema
  2. // RobotDataset RobotDataset对象
  3. type RobotDataset struct {
  4. RecordID string `json:"record_id"` // 记录id
  5. RobotId string `json:"robot_id"` // 机器人id
  6. DatasetId string `json:"dataset_id"` // 知识库id
  7. }
  8. // RobotDatasetQueryParam 查询条件
  9. type RobotDatasetQueryParam struct {
  10. RobotId string
  11. RecordIDs []string
  12. }
  13. // RobotDatasetQueryOptions RobotDataset对象查询可选参数项
  14. type RobotDatasetQueryOptions struct {
  15. PageParam *PaginationParam // 分页参数
  16. }
  17. type RobotDatasets []*RobotDataset
  18. // RobotDatasetQueryResult RobotDataset对象查询结果
  19. type RobotDatasetQueryResult struct {
  20. Data RobotDatasets
  21. PageResult *PaginationResult
  22. }
  23. func (a RobotDatasets) ToDatasetIds() []string {
  24. Ids := make([]string, len(a))
  25. for k, v := range a {
  26. Ids[k] = v.DatasetId
  27. }
  28. return Ids
  29. }