设置--添加--APP 注销账号

This commit is contained in:
haotian 2025-02-11 15:15:08 +08:00
parent 399b55d3ef
commit 47c54503ee
5 changed files with 44 additions and 1 deletions

View File

@ -1579,7 +1579,7 @@ public class AppSystemController extends BaseController {
public TableDataInfo addFollowerList()
{
Long userId = getUserId();
startPage();
List<FollowerListDto> addFollowerList = userFollowService.getAddFollowerList(userId);
@ -1663,6 +1663,7 @@ public class AppSystemController extends BaseController {
// 点了之后所有的点赞信息应该已读
userNotificationService.readNotifiaction(userId, "2", "1");
startPage();
// 先从系统通知中获取
List<WorkLikeDto> addLikeList = userNotificationService.getWorkLikeList(userId);
return getDataTable(addLikeList);
@ -1918,6 +1919,25 @@ public class AppSystemController extends BaseController {
return AjaxResult.success(userMessageVo);
}
// 设置--注销账号--完全删除
@Transactional
@GetMapping("/deleteUserAccount")
public AjaxResult deleteUserAccount()
{
Long userId = getUserId();
if(sysUserService.deleteUserById(userId) > 0){
// 对所有本账号关注的人, 删除 sys_user_follow中的数据
// 现不删除其点赞数据.
userFollowService.deleteSysUserFollowUserId(userId);
return success();
}else{
return error();
}
}
}

View File

@ -90,4 +90,10 @@ public interface SysUserFollowMapper
* 获取新增关注列表
* */
public List<FollowerListDto> getAddFollowerList(Long userId);
/*
* 设置--注销账号--删除用户关注表中的数据
*/
public int deleteSysUserFollowUserId(Long userId);
}

View File

@ -89,4 +89,9 @@ public interface ISysUserFollowService
* 获取新增关注列表
* */
public List<FollowerListDto> getAddFollowerList(Long userId);
/*
* 设置--注销账号--清除本人关注数据
* */
public int deleteSysUserFollowUserId(Long userId);
}

View File

@ -141,4 +141,12 @@ public class SysUserFollowServiceImpl implements ISysUserFollowService
public List<FollowerListDto> getAddFollowerList(Long userId){
return sysUserFollowMapper.getAddFollowerList(userId);
}
/*
* 设置--注销账号--清除本人关注数据
* */
@Override
public int deleteSysUserFollowUserId(Long userId){
return sysUserFollowMapper.deleteSysUserFollowUserId(userId);
}
}

View File

@ -104,6 +104,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteSysUserFollowUserId" parameterType="Long">
delete from sys_user_follow where user_id = #{userId}
</delete>
<delete id="deleteSysUserFollowById" parameterType="Long">
delete from sys_user_follow where id = #{id}
</delete>