办学质量监测教学评价系统
ageer
2025-04-12 9b32e3b3b226723cd43bfa37026e1e4487f6ef69
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package org.ruoyi.mcp.service;
 
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * @author ageer
 */
@Service
public class McpCustomService {
 
 
    public record Book(List<String> isbn, String title, List<String> authorName) {
    }
 
    @Tool(description = "Get list of Books by title")
    public List<Book> getBooks(String title) {
        // 这里模拟查询DB操作
        return List.of(new Book(List.of("ISBN-888"), "SpringAI教程", List.of("熊猫助手写的书")));
    }
 
}