feat(lessonplan): 实现基于AI的学案自动生成与管理功能

- 新增DifyArticleClient工具类,实现基于Dify API的对话与文本生成功能
- 创建LessonPlansService接口及其实现,实现学案按天生成及存储
- 设计LessonPlansDO和StudentLessonPlansDO数据对象及对应MyBatis映射和数据库操作
- 扩展VocabularyBankDO实体及Mapper,支持查询单元词汇和学生未掌握词汇
- 利用deepoove-poi模板技术生成Word格式的学习计划文档,包含词汇、复习和练习
- 开发StringToPlanMapUtil工具类,解析AI返回结果为结构化学案内容
- 新增JUnit测试用例验证AI对话功能及学案生成逻辑正确性
- 更新Spring Boot配置,添加AI接口地址及密钥等参数
- 在前端Vue项目中新建学案页面,路由配置及导航菜单支持学案访问
This commit is contained in:
lbw
2025-12-16 19:08:58 +08:00
parent d027c9c7e6
commit 7f41036193
26 changed files with 831 additions and 5 deletions

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yinlihupo.enlish.service.domain.mapper.LessonPlansDOMapper">
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.LessonPlansDO">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="grade_id" jdbcType="VARCHAR" property="gradeId" />
<result column="unit_id" jdbcType="INTEGER" property="unitId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yinlihupo.enlish.service.domain.dataobject.LessonPlansDO">
<result column="content_details" jdbcType="LONGVARCHAR" property="contentDetails" />
</resultMap>
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
insert into lesson_plans (title, grade_id, unit_id, content_details, created_at)
values (#{title}, #{gradeId}, #{unitId}, #{contentDetails}, now())
</insert>
<select id="selectById" resultMap="ResultMapWithBLOBs">
select *
from lesson_plans
where id = #{id}
</select>
</mapper>