feat(chat): 新增AI聊天记录持久化功能
新增KeyboardAiChatMessage实体及对应Mapper、Service,在ChatServiceImpl中同步对话时保存用户与AI消息到数据库,实现聊天记录持久化
This commit is contained in:
20
src/main/resources/mapper/KeyboardAiChatMessageMapper.xml
Normal file
20
src/main/resources/mapper/KeyboardAiChatMessageMapper.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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.yolo.keyborad.mapper.KeyboardAiChatMessageMapper">
|
||||
<resultMap id="BaseResultMap" type="com.yolo.keyborad.model.entity.KeyboardAiChatMessage">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table keyboard_ai_chat_message-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="user_id" jdbcType="BIGINT" property="userId" />
|
||||
<result column="companion_id" jdbcType="BIGINT" property="companionId" />
|
||||
<result column="sender" jdbcType="SMALLINT" property="sender" />
|
||||
<result column="content" jdbcType="VARCHAR" property="content" />
|
||||
<result column="emotion_detected" jdbcType="VARCHAR" property="emotionDetected" />
|
||||
<result column="support_type" jdbcType="VARCHAR" property="supportType" />
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, user_id, companion_id, sender, content, emotion_detected, support_type, created_at
|
||||
</sql>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user