动态礼物新增url字段
This commit is contained in:
parent
8970cdb61c
commit
129bbe17a4
@ -116,6 +116,7 @@ public class DynamicDetailsQryExe {
|
|||||||
result.setUserAvatar(baseInfo.getUserAvatar());
|
result.setUserAvatar(baseInfo.getUserAvatar());
|
||||||
result.setUserSex(baseInfo.getUserSex());
|
result.setUserSex(baseInfo.getUserSex());
|
||||||
result.setUserNickname(baseInfo.getUserNickname());
|
result.setUserNickname(baseInfo.getUserNickname());
|
||||||
|
result.setUserProfile(userProfileAppConvertor.convertToSimpleProfile(baseInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processTag(DynamicContent dynamic, DynamicListCO result) {
|
private void processTag(DynamicContent dynamic, DynamicListCO result) {
|
||||||
|
|||||||
@ -63,6 +63,7 @@ public class DynamicGiftQryExe {
|
|||||||
listCO.setDynamicId(gift.getDynamicContentId());
|
listCO.setDynamicId(gift.getDynamicContentId());
|
||||||
listCO.setGiftId(gift.getGiftId());
|
listCO.setGiftId(gift.getGiftId());
|
||||||
listCO.setGiftQuantity(gift.getGiftQuantity());
|
listCO.setGiftQuantity(gift.getGiftQuantity());
|
||||||
|
listCO.setGiftUrl(gift.getGiftUrl());
|
||||||
listCO.setGiftUnitPrice(gift.getGiftUnitPrice());
|
listCO.setGiftUnitPrice(gift.getGiftUnitPrice());
|
||||||
listCO.setUpdateTime(gift.getUpdateTime());
|
listCO.setUpdateTime(gift.getUpdateTime());
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,8 @@ import com.red.circle.other.infra.database.rds.entity.user.user.CpBlessRecord;
|
|||||||
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.entity.user.user.CpValue;
|
import com.red.circle.other.infra.database.rds.entity.user.user.CpValue;
|
||||||
import com.red.circle.other.infra.database.rds.entity.user.user.FriendshipCard;
|
import com.red.circle.other.infra.database.rds.entity.user.user.FriendshipCard;
|
||||||
|
import com.red.circle.other.infra.database.rds.service.dynamic.DynamicContentService;
|
||||||
|
import com.red.circle.other.infra.database.rds.service.dynamic.DynamicGiftService;
|
||||||
import com.red.circle.other.infra.database.rds.service.game.GameRoomPkIntegralRecordService;
|
import com.red.circle.other.infra.database.rds.service.game.GameRoomPkIntegralRecordService;
|
||||||
import com.red.circle.other.infra.database.rds.service.game.GameRoomPkRecordService;
|
import com.red.circle.other.infra.database.rds.service.game.GameRoomPkRecordService;
|
||||||
import com.red.circle.other.infra.database.rds.service.live.RoomContributionBalanceService;
|
import com.red.circle.other.infra.database.rds.service.live.RoomContributionBalanceService;
|
||||||
@ -131,8 +133,8 @@ public class GiftCountStrategy implements GiftStrategy {
|
|||||||
private final TaskMqMessage taskMqMessage;
|
private final TaskMqMessage taskMqMessage;
|
||||||
private final SpinsUserTaskProgressService spinsUserTaskProgressService;
|
private final SpinsUserTaskProgressService spinsUserTaskProgressService;
|
||||||
private final RedisService redisService;
|
private final RedisService redisService;
|
||||||
private final com.red.circle.other.infra.database.rds.service.dynamic.DynamicContentService dynamicContentService;
|
private final DynamicContentService dynamicContentService;
|
||||||
private final com.red.circle.other.infra.database.rds.service.dynamic.DynamicGiftService dynamicGiftService;
|
private final DynamicGiftService dynamicGiftService;
|
||||||
private static final List<String> inRegionCodes = List.of("IN", "PK", "BD");
|
private static final List<String> inRegionCodes = List.of("IN", "PK", "BD");
|
||||||
private final UserRegionCacheService userRegionCacheService;
|
private final UserRegionCacheService userRegionCacheService;
|
||||||
|
|
||||||
@ -737,6 +739,13 @@ public class GiftCountStrategy implements GiftStrategy {
|
|||||||
|
|
||||||
// 获取礼物信息
|
// 获取礼物信息
|
||||||
GiftValue giftValue = runningWater.getGiftValue();
|
GiftValue giftValue = runningWater.getGiftValue();
|
||||||
|
|
||||||
|
// 获取礼物URL
|
||||||
|
String giftUrl = null;
|
||||||
|
GiftConfigDTO cache = cacheGiftConfigManagerService.getById(runningWater.getGiftId());
|
||||||
|
if (cache != null) {
|
||||||
|
giftUrl = cache.getGiftPhoto();
|
||||||
|
}
|
||||||
|
|
||||||
// 保存或更新动态礼物
|
// 保存或更新动态礼物
|
||||||
dynamicGiftService.saveOrUpdate(
|
dynamicGiftService.saveOrUpdate(
|
||||||
@ -744,13 +753,10 @@ public class GiftCountStrategy implements GiftStrategy {
|
|||||||
runningWater.getGiftId(),
|
runningWater.getGiftId(),
|
||||||
runningWater.getUserId(),
|
runningWater.getUserId(),
|
||||||
giftValue.getQuantity(),
|
giftValue.getQuantity(),
|
||||||
|
giftUrl,
|
||||||
giftValue.getUnitPrice()
|
giftValue.getUnitPrice()
|
||||||
);
|
);
|
||||||
|
|
||||||
log.info("动态礼物保存成功, dynamicContentId={}, giftId={}, userId={}, quantity={}",
|
|
||||||
runningWater.getDynamicContentId(), runningWater.getGiftId(),
|
|
||||||
runningWater.getUserId(), giftValue.getQuantity());
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("处理动态礼物失败", e);
|
log.error("处理动态礼物失败", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,11 @@ public class DynamicGiftListCO extends ClientObject {
|
|||||||
*/
|
*/
|
||||||
private Integer giftQuantity;
|
private Integer giftQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 礼物URL.
|
||||||
|
*/
|
||||||
|
private String giftUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单个礼物价值.
|
* 单个礼物价值.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -49,6 +49,12 @@ public class DynamicGift implements Serializable {
|
|||||||
@TableField("gift_quantity")
|
@TableField("gift_quantity")
|
||||||
private Integer giftQuantity;
|
private Integer giftQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 礼物URL.
|
||||||
|
*/
|
||||||
|
@TableField("gift_url")
|
||||||
|
private String giftUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单个礼物价值.
|
* 单个礼物价值.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -21,10 +21,11 @@ public interface DynamicGiftService extends BaseService<DynamicGift> {
|
|||||||
* @param giftId 礼物ID
|
* @param giftId 礼物ID
|
||||||
* @param createUser 送礼用户
|
* @param createUser 送礼用户
|
||||||
* @param quantity 数量
|
* @param quantity 数量
|
||||||
|
* @param giftUrl 礼物URL
|
||||||
* @param unitPrice 单价
|
* @param unitPrice 单价
|
||||||
*/
|
*/
|
||||||
void saveOrUpdate(Long dynamicContentId, Long giftId, Long createUser,
|
void saveOrUpdate(Long dynamicContentId, Long giftId, Long createUser,
|
||||||
Integer quantity, BigDecimal unitPrice);
|
Integer quantity, String giftUrl, BigDecimal unitPrice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询动态礼物列表(按更新时间倒序).
|
* 分页查询动态礼物列表(按更新时间倒序).
|
||||||
|
|||||||
@ -26,7 +26,7 @@ public class DynamicGiftServiceImpl extends BaseServiceImpl<DynamicGiftDAO, Dyna
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void saveOrUpdate(Long dynamicContentId, Long giftId, Long createUser,
|
public void saveOrUpdate(Long dynamicContentId, Long giftId, Long createUser,
|
||||||
Integer quantity, BigDecimal unitPrice) {
|
Integer quantity, String giftUrl, BigDecimal unitPrice) {
|
||||||
|
|
||||||
// 查询是否已存在
|
// 查询是否已存在
|
||||||
DynamicGift existing = query()
|
DynamicGift existing = query()
|
||||||
@ -40,6 +40,7 @@ public class DynamicGiftServiceImpl extends BaseServiceImpl<DynamicGiftDAO, Dyna
|
|||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
// 累加数量
|
// 累加数量
|
||||||
existing.setGiftQuantity(existing.getGiftQuantity() + quantity);
|
existing.setGiftQuantity(existing.getGiftQuantity() + quantity);
|
||||||
|
existing.setGiftUrl(giftUrl);
|
||||||
existing.setUpdateTime(now);
|
existing.setUpdateTime(now);
|
||||||
existing.setUpdateUser(createUser);
|
existing.setUpdateUser(createUser);
|
||||||
updateSelectiveById(existing);
|
updateSelectiveById(existing);
|
||||||
@ -50,6 +51,7 @@ public class DynamicGiftServiceImpl extends BaseServiceImpl<DynamicGiftDAO, Dyna
|
|||||||
newGift.setGiftId(giftId);
|
newGift.setGiftId(giftId);
|
||||||
newGift.setCreateUser(createUser);
|
newGift.setCreateUser(createUser);
|
||||||
newGift.setGiftQuantity(quantity);
|
newGift.setGiftQuantity(quantity);
|
||||||
|
newGift.setGiftUrl(giftUrl);
|
||||||
newGift.setGiftUnitPrice(unitPrice);
|
newGift.setGiftUnitPrice(unitPrice);
|
||||||
newGift.setCreateTime(now);
|
newGift.setCreateTime(now);
|
||||||
newGift.setUpdateTime(now);
|
newGift.setUpdateTime(now);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user