cp头饰发送增加校验

(cherry picked from commit b7b181adf239737ee643511ce4109cc081aec23c)
This commit is contained in:
tianfeng 2026-04-29 20:16:21 +08:00
parent 5faf9f0713
commit b47e36fcb2

View File

@ -8,7 +8,9 @@ import com.red.circle.other.domain.model.user.UserProfile;
import com.red.circle.other.infra.database.rds.entity.user.user.CpLevelConfig;
import com.red.circle.other.infra.database.rds.entity.user.user.CpRelationship;
import com.red.circle.other.infra.database.rds.service.user.user.CpValueService;
import com.red.circle.other.infra.database.rds.service.props.PropsBackpackService;
import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum;
import com.red.circle.other.inner.enums.material.PropsCommodityType;
import com.red.circle.other.inner.model.dto.activity.props.ActivityResource;
import com.red.circle.other.inner.model.dto.activity.props.ActivityRewardProps;
import com.red.circle.other.inner.model.dto.material.props.ProductProps;
@ -38,6 +40,7 @@ public class CpLevelUpAvatarFrameService {
private final UserProfileGateway userProfileGateway;
private final ActivitySourceGroupGateway activitySourceGroupGateway;
private final PropsStoreGateway propsStoreGateway;
private final PropsBackpackService propsBackpackService;
/**
* CP值累加后调用检测是否升级并发放对应头像框.
@ -107,6 +110,11 @@ public class CpLevelUpAvatarFrameService {
return;
}
if (propsBackpackService.getUserProps(userId, propsSourceId, PropsCommodityType.AVATAR_FRAME) != null) {
log.info("CP头像框已存在背包跳过发放, userId={}, propsSourceId={}", userId, propsSourceId);
return;
}
propsStoreGateway.shippingProductProps(new ProductProps()
.setInitiateUserId(userId)
.setAcceptUserId(userId)