feat(dify): 添加服务器api
This commit is contained in:
parent
accd5221b6
commit
c5f5b1eb63
@ -0,0 +1,30 @@
|
||||
package com.zsc.edu.dify.modules.dify.controller;
|
||||
|
||||
import io.github.guoshiqiufeng.dify.server.DifyServer;
|
||||
import io.github.guoshiqiufeng.dify.server.dto.response.AppsResponseVO;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/v1/server")
|
||||
public class V1ServerController {
|
||||
|
||||
@Resource
|
||||
private DifyServer difyServer;
|
||||
|
||||
/**
|
||||
* 获取应用列表
|
||||
* @param mode 模式 chat\agent-chat\completion\advanced-chat\workflow
|
||||
* @param name 应用名称,用于过滤应用列表(可选,传入空字符串时表示不过滤)
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/apps")
|
||||
public List<AppsResponseVO> getApps(String mode, String name) {
|
||||
return difyServer.apps(mode, name);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user