Class PromptConfigController

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

@RestController @RequestMapping("/api/prompt-config") @CrossOrigin(origins="*", maxAge=3600L) public class PromptConfigController extends Object
用户提示词配置管理
Author:
Makoto
  • Constructor Details

  • Method Details

    • saveConfig

      @PostMapping("/save") public org.springframework.http.ResponseEntity<Map<String,Object>> saveConfig(@RequestBody PromptConfigDTO configDTO)
      创建或更新提示词配置
      Parameters:
      configDTO - 配置数据
      Returns:
      操作结果
    • getConfig

      @GetMapping("/{id}") public org.springframework.http.ResponseEntity<Map<String,Object>> getConfig(@PathVariable String id)
      根据ID获取配置
      Parameters:
      id - 配置ID
      Returns:
      配置信息
    • getAllConfigs

      @GetMapping("/list") public org.springframework.http.ResponseEntity<Map<String,Object>> getAllConfigs()
      获取所有配置列表
      Returns:
      配置列表
    • getConfigsByType

      @GetMapping("/list-by-type/{promptType}") public org.springframework.http.ResponseEntity<Map<String,Object>> getConfigsByType(@PathVariable String promptType)
      根据提示词类型获取配置列表
      Parameters:
      promptType - 提示词类型
      Returns:
      配置列表
    • getActiveConfig

      @GetMapping("/active/{promptType}") public org.springframework.http.ResponseEntity<Map<String,Object>> getActiveConfig(@PathVariable String promptType)
      获取当前启用的配置
      Parameters:
      promptType - 提示词类型
      Returns:
      当前启用的配置
    • deleteConfig

      @DeleteMapping("/{id}") public org.springframework.http.ResponseEntity<Map<String,Object>> deleteConfig(@PathVariable String id)
      删除配置
      Parameters:
      id - 配置ID
      Returns:
      操作结果
    • enableConfig

      @PostMapping("/{id}/enable") public org.springframework.http.ResponseEntity<Map<String,Object>> enableConfig(@PathVariable String id)
      启用指定配置
      Parameters:
      id - 配置ID
      Returns:
      操作结果
    • disableConfig

      @PostMapping("/{id}/disable") public org.springframework.http.ResponseEntity<Map<String,Object>> disableConfig(@PathVariable String id)
      禁用指定配置
      Parameters:
      id - 配置ID
      Returns:
      操作结果
    • getSupportedPromptTypes

      @GetMapping("/types") public org.springframework.http.ResponseEntity<Map<String,Object>> getSupportedPromptTypes()
      获取支持的提示词类型列表
      Returns:
      提示词类型列表