发放头像框处理

(cherry picked from commit a29a804379842b3e6e5a8e3ae62231cb7f96b7da)
This commit is contained in:
tianfeng 2026-04-29 23:51:52 +08:00
parent 209e62e7c9
commit 9728ff7a76

View File

@ -1,6 +1,7 @@
package com.red.circle.other.app.service.user; package com.red.circle.other.app.service.user;
import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum;
import com.red.circle.common.business.enums.SendPropsOrigin;
import com.red.circle.other.domain.gateway.props.ActivitySourceGroupGateway; import com.red.circle.other.domain.gateway.props.ActivitySourceGroupGateway;
import com.red.circle.other.domain.gateway.props.PropsStoreGateway; import com.red.circle.other.domain.gateway.props.PropsStoreGateway;
import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.domain.gateway.user.UserProfileGateway;
@ -10,8 +11,10 @@ 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.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.user.user.CpValueService;
import com.red.circle.other.infra.database.rds.service.props.PropsBackpackService; import com.red.circle.other.infra.database.rds.service.props.PropsBackpackService;
import com.red.circle.other.inner.endpoint.material.props.PropsBackpackClient;
import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum;
import com.red.circle.other.inner.enums.material.PropsCommodityType; import com.red.circle.other.inner.enums.material.PropsCommodityType;
import com.red.circle.other.inner.model.cmd.material.GivePropsBackpackCmd;
import com.red.circle.other.inner.model.dto.activity.props.ActivityResource; 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.activity.props.ActivityRewardProps;
import com.red.circle.other.inner.model.dto.material.props.ProductProps; import com.red.circle.other.inner.model.dto.material.props.ProductProps;
@ -43,6 +46,7 @@ public class CpLevelUpAvatarFrameService {
private final ActivitySourceGroupGateway activitySourceGroupGateway; private final ActivitySourceGroupGateway activitySourceGroupGateway;
private final PropsStoreGateway propsStoreGateway; private final PropsStoreGateway propsStoreGateway;
private final PropsBackpackService propsBackpackService; private final PropsBackpackService propsBackpackService;
private final PropsBackpackClient propsBackpackClient;
/** /**
* CP值累加后调用检测是否升级并发放对应头像框. * CP值累加后调用检测是否升级并发放对应头像框.
@ -118,17 +122,23 @@ public class CpLevelUpAvatarFrameService {
// return; // return;
// } // }
propsStoreGateway.shippingProductProps(new ProductProps() Integer days = 30;
.setInitiateUserId(userId) String type = "AVATAR_FRAME";
.setAcceptUserId(userId) GivePropsBackpackCmd cmd = new GivePropsBackpackCmd()
.setDays(DAYS) .setAcceptUserId(userId)
.setPropsOrigin("CP_LEVEL_UP_AVATAR_FRAME") .setPropsId(propsSourceId)
.setPropsOriginDesc("CP level up avatar frame grant") .setType(type)
.setPropsResources(propsResources) .setOrigin(SendPropsOrigin.LOTTERY_REWARD.name())
.setPropsPrices(BigDecimal.ZERO) .setOriginDesc(SendPropsOrigin.LOTTERY_REWARD.getDesc())
.setFree(Boolean.TRUE) .setDays(days)
); .setUseProps(Boolean.FALSE)
log.info("CP升级发放头像框, userId={}, cpUserId={}, propsSourceId={}", userId, cpUserId, propsSourceId); .setAllowGive(Boolean.FALSE)
.setOpUser(userId);
propsBackpackClient.giveProps(cmd);
// 发送通知
propsBackpackClient.givePropsNotify(userId, type, days, propsSourceId);
} }
} }