AI智能工牌的建表语句

This commit is contained in:
spllzh
2025-08-07 22:31:05 +08:00
parent 6dfe402eed
commit 58a131e3c8
26 changed files with 817 additions and 42 deletions

View File

@@ -0,0 +1,42 @@
package com.rj.tools;
import com.rj.pojo.Reservation;
import com.rj.service.IReservationService;
import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
/**
* Author: 李中华 wx: spllzh email(qq): 28668817@qq.com
* Date: 2025/8/5 20:36
**/
@Component
public class ReservationTool {
@Autowired
private IReservationService reservationService;
@Tool("根据手机号查询志愿填报预约信息")
public String getReservationsByPhone(String phone) {
return reservationService.getReservationsByPhone(phone).toString();
}
@Tool("保存志愿填报预约信息")
public String saveReservation(String name ,
@P("考生姓名") String gender ,
@P("考生手机号")String phone ,
@P("考生手省份")String province ,
@P("考生预约时间,格式为yyy-MM-dd'T' HH:mm") String datetime) {
Reservation reservation = new Reservation();
reservation.setName(name);
reservation.setGender(gender);
reservation.setPhone(phone);
reservation.setProvince(province);
reservation.setDatetime(LocalDateTime.parse(datetime));
return reservationService.saveReservation(reservation) ? "保存成功" : "保存失败";
}
}