feat(character): 新增用户人设列表接口并支持邮箱登录

- CharacterController 增加 /listByUser 端点,返回当前用户已购人设
- KeyboardCharacterService 新增 selectListByUserId(),通过 Sa-Token 取当前用户 ID
- 引入 KeyboardUserCharacter 中间表及对应 Mapper、VO
- UserController 增加 /login 端点,支持邮箱+密码登录
- 统一将实体与 VO 的 title 字段更名为 characterName
- 补充错误码 USER_NOT_FOUND,调整 Sa-Token 白名单与 Redis 依赖
This commit is contained in:
2025-12-03 16:29:06 +08:00
parent 822fe3c76d
commit c4dbc9e475
17 changed files with 214 additions and 7 deletions

View File

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.yolo.keyborad.model.entity.KeyboardCharacter">
<!--@Table keyboard_character-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="character_name" jdbcType="VARCHAR" property="characterName" />
<result column="character_background" jdbcType="VARCHAR" property="characterBackground" />
<result column="avatar_url" jdbcType="VARCHAR" property="avatarUrl" />
<result column="download" jdbcType="VARCHAR" property="download" />
@@ -16,7 +16,7 @@
<result column="rank" jdbcType="INTEGER" property="rank" />
</resultMap>
<sql id="Base_Column_List">
id, title, "character_background", avatar_url, download, tag, deleted, created_at,
id, character_name, "character_background", avatar_url, download, tag, deleted, created_at,
updated_at, prompt, "rank"
</sql>
</mapper>

View File

@@ -0,0 +1,16 @@
<?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.KeyboardUserCharacterMapper">
<resultMap id="BaseResultMap" type="com.yolo.keyborad.model.entity.KeyboardUserCharacter">
<!--@Table keyboard_user_character-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="character_id" jdbcType="BIGINT" property="characterId" />
<result column="deleted" jdbcType="BOOLEAN" property="deleted" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
</resultMap>
<sql id="Base_Column_List">
id, character_id, deleted, created_at, updated_at, user_id
</sql>
</mapper>