解散家族增加cd限制

This commit is contained in:
tianfeng 2025-12-29 20:55:24 +08:00
parent b1f754bd38
commit 4b78e6ced8

View File

@ -1,10 +1,12 @@
package com.red.circle.other.app.command.family;
import com.red.circle.component.redis.service.RedisService;
import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.other.app.dto.cmd.family.DisbandFamilyCmd;
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
import com.red.circle.other.infra.common.family.FamilyCommon;
import com.red.circle.other.infra.common.family.FamilyNewsRecorder;
import com.red.circle.other.infra.database.cache.key.FamilyKeys;
import com.red.circle.other.infra.database.rds.entity.family.FamilyBaseInfo;
import com.red.circle.other.infra.database.rds.entity.family.FamilyMemberInfo;
import com.red.circle.other.infra.database.rds.service.family.FamilyBaseInfoService;
@ -21,6 +23,7 @@ import com.red.circle.tool.core.collection.CollectionUtils;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
@ -46,6 +49,7 @@ public class DisbandFamilyCmdExe {
private final FamilyLevelExpService familyLevelExpService;
private final FamilyMemberWeekExpService familyMemberWeekExpService;
private final FamilyMemberTotalExpService familyMemberTotalExpService;
private final RedisService redisService;
@Transactional(rollbackFor = Exception.class)
public void execute(DisbandFamilyCmd cmd) {
@ -63,6 +67,8 @@ public class DisbandFamilyCmdExe {
List<FamilyMemberInfo> allMembers = familyMemberInfoService.listByFamilyId(familyId);
notifyAllMembers(allMembers, familyId);
redisService.setString(FamilyKeys.USER_LEAVE.getKey(cmd.getReqUserId()), familyId, 1, TimeUnit.DAYS);
}
private void clearFamilyData(Long familyId) {