更新联系人相关功能:添加联系人控制器、服务层和Mapper实现

This commit is contained in:
bao
2026-01-13 11:22:44 +08:00
parent 4f94c43f94
commit e4f1385411
5 changed files with 140 additions and 0 deletions

View File

@@ -21,5 +21,29 @@
AND c.relation_type != 3 -- 排除黑名单
AND c.user_id != c.contact_user_id -- 排除自己
</select>
<!-- 拉黑联系人更新relation_type为3黑名单、contact_status为3已拉黑 -->
<update id="blacklistContact">
UPDATE contacts
SET relation_type = 3,
contact_status = 3,
updated_at = CURRENT_TIMESTAMP
WHERE user_id = #{userId}
AND contact_user_id = #{contactUserId}
AND contact_status != 2
</update>
<!-- 删除联系人更新contact_status为2已删除 -->
<update id="deleteContact">
UPDATE contacts
SET contact_status = 2,
updated_at = CURRENT_TIMESTAMP
WHERE user_id = #{userId}
AND contact_user_id = #{contactUserId}
AND contact_status != 2
</update>
</mapper>