Class DatasourceController

java.lang.Object
com.alibaba.cloud.ai.controller.DatasourceController

@RestController @RequestMapping("/api/datasource") @CrossOrigin(origins="*") public class DatasourceController extends Object
数据源控制器
Author:
Alibaba Cloud AI
  • Constructor Details

    • DatasourceController

      public DatasourceController(DatasourceService datasourceService)
  • Method Details

    • getAllDatasources

      @GetMapping public org.springframework.http.ResponseEntity<List<Datasource>> getAllDatasources(@RequestParam(value="status",required=false) String status, @RequestParam(value="type",required=false) String type)
      获取所有数据源列表
    • getDatasourceById

      @GetMapping("/{id}") public org.springframework.http.ResponseEntity<Datasource> getDatasourceById(@PathVariable Integer id)
      根据ID获取数据源详情
    • createDatasource

      @PostMapping public org.springframework.http.ResponseEntity<Datasource> createDatasource(@RequestBody Datasource datasource)
      创建数据源
    • updateDatasource

      @PutMapping("/{id}") public org.springframework.http.ResponseEntity<Datasource> updateDatasource(@PathVariable Integer id, @RequestBody Datasource datasource)
      更新数据源
    • deleteDatasource

      @DeleteMapping("/{id}") public org.springframework.http.ResponseEntity<Map<String,Object>> deleteDatasource(@PathVariable Integer id)
      删除数据源
    • testConnection

      @PostMapping("/{id}/test") public org.springframework.http.ResponseEntity<Map<String,Object>> testConnection(@PathVariable Integer id)
      测试数据源连接
    • getDatasourceStats

      @GetMapping("/stats") public org.springframework.http.ResponseEntity<Map<String,Object>> getDatasourceStats()
      获取数据源统计信息
    • getAgentDatasources

      @GetMapping("/agent/{agentId}") public org.springframework.http.ResponseEntity<List<AgentDatasource>> getAgentDatasources(@PathVariable Integer agentId)
      获取智能体关联的数据源列表
    • addDatasourceToAgent

      @PostMapping("/agent/{agentId}") public org.springframework.http.ResponseEntity<Map<String,Object>> addDatasourceToAgent(@PathVariable Integer agentId, @RequestBody Map<String,Integer> request)
      为智能体添加数据源
    • removeDatasourceFromAgent

      @DeleteMapping("/agent/{agentId}/{datasourceId}") public org.springframework.http.ResponseEntity<Map<String,Object>> removeDatasourceFromAgent(@PathVariable Integer agentId, @PathVariable Integer datasourceId)
      移除智能体的数据源关联
    • toggleDatasourceForAgent

      @PutMapping("/agent/{agentId}/{datasourceId}/toggle") public org.springframework.http.ResponseEntity<Map<String,Object>> toggleDatasourceForAgent(@PathVariable Integer agentId, @PathVariable Integer datasourceId, @RequestBody Map<String,Boolean> request)
      启用/禁用智能体的数据源