Files
keyboard_backend/src/main/resources/mapper/KeyboardUserCallLogMapper.xml
ziin 86738e3d1b feat(chat): 新增聊天调用日志与动态配置支持
- 新增 KeyboardUserCallLog 实体及对应 Mapper、Service,用于记录每次聊天请求的模型、token、耗时、错误码等
- ChatController.talk() 在流式输出前后采集元数据,异步落库,支持错误码记录
- AppConfig 新增 QdrantConfig,支持 vectorSearchLimit 动态配置
- QdrantVectorService 改为从 Nacos 动态读取搜索条数,替代硬编码 limit=1
- UserController 登出时先清除用户会话再清除 token,避免并发异常
2025-12-17 15:03:23 +08:00

25 lines
1.4 KiB
XML

<?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.KeyboardUserCallLogMapper">
<resultMap id="BaseResultMap" type="com.yolo.keyborad.model.entity.KeyboardUserCallLog">
<!--@mbg.generated-->
<!--@Table keyboard_user_call_log-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="request_id" jdbcType="VARCHAR" property="requestId" />
<result column="feature" jdbcType="VARCHAR" property="feature" />
<result column="model" jdbcType="VARCHAR" property="model" />
<result column="input_tokens" jdbcType="INTEGER" property="inputTokens" />
<result column="output_tokens" jdbcType="INTEGER" property="outputTokens" />
<result column="total_tokens" jdbcType="INTEGER" property="totalTokens" />
<result column="success" jdbcType="BOOLEAN" property="success" />
<result column="latency_ms" jdbcType="INTEGER" property="latencyMs" />
<result column="error_code" jdbcType="VARCHAR" property="errorCode" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, user_id, request_id, feature, model, input_tokens, output_tokens, total_tokens,
success, latency_ms, error_code, created_at
</sql>
</mapper>