发放头像框处理

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