新增 KeyboardUserReq DTO、Mapper updateByuid 方法及对应 XML,支持昵称/性别/头像/邮箱字段动态更新;补充 USER_INFO_UPDATE_FAILED 错误码,并在 UserController 与 UserServiceImpl 实现 updateUserInfo 逻辑。
37 lines
1.9 KiB
XML
37 lines
1.9 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.KeyboardUserMapper">
|
|
<resultMap id="BaseResultMap" type="com.yolo.keyborad.model.entity.KeyboardUser">
|
|
<!--@mbg.generated-->
|
|
<!--@Table keyboard_user-->
|
|
<id column="id" jdbcType="BIGINT" property="id" />
|
|
<result column="uid" jdbcType="BIGINT" property="uid" />
|
|
<result column="nick_name" jdbcType="VARCHAR" property="nickName" />
|
|
<result column="gender" jdbcType="INTEGER" property="gender" />
|
|
<result column="avatar_url" jdbcType="VARCHAR" property="avatarUrl" />
|
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
|
<result column="deleted" jdbcType="BOOLEAN" property="deleted" />
|
|
<result column="email" jdbcType="VARCHAR" property="email" />
|
|
<result column="status" jdbcType="BOOLEAN" property="status" />
|
|
<result column="password" jdbcType="VARCHAR" property="password" />
|
|
<result column="subject_id" jdbcType="VARCHAR" property="subjectId" />
|
|
<result column="email_verified" jdbcType="BOOLEAN" property="emailVerified" />
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
<!--@mbg.generated-->
|
|
id, "uid", nick_name, gender, avatar_url, created_at, updated_at, deleted, email,
|
|
"status", "password", subject_id, email_verified
|
|
</sql>
|
|
|
|
<update id="updateByuid">
|
|
update keyboard_user
|
|
<set>
|
|
<if test="nickName != null">nick_name = #{nickName},</if>
|
|
<if test="gender != null">gender = #{gender},</if>
|
|
<if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
|
|
<if test="email != null">email = #{email},</if>
|
|
</set>
|
|
where uid = #{uid}
|
|
</update>
|
|
</mapper> |