api key功能开发

This commit is contained in:
lu7213 committed 2026-10-09 03:12:37 -04:00
1 parent e6ad3bd85c
commit bc772b8b15
8 files changed
+109 -37

No files matched your search

@@ -22,7 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAppApiKeysList" parameterType="AppApiKeys" resultMap="AppApiKeysResult">
<include refid="selectAppApiKeysVo"/>
<where>
<where>
and deleted_at is null
<if test="appId != null "> and app_id = #{appId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="apiSecret != null and apiSecret != ''"> and api_secret = #{apiSecret}</if>
@@ -33,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAppApiKeysById" parameterType="Long" resultMap="AppApiKeysResult">
<include refid="selectAppApiKeysVo"/>
where id = #{id}
where id = #{id} and deleted_at is null
</select>
<insert id="insertAppApiKeys" parameterType="AppApiKeys" useGeneratedKeys="true" keyProperty="id">
@@ -72,7 +73,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deletedAt != null">deleted_at = #{deletedAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
where id = #{id} and deleted_at is null
</update>
<update id="softDeleteByIds">
update app_api_keys
set status = 0, deleted_at = #{deletedAt}, updated_at = #{deletedAt}
where deleted_at is null and id in
<foreach item="id" collection="ids" open="(" separator="," close=")">#{id}</foreach>
</update>
<delete id="deleteAppApiKeysById" parameterType="Long">
@@ -85,4 +93,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>