添加Swagger/OpenAPI依赖并更新用户账户管理相关的API文档注释,优化用户和管理员账户控制器的接口描述,移除不必要的字段和参数,调整数据库映射以简化用户账户管理逻辑。

This commit is contained in:
zyh
2025-08-24 19:21:54 +08:00
parent 1b3ce1040a
commit 4664f1c487
64 changed files with 1688 additions and 171 deletions

View File

@@ -5,9 +5,7 @@
<id property="id" column="id" />
<result property="userType" column="user_type" />
<result property="username" column="username" />
<result property="displayName" column="display_name" />
<result property="passwordHash" column="password_hash" />
<result property="role" column="role" />
<result property="status" column="status" />
<result property="pointsBalance" column="points_balance" />
<result property="createdAt" column="created_at" />
@@ -15,7 +13,7 @@
</resultMap>
<select id="findByUsernameAndType" resultMap="UserAccountMap">
SELECT id, user_type, username, display_name, password_hash, role, status, points_balance, created_at, updated_at
SELECT id, user_type, username, password_hash, status, points_balance, created_at, updated_at
FROM user_account
WHERE username = #{username}
AND user_type = #{userType}
@@ -23,30 +21,29 @@
</select>
<select id="findByUsername" resultMap="UserAccountMap">
SELECT id, user_type, username, display_name, password_hash, role, status, points_balance, created_at, updated_at
SELECT id, user_type, username, password_hash, status, points_balance, created_at, updated_at
FROM user_account
WHERE username = #{username}
LIMIT 1
</select>
<select id="findById" parameterType="long" resultMap="UserAccountMap">
SELECT id, user_type, username, display_name, password_hash, role, status, points_balance, created_at, updated_at
SELECT id, user_type, username, password_hash, status, points_balance, created_at, updated_at
FROM user_account
WHERE id = #{id}
LIMIT 1
</select>
<insert id="insert" parameterType="com.gameplatform.server.model.entity.account.UserAccount" useGeneratedKeys="true" keyProperty="id">
INSERT INTO user_account (user_type, username, display_name, password_hash, role, status, points_balance)
VALUES (#{userType}, #{username}, #{displayName}, #{passwordHash}, #{role}, #{status}, #{pointsBalance})
INSERT INTO user_account (user_type, username, password_hash, status, points_balance)
VALUES (#{userType}, #{username}, #{passwordHash}, #{status}, #{pointsBalance})
</insert>
<update id="update" parameterType="com.gameplatform.server.model.entity.account.UserAccount">
UPDATE user_account
<set>
<if test="displayName != null">display_name = #{displayName},</if>
<if test="role != null">role = #{role},</if>
<if test="status != null">status = #{status},</if>
<if test="pointsBalance != null">points_balance = #{pointsBalance},</if>
</set>
WHERE id = #{id}
</update>
@@ -64,22 +61,20 @@
<where>
<if test="userType != null and userType != ''">AND user_type = #{userType}</if>
<if test="status != null and status != ''">AND status = #{status}</if>
<if test="role != null and role != ''">AND role = #{role}</if>
<if test="keyword != null and keyword != ''">
AND (username LIKE CONCAT('%', #{keyword}, '%') OR display_name LIKE CONCAT('%', #{keyword}, '%'))
AND username LIKE CONCAT('%', #{keyword}, '%')
</if>
</where>
</select>
<select id="listByFilter" resultMap="UserAccountMap">
SELECT id, user_type, username, display_name, password_hash, role, status, points_balance, created_at, updated_at
SELECT id, user_type, username, password_hash, status, points_balance, created_at, updated_at
FROM user_account
<where>
<if test="userType != null and userType != ''">AND user_type = #{userType}</if>
<if test="status != null and status != ''">AND status = #{status}</if>
<if test="role != null and role != ''">AND role = #{role}</if>
<if test="keyword != null and keyword != ''">
AND (username LIKE CONCAT('%', #{keyword}, '%') OR display_name LIKE CONCAT('%', #{keyword}, '%'))
AND username LIKE CONCAT('%', #{keyword}, '%')
</if>
</where>
ORDER BY id DESC