mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-11 10:37:20 +00:00
feat: mcp测试版
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
package org.ruoyi.mcp.service;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.ruoyi.system.domain.vo.SysUserVo;
|
||||
import org.ruoyi.system.mapper.SysUserMapper;
|
||||
import org.springframework.ai.tool.annotation.Tool;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -10,18 +7,14 @@ import org.springframework.stereotype.Service;
|
||||
* @author ageer
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class McpCustomService {
|
||||
|
||||
private final SysUserMapper userMapper;
|
||||
|
||||
public record User(String userName, Double userBalance) {
|
||||
public record User(String userName, String userBalance) {
|
||||
}
|
||||
|
||||
@Tool(description = "根据用户名称查询用户信息")
|
||||
public User getUserBalance(String username) {
|
||||
SysUserVo sysUserVo = userMapper.selectUserByUserName(username);
|
||||
return new User(sysUserVo.getUserName(),sysUserVo.getUserBalance());
|
||||
return new User("admin","99.99");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user