列表接口调整 退出接口联调
This commit is contained in:
parent
b4a3aafd1b
commit
5b6c2c5f33
@ -73,6 +73,11 @@ public enum FamilyErrorCode implements IResponseErrorCode {
|
||||
|
||||
NOT_PERMISSION_VIEW(2512, "You do not have permission to view"),
|
||||
|
||||
/**
|
||||
* 用户最近刚退出家族
|
||||
*/
|
||||
USER_RECENT_LEAVE(2513, "Your recently left a family. Please tryagain 1 day after leaving"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import com.red.circle.other.app.util.OfficialNoticeUtils;
|
||||
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
|
||||
import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway;
|
||||
import com.red.circle.other.infra.common.family.FamilyCommon;
|
||||
import com.red.circle.other.infra.database.cache.key.FamilyKeys;
|
||||
import com.red.circle.other.infra.database.rds.entity.family.FamilyMessage;
|
||||
import com.red.circle.other.infra.database.rds.service.family.FamilyMemberInfoService;
|
||||
import com.red.circle.other.infra.database.rds.service.family.FamilyMessageService;
|
||||
@ -47,6 +48,8 @@ public class ApplyJoinFamilyExe {
|
||||
|
||||
|
||||
public void execute(ApplyJoinFamilyCmd cmd) {
|
||||
String string = redisService.getString(FamilyKeys.USER_LEAVE.getKey());
|
||||
ResponseAssert.isNull(FamilyErrorCode.USER_RECENT_LEAVE, string);
|
||||
|
||||
ResponseAssert.isFalse(FamilyErrorCode.THERE_ARE_FAMILIES_ERROR, getExistFamilyByUserId(cmd));
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 家族列表查询.
|
||||
@ -34,7 +35,9 @@ public class FamilyListExe {
|
||||
public PageResult<FamilyListCO> execute(FamilyListCmd cmd) {
|
||||
Page<FamilyBaseInfo> page = new Page<>();
|
||||
IPage<FamilyBaseInfo> baseInfoIPage = familyBaseInfoService.page(page,
|
||||
Wrappers.<FamilyBaseInfo>lambdaQuery().orderByDesc(TimestampBaseEntity::getCreateTime));
|
||||
Wrappers.<FamilyBaseInfo>lambdaQuery()
|
||||
.eq(StringUtils.hasText(cmd.getFamilyAccount()), FamilyBaseInfo::getFamilyAccount, cmd.getFamilyAccount())
|
||||
.orderByDesc(TimestampBaseEntity::getCreateTime));
|
||||
|
||||
PageResult<FamilyListCO> pageResult = new PageResult<>();
|
||||
pageResult.setCurrent(page.getCurrent());
|
||||
|
||||
@ -108,7 +108,8 @@ public class FamilyServiceImpl implements FamilyService {
|
||||
|
||||
@Override
|
||||
public Long create(FamilyCreateCmd cmd) {
|
||||
return familyCreateExe.execute(cmd);
|
||||
String key = "FAMILY_CREATE_KEY" + ":" + cmd.getReqUserId();
|
||||
return distributedLockUtil.executeWithLock(key, () -> familyCreateExe.execute(cmd));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -11,4 +11,6 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class FamilyListCmd extends PageQueryCmd {
|
||||
|
||||
private String familyAccount;
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.red.circle.other.infra.common.family;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.red.circle.component.redis.service.RedisService;
|
||||
import com.red.circle.external.inner.endpoint.message.ImGroupMemberClient;
|
||||
import com.red.circle.external.inner.model.cmd.message.GroupMemberAddCmd;
|
||||
import com.red.circle.external.inner.model.cmd.message.GroupMemberRemoveCmd;
|
||||
@ -10,6 +11,7 @@ import com.red.circle.framework.core.asserts.ResponseAssert;
|
||||
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
|
||||
import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway;
|
||||
import com.red.circle.other.infra.convertor.material.BadgeInfraConvertor;
|
||||
import com.red.circle.other.infra.database.cache.key.FamilyKeys;
|
||||
import com.red.circle.other.infra.database.cache.service.other.FamilyLevelCacheService;
|
||||
import com.red.circle.other.infra.database.rds.entity.badge.BadgeBackpack;
|
||||
import com.red.circle.other.infra.database.rds.entity.badge.BadgePictureConfig;
|
||||
@ -49,6 +51,7 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -83,6 +86,7 @@ public class FamilyCommon {
|
||||
private final FamilyLevelConfigService familyLevelConfigService;
|
||||
private final BadgePictureConfigService badgePictureConfigService;
|
||||
private final FamilyMemberWeekExpService familyMemberWeekExpService;
|
||||
private final RedisService redisService;
|
||||
|
||||
|
||||
/**
|
||||
@ -538,13 +542,13 @@ public class FamilyCommon {
|
||||
familyMemberWeekExpService
|
||||
.deleteBySysOriginMemberId(member.getId(), member.getSysOrigin());
|
||||
|
||||
deleteFamilyAwardByUserId(member.getMemberUserId());
|
||||
userProfileGateway.removeUseProps(member.getMemberUserId(),
|
||||
PropsCommodityType.AVATAR_FRAME.name());
|
||||
redisService.setString(FamilyKeys.USER_LEAVE.getKey(), member.getMemberUserId(), 1, TimeUnit.DAYS);
|
||||
// deleteFamilyAwardByUserId(member.getMemberUserId());
|
||||
// userProfileGateway.removeUseProps(member.getMemberUserId(),PropsCommodityType.AVATAR_FRAME.name());
|
||||
|
||||
userProfileGateway.removeCacheAll(member.getMemberUserId());
|
||||
// userProfileGateway.removeCacheAll(member.getMemberUserId());
|
||||
|
||||
removeGroup(member.getFamilyId(), member.getMemberUserId());
|
||||
// removeGroup(member.getFamilyId(), member.getMemberUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -26,7 +26,14 @@ public enum FamilyKeys implements RedisKeys {
|
||||
/**
|
||||
* 周奖励开始结束时间 周一 / 周日.
|
||||
*/
|
||||
FAMILY_WEEK_REWARD_TIME;
|
||||
FAMILY_WEEK_REWARD_TIME,
|
||||
|
||||
/**
|
||||
* 用户离开家族
|
||||
*/
|
||||
USER_LEAVE,
|
||||
|
||||
;
|
||||
|
||||
@Override
|
||||
public String businessPrefix() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user