分区隔离-装扮商城
This commit is contained in:
@@ -837,6 +837,8 @@ public enum BusiStatus {
|
||||
AT_LEAST_ONE_CARD(5210 , " Please select at least one tarot card "),
|
||||
CHARGE_PROD_NOT_ALLOWED(5211 , " The product has been taken down and cannot be recharged "),
|
||||
TAROT_CHARGE_LIMIT(5212 , " Today, Lucky Tarot recharge consumption has reached its limit "),
|
||||
|
||||
PARTITION_ERROR(500, "该道具暂不可用"),
|
||||
;
|
||||
|
||||
|
||||
|
@@ -13,7 +13,7 @@ public class PartitionUtil {
|
||||
if (null == flag || null == partitionId) {
|
||||
return false;
|
||||
}
|
||||
return (flag & partitionId) != 0;
|
||||
return flag == 0 || ((flag & partitionId) != 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ package com.accompany.business.vo.dress;
|
||||
|
||||
import com.accompany.business.model.dress.DressShop;
|
||||
import com.accompany.common.annotation.ReplaceAppDomain;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -26,4 +27,7 @@ public class DressShopVo extends DressShop {
|
||||
@ApiModelProperty("购买赠送数量")
|
||||
private Integer userDonateNum;
|
||||
|
||||
@JsonIgnore
|
||||
private Integer partitionFlag;
|
||||
|
||||
}
|
||||
|
@@ -9,14 +9,14 @@ import java.util.List;
|
||||
|
||||
public interface DressShopMapper extends BaseMapper<DressShop> {
|
||||
|
||||
List<DressShopVo> getDressShopNameplateList(@Param("idList") List<Integer> idList, @Param("dressType") Byte dressType);
|
||||
List<DressShopVo> getDressShopNameplateList(@Param("idList") List<Integer> idList, @Param("dressType") Byte dressType, @Param("partitionId") Integer partitionId);
|
||||
|
||||
List<DressShopVo> getDressShopHeadwearList(@Param("idList") List<Integer> idList, @Param("dressType") Byte dressType);
|
||||
List<DressShopVo> getDressShopHeadwearList(@Param("idList") List<Integer> idList, @Param("dressType") Byte dressType, @Param("partitionId") Integer partitionId);
|
||||
|
||||
List<DressShopVo> getDressShopCarGoodsList(@Param("idList") List<Integer> idList, @Param("dressType") Byte dressType);
|
||||
List<DressShopVo> getDressShopCarGoodsList(@Param("idList") List<Integer> idList, @Param("dressType") Byte dressType, @Param("partitionId") Integer partitionId);
|
||||
|
||||
List<DressShopVo> getDressShopInfoCardList(@Param("idList") List<Integer> idList, @Param("dressType") Byte dressType);
|
||||
List<DressShopVo> getDressShopInfoCardList(@Param("idList") List<Integer> idList, @Param("dressType") Byte dressType, @Param("partitionId") Integer partitionId);
|
||||
|
||||
List<DressShopVo> getDressShopChatBubbleList(@Param("idList") List<Integer> idList, @Param("dressType") Byte dressType);
|
||||
List<DressShopVo> getDressShopChatBubbleList(@Param("idList") List<Integer> idList, @Param("dressType") Byte dressType, @Param("partitionId") Integer partitionId);
|
||||
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@ import com.accompany.core.enumeration.BillObjTypeEnum;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
import com.accompany.core.util.PartitionUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -57,20 +58,30 @@ public class DressShopService extends BaseService {
|
||||
@Autowired
|
||||
private SendSysMsgService sendSysMsgService;
|
||||
|
||||
|
||||
public List<DressShopVo> getDressShopListByUid(Long uid, Byte dressType) {
|
||||
Users u = usersService.getUsersByUid(uid);
|
||||
if (null == u){
|
||||
throw new ServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
return getDressShopList(u.getPartitionId(), dressType, null);
|
||||
}
|
||||
|
||||
public List<DressShopVo> getDressShopList(Byte dressType, List<Integer> idList) {
|
||||
return getDressShopList(null, dressType, idList);
|
||||
}
|
||||
|
||||
public List<DressShopVo> getDressShopList(Integer partitionId, Byte dressType, List<Integer> idList) {
|
||||
List<DressShopVo> list = new LinkedList<>();
|
||||
if(DressShopTypeEnum.NAMEPLATE.getDressType().equals(dressType)){
|
||||
list = dressShopMapper.getDressShopNameplateList(idList, DressShopTypeEnum.NAMEPLATE.getDressType());
|
||||
list = dressShopMapper.getDressShopNameplateList(idList, dressType, partitionId);
|
||||
} else if(DressShopTypeEnum.HEADWEAR.getDressType().equals(dressType)){
|
||||
list = dressShopMapper.getDressShopHeadwearList(idList, DressShopTypeEnum.HEADWEAR.getDressType());
|
||||
list = dressShopMapper.getDressShopHeadwearList(idList, dressType, partitionId);
|
||||
} else if(DressShopTypeEnum.CAR.getDressType().equals(dressType)){
|
||||
list = dressShopMapper.getDressShopCarGoodsList(idList, DressShopTypeEnum.CAR.getDressType());
|
||||
list = dressShopMapper.getDressShopCarGoodsList(idList, dressType, partitionId);
|
||||
} else if(DressShopTypeEnum.INFO_CARD.getDressType().equals(dressType)){
|
||||
list = dressShopMapper.getDressShopInfoCardList(idList, DressShopTypeEnum.INFO_CARD.getDressType());
|
||||
list = dressShopMapper.getDressShopInfoCardList(idList, dressType, partitionId);
|
||||
} else if(DressShopTypeEnum.CHAT_BUBBLE.getDressType().equals(dressType)){
|
||||
list = dressShopMapper.getDressShopChatBubbleList(idList, DressShopTypeEnum.CHAT_BUBBLE.getDressType());
|
||||
list = dressShopMapper.getDressShopChatBubbleList(idList, dressType, partitionId);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -97,8 +108,14 @@ public class DressShopService extends BaseService {
|
||||
if(targetUsers == null){
|
||||
throw new ServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
if (!users.getPartitionId().equals(targetUsers.getPartitionId())){
|
||||
throw new ServiceException(BusiStatus.PARTITION_ERROR);
|
||||
}
|
||||
}
|
||||
DressShopVo dressShopVo = dressShopList.get(0);
|
||||
if (!PartitionUtil.inPartition(dressShopVo.getPartitionFlag(), users.getPartitionId())){
|
||||
throw new ServiceException(BusiStatus.PARTITION_ERROR);
|
||||
}
|
||||
log.info("DressShopService userBuyDressShop : uid:{} targetUid:{},id:{} , dressShopBuyType:{} dressShopVo:{}", uid,targetUid,id,dressShopBuyType,JSON.toJSONString(dressShopVo));
|
||||
if(dressShopBuyType.equals(Constant.DressShopBuyType.BUY)){
|
||||
this.buyDress(uid, dressShopVo,deviceInfo);
|
||||
@@ -224,5 +241,4 @@ public class DressShopService extends BaseService {
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -40,6 +40,7 @@ import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Room;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
import com.accompany.core.util.PartitionUtil;
|
||||
import com.accompany.core.util.StringUtils;
|
||||
import com.accompany.core.vo.vip.VipBaseInfoVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -196,35 +197,6 @@ public class GiftSendService extends BaseService {
|
||||
return gift;
|
||||
}
|
||||
|
||||
/**
|
||||
* 扣库存
|
||||
*
|
||||
* @param sendUid
|
||||
* @param giftId
|
||||
* @param goldNum
|
||||
* @param giftNum
|
||||
* @param giftSource
|
||||
* @return
|
||||
*/
|
||||
private void reduceStockV4(long sendUid, int giftId, Long goldNum, int giftNum, int giftSource) {
|
||||
if (giftSource == Constant.GiftSource.COMMON || giftSource == Constant.GiftSource.ROOMPHOTO) {
|
||||
if (goldNum <= 0) {
|
||||
return;
|
||||
}
|
||||
boolean result = userPurseService.subDiamond(sendUid, goldNum.doubleValue(), BillObjTypeEnum.GIFT_ROOM_PAY.getDesc());
|
||||
if (result) {
|
||||
return;
|
||||
}
|
||||
|
||||
throw new ServiceException(BusiStatus.PURSE_MONEY_NOT_ENOUGH);
|
||||
|
||||
} else if (giftSource == Constant.GiftSource.BACKPACK) {
|
||||
userBackpackService.reduceBackpackGift(sendUid, giftId, giftNum);
|
||||
} else {
|
||||
throw new ServiceException(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扣库存
|
||||
*
|
||||
@@ -357,74 +329,6 @@ public class GiftSendService extends BaseService {
|
||||
sendSysMsgService.broadCastMsg(SystemConfig.secretaryUid, gson.toJson(attach));
|
||||
}
|
||||
|
||||
private GiftSendVo buildGiftSendVoForOne(long sendUid, long recvUid, int giftId, Gift gift, int giftNum, List<RoomGiftValueVo> giftValueVos) {
|
||||
GiftSendVo giftSendVo = new GiftSendVo();
|
||||
Users sendUser = usersService.getUsersByUid(sendUid);
|
||||
if (sendUser != null) {
|
||||
giftSendVo.setNick(sendUser.getNick());
|
||||
giftSendVo.setAvatar(sendUser.getAvatar());
|
||||
} else {
|
||||
giftSendVo.setNick(Constant.DEFAULT_NICK);
|
||||
giftSendVo.setAvatar(Constant.DEFAULT_AVATAR);
|
||||
}
|
||||
Users recvUser = usersService.getUsersByUid(recvUid);
|
||||
if (recvUser != null) {
|
||||
giftSendVo.setTargetAvatar(recvUser.getAvatar());
|
||||
giftSendVo.setTargetNick(recvUser.getNick());
|
||||
} else {
|
||||
giftSendVo.setTargetNick(Constant.DEFAULT_NICK);
|
||||
giftSendVo.setTargetAvatar(Constant.DEFAULT_AVATAR);
|
||||
}
|
||||
giftSendVo.setUid(sendUid);
|
||||
giftSendVo.setTargetUid(recvUid);
|
||||
giftSendVo.setGiftId(giftId);
|
||||
if (gift != null) {
|
||||
giftSendVo.setGift(giftService.getGiftVoByGift(gift));
|
||||
}
|
||||
giftSendVo.setGiftNum(giftNum);
|
||||
giftSendVo.setGiftValueVos(giftValueVos);
|
||||
giftSendVo.setCurrentTime(System.currentTimeMillis());
|
||||
return giftSendVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 各种送礼物(金币+萝卜+背包)
|
||||
*
|
||||
* @param sendUid
|
||||
* @param receiveUids
|
||||
* @param roomUid
|
||||
* @param giftId
|
||||
* @param giftNum
|
||||
* @param msg
|
||||
* @param giftSource
|
||||
* @param sendType
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager")
|
||||
public Object sendV4(long sendUid, Long[] receiveUids, Long roomUid, int giftId,
|
||||
int giftNum, String msg, Integer giftSource, byte sendType) {
|
||||
log.info("sendV4 param==>>> sendUid:{},recvUid:{},roomUid:{},giftId:{},giftNum:{},msg:{},giftSource:{},sendType:{}",
|
||||
sendUid, receiveUids, roomUid, giftId, giftNum, msg, giftSource, sendType);
|
||||
if (null == giftSource) {
|
||||
giftSource = Constant.GiftSource.COMMON;
|
||||
}
|
||||
Gift gift = getValidGiftById(giftId, giftSource);
|
||||
if (null == gift) {
|
||||
throw new ServiceException(BusiStatus.GIFTDOWNORNOTEXISTS);
|
||||
}
|
||||
Object result = null;
|
||||
switch (gift.getConsumeType()) {
|
||||
case Constant.GiftConsumeType.GOLD_GIFT:
|
||||
case Constant.GiftConsumeType.ROOM_FREE_GIFT:
|
||||
result = sendGiftV4(sendUid, receiveUids, roomUid, gift, giftNum, msg, giftSource, sendType);
|
||||
break;
|
||||
default:
|
||||
throw new ServiceException(BusiStatus.GIFTDOWNORNOTEXISTS);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 各种送礼物(金币+萝卜+背包)
|
||||
*
|
||||
@@ -451,6 +355,16 @@ public class GiftSendService extends BaseService {
|
||||
if (null == gift) {
|
||||
throw new ServiceException(BusiStatus.GIFTDOWNORNOTEXISTS);
|
||||
}
|
||||
|
||||
Users u = usersService.getUsersByUid(sendUid);
|
||||
if (null == u){
|
||||
throw new ServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
|
||||
if (!PartitionUtil.inPartition(gift.getPartitionFlag(), u.getPartitionId())){
|
||||
throw new ServiceException(BusiStatus.PARTITION_ERROR);
|
||||
}
|
||||
|
||||
Object result = null;
|
||||
switch (gift.getConsumeType()) {
|
||||
case Constant.GiftConsumeType.GOLD_GIFT:
|
||||
@@ -491,7 +405,7 @@ public class GiftSendService extends BaseService {
|
||||
Object result = null;
|
||||
switch (gift.getConsumeType()) {
|
||||
case Constant.GiftConsumeType.GOLD_GIFT:
|
||||
result = sendGiftV4(sendUid, receiveUids, roomUid, gift, giftNum, msg, giftSource, sendType);
|
||||
result = sendGiftV5(sendUid, receiveUids, roomUid, gift, giftNum, msg, giftSource, sendType);
|
||||
break;
|
||||
default:
|
||||
throw new ServiceException(BusiStatus.GIFTDOWNORNOTEXISTS);
|
||||
@@ -499,93 +413,6 @@ public class GiftSendService extends BaseService {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 各种送礼物
|
||||
*
|
||||
* @param sendUid
|
||||
* @param recvUids
|
||||
* @param roomUid
|
||||
* @param gift
|
||||
* @param giftNum
|
||||
* @param msg
|
||||
* @param giftSource
|
||||
* @param sendType
|
||||
* @return
|
||||
*/
|
||||
private Object sendGiftV4(long sendUid, Long[] recvUids, Long roomUid, Gift gift, int giftNum, String msg, int giftSource, byte sendType) {
|
||||
// 批量查询用户
|
||||
String[] uidsArray = new String[recvUids.length + 1];
|
||||
boolean flag = false; // 给自己送礼标识
|
||||
for (int i = 0; i < recvUids.length; i++) {
|
||||
uidsArray[i] = recvUids[i].toString();
|
||||
if (recvUids[i] == sendUid) flag = true;
|
||||
}
|
||||
uidsArray[recvUids.length] = String.valueOf(sendUid);
|
||||
Map<Long, Users> usersMap = usersService.getUsersMapBatch(uidsArray);
|
||||
// 校验用户是否都存在或者收礼用户是否重复
|
||||
if (!flag && usersMap.size() != recvUids.length + 1) {
|
||||
throw new ServiceException(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
if (flag && usersMap.size() != recvUids.length) {
|
||||
throw new ServiceException(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
|
||||
Room room = null;
|
||||
if (sendType == Constant.SendGiftType.room
|
||||
|| sendType == Constant.SendGiftType.roomToperson
|
||||
|| sendType == Constant.SendGiftType.pubRoomToPerson
|
||||
|| sendType == Constant.SendGiftType.unlockRoomPhoto) {
|
||||
Assert.notNull(roomUid, "roomUid is null");
|
||||
// 获取当前房间的信息,若不存在则返回
|
||||
room = roomService.getRoomByUid(roomUid);
|
||||
if (room == null) {
|
||||
log.error("room is null");
|
||||
throw new ServiceException(BusiStatus.ROOMNOTEXIST);
|
||||
}
|
||||
}
|
||||
|
||||
if ((gift.getGiftType() != null && gift.getGiftType() == Constant.GiftType.CARDS)
|
||||
|| gift.getConsumeType() == Constant.GiftConsumeType.RADISH_GIFT) {
|
||||
throw new ServiceException(BusiStatus.GIFT_IS_NOT_ALLOWED_TO_BE_SENT);
|
||||
}
|
||||
|
||||
// 校验贵族礼物(只有面板送礼才需要校验)
|
||||
if (Constant.GiftType.VIP_GIFT == gift.getGiftType() && giftSource == Constant.GiftSource.COMMON) {
|
||||
checkCanSendVipGift(gift, sendUid);
|
||||
}
|
||||
|
||||
// 扣除用户余额
|
||||
Long giftPrice = gift.getGoldPrice();
|
||||
Long everyGoldNum = Math.abs(giftPrice * giftNum); // 礼物金币总数,相对于每一次发送者
|
||||
Long totalGoldNum = Math.abs(everyGoldNum * recvUids.length); // 礼物金币总数,
|
||||
// 礼物钻石总数,相对于每一个接收者
|
||||
int totalGiftNum = giftNum * recvUids.length; //礼物总数
|
||||
|
||||
reduceStockV4(sendUid, gift.getGiftId(), totalGoldNum, totalGiftNum, giftSource);
|
||||
|
||||
// 福袋礼物
|
||||
if (gift.getGiftType() == Constant.GiftType.LUCKY_BAG) {
|
||||
return sendLuckyBagGift(sendUid, Arrays.asList(recvUids), room, gift, giftNum, msg, giftSource, sendType, usersMap);
|
||||
} else if (gift.getGiftType() == Constant.GiftType.LUCKY_BAG_LINEAR) {
|
||||
return sendLuckyBagLinearGift(sendUid, Arrays.asList(recvUids), room, gift, giftNum, msg, giftSource, sendType, usersMap);
|
||||
} else if (gift.getGiftType() == Constant.GiftType.SUPER_LUCKY) {
|
||||
superLuckyGiftSendService.draw(sendUid, room, Arrays.asList(recvUids), gift, giftNum);
|
||||
}
|
||||
|
||||
// 下面是赠送普通礼物
|
||||
// 循环发送礼物消息到MQ处理(加钻石、写DB记录)
|
||||
for (int i = 0; i < recvUids.length; i++) {
|
||||
sendGiftMessage2MQ(sendUid, recvUids[i], roomUid, gift.getGiftId(), gift.getConsumeType(), gift.getGiftType(), giftNum, everyGoldNum,
|
||||
sendType, room != null ? room.getType() : null, msg, giftSource, false);
|
||||
}
|
||||
|
||||
Long everyGiftValue = gift.getGiftType() == Constant.GiftType.SUPER_LUCKY ?
|
||||
superLuckyGiftSendService.getConfig().getReceiverRatio().multiply(BigDecimal.valueOf(everyGoldNum)).longValue() : everyGoldNum;
|
||||
List<RoomGiftValueVo> giftValueVos = updateRoomGiftValue(room, Arrays.asList(recvUids), everyGiftValue, sendUid, true);
|
||||
return buildBatchSendGiftVo(sendUid, recvUids, gift, giftNum, giftValueVos, usersMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 各种送礼物
|
||||
*
|
||||
|
@@ -228,7 +228,7 @@ public class RoomPhotoService extends ServiceImpl<RoomPhotoMapper, RoomPhoto> {
|
||||
}
|
||||
|
||||
Long[] targetUids = {roomPhoto.getUid()};
|
||||
Object ret = giftSendService.sendV4(uid, targetUids, roomUid,
|
||||
Object ret = giftSendService.sendV5(uid, targetUids, roomUid,
|
||||
roomPhoto.getGiftId(), roomPhoto.getGiftNum(), null,
|
||||
Constant.GiftSource.ROOMPHOTO, Constant.SendGiftType.unlockRoomPhoto);
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.accompany.business.mybatismapper.dress.DressShopMapper">
|
||||
|
||||
<select id="getDressShopNameplateList" resultType="com.accompany.business.vo.dress.DressShopVo">
|
||||
SELECT ds.id,ds.dress_id,ds.dress_price,ds.dress_day,ds.dress_type,na.icon_pic as 'pic',na.name,ds.dress_seq,ds.dress_limit_status
|
||||
SELECT ds.id,ds.dress_id,ds.dress_price,ds.dress_day,ds.dress_type,na.icon_pic as 'pic',na.name,ds.dress_seq,ds.dress_limit_status,ds.partition_flag
|
||||
FROM dress_shop ds,nameplate na
|
||||
where ds.dress_id = na.id and na.`status` = 1 and ds.dress_type = #{dressType}
|
||||
<if test="idList != null and idList.size() > 0">
|
||||
@@ -12,11 +12,14 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="partitionId != null">
|
||||
and (na.partition_flag = 0 or na.partition_flag & #{partitionId} != 0)
|
||||
</if>
|
||||
ORDER BY ds.dress_seq desc
|
||||
</select>
|
||||
|
||||
<select id="getDressShopHeadwearList" resultType="com.accompany.business.vo.dress.DressShopVo">
|
||||
SELECT ds.id,ds.dress_id,ds.dress_price,ds.dress_day,ds.dress_type,hd.pic,hd.name,ds.dress_seq,ds.dress_limit_status
|
||||
SELECT ds.id,ds.dress_id,ds.dress_price,ds.dress_day,ds.dress_type,hd.pic,hd.name,ds.dress_seq,ds.dress_limit_status,hd.partition_flag
|
||||
FROM dress_shop ds,headwear hd
|
||||
where ds.dress_id = hd.headwear_id and hd.noble_limit = 0 and hd.`enable` =1 and ds.dress_type = #{dressType}
|
||||
<if test="idList != null and idList.size() > 0">
|
||||
@@ -25,11 +28,14 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="partitionId != null">
|
||||
and (hd.partition_flag = 0 or hd.partition_flag & #{partitionId} != 0)
|
||||
</if>
|
||||
ORDER BY ds.dress_seq desc;
|
||||
</select>
|
||||
|
||||
<select id="getDressShopCarGoodsList" resultType="com.accompany.business.vo.dress.DressShopVo">
|
||||
SELECT ds.id,ds.dress_id,ds.dress_price,ds.dress_day,ds.dress_type,cg.pic,cg.name,ds.dress_seq,ds.dress_limit_status
|
||||
SELECT ds.id,ds.dress_id,ds.dress_price,ds.dress_day,ds.dress_type,cg.pic,cg.name,ds.dress_seq,ds.dress_limit_status,cg.partition_flag
|
||||
FROM dress_shop ds,car_goods cg
|
||||
where ds.dress_id = cg.id and cg.`enable` = 2 and cg.car_goods_type = 1 and ds.dress_type = #{dressType}
|
||||
and cg.is_activity_limit = 0 and cg.is_noble_limit = 0 and cg.is_monster_limit = 0 and cg.is_week_star_limit = 0
|
||||
@@ -39,11 +45,14 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="partitionId != null">
|
||||
and (hd.partition_flag = 0 or cg.partition_flag & #{partitionId} != 0)
|
||||
</if>
|
||||
ORDER BY ds.dress_seq desc;
|
||||
</select>
|
||||
|
||||
<select id="getDressShopInfoCardList" resultType="com.accompany.business.vo.dress.DressShopVo">
|
||||
SELECT ds.id,ds.dress_id,ds.dress_price,ds.dress_day,ds.dress_type,ic.pic,ic.name,ds.dress_seq,ds.dress_limit_status
|
||||
SELECT ds.id,ds.dress_id,ds.dress_price,ds.dress_day,ds.dress_type,ic.pic,ic.name,ds.dress_seq,ds.dress_limit_status,ic.partition_flag
|
||||
FROM dress_shop ds,info_card ic
|
||||
where ds.dress_id = ic.id and ic.`status` = 1 and ic.type = 1 and ds.dress_type = #{dressType}
|
||||
<if test="idList != null and idList.size() > 0">
|
||||
@@ -52,11 +61,14 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="partitionId != null">
|
||||
and (ic.partition_flag = 0 or ic.partition_flag & #{partitionId} != 0)
|
||||
</if>
|
||||
ORDER BY ds.dress_seq desc;
|
||||
</select>
|
||||
|
||||
<select id="getDressShopChatBubbleList" resultType="com.accompany.business.vo.dress.DressShopVo">
|
||||
SELECT ds.id,ds.dress_id,ds.dress_price,ds.dress_day,ds.dress_type,cb.ios_url as 'pic',cb.name,ds.dress_seq,ds.dress_limit_status
|
||||
SELECT ds.id,ds.dress_id,ds.dress_price,ds.dress_day,ds.dress_type,cb.ios_url as 'pic',cb.name,ds.dress_seq,ds.dress_limit_status,cb.partition_flag
|
||||
FROM dress_shop ds,chat_bubble cb
|
||||
where ds.dress_id = cb.id and cb.`status` = 1 and cb.type = 1 and ds.dress_type = #{dressType}
|
||||
<if test="idList != null and idList.size() > 0">
|
||||
@@ -65,6 +77,9 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="partitionId != null">
|
||||
and (ic.parititon_flag = 0 or cb.partition_flag & #{partitionId} != 0)
|
||||
</if>
|
||||
ORDER BY ds.dress_seq desc;
|
||||
</select>
|
||||
|
||||
|
@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -29,8 +30,10 @@ public class DressShopController extends BaseController {
|
||||
|
||||
@ApiOperation("获取装扮商城列表")
|
||||
@GetMapping("/list")
|
||||
public BaseResponseVO<List<DressShopVo>> getDressShopListVo(Byte dressType){
|
||||
List<DressShopVo> dressShopList = dressShopService.getDressShopList(dressType, null);
|
||||
@Authorization
|
||||
public BaseResponseVO<List<DressShopVo>> getDressShopListVo(Byte dressType, HttpServletRequest request){
|
||||
Long uid = getUid(request);
|
||||
List<DressShopVo> dressShopList = dressShopService.getDressShopListByUid(uid, dressType);
|
||||
return new BaseResponseVO<>(dressShopList);
|
||||
}
|
||||
|
||||
|
@@ -49,57 +49,6 @@ public class GiftV2Controller extends BaseController {
|
||||
|
||||
private RateLimiter sendAllLimiter = RateLimiter.create(1500.0); // 1秒1500并发
|
||||
|
||||
/**
|
||||
* 送礼物接口(金币+萝卜+背包)
|
||||
*
|
||||
* @param targetUids
|
||||
* @param roomUid
|
||||
* @param giftId
|
||||
* @param giftNum
|
||||
* @param sendType
|
||||
* @param msg
|
||||
* @param giftSource
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/sendV4", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@CancelUidTag(paramName = {"targetUids"})
|
||||
public BusiResult<Object> sendV4(@RequestParam(value = "targetUids") Long[] targetUids,
|
||||
Long roomUid,
|
||||
int giftId,
|
||||
int giftNum,
|
||||
byte sendType,
|
||||
String msg,
|
||||
Integer giftSource) {
|
||||
Long uid = getUid();
|
||||
logger.info("sendV4 param==>>> uid:{},targetUids:{},roomUid:{},giftId:{},giftNum:{},sendType:{},giftSource:{}",
|
||||
uid, targetUids, roomUid, giftId, giftNum, sendType, giftSource);
|
||||
if (giftNum <= 0 || targetUids == null || targetUids.length < 1) {
|
||||
return BusiResult.fail(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
if (giftNum > Constant.GIFT_SEND_MAX_NUM) {
|
||||
return new BusiResult<>(BusiStatus.SEND_GIFT_NUM_TOO_LARGE);
|
||||
}
|
||||
if (Arrays.asList(targetUids).contains(uid)) {
|
||||
throw new ServiceException(BusiStatus.GIFT_SEND_MY_SELF_ERROR);
|
||||
}
|
||||
// 对接口限流
|
||||
if (!sendAllLimiter.tryAcquire(5, TimeUnit.SECONDS)) {
|
||||
return new BusiResult<>(BusiStatus.SERVERBUSY);
|
||||
}
|
||||
if (StringUtils.isNotBlank(msg) && YidunCheckUtil.checkHasSensitiveWord(msg)) {
|
||||
return new BusiResult<>(BusiStatus.HAS_SENSITIVE);
|
||||
}
|
||||
try {
|
||||
return new BusiResult<>(giftSendService.sendV4(uid, targetUids, roomUid, giftId, giftNum, msg, giftSource, sendType));
|
||||
} catch (Exception e) {
|
||||
logger.error("sendV4 error param==>>> uid:{},targetUids:{},roomUid:{},giftId:{},giftNum:{},sendType:{},giftSource:{}",
|
||||
uid, targetUids, roomUid, giftId, giftNum, sendType, giftSource, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 送礼物接口(金币+萝卜+背包)
|
||||
*
|
||||
|
@@ -67,7 +67,7 @@ public class SpecialGiftController {
|
||||
}
|
||||
Long uid = UidContextHolder.get();
|
||||
int giftNum = 1;
|
||||
return BusiResult.success(giftSendService.sendV4(uid, new Long[]{targetId}, null, giftId, giftNum, null, Constant.GiftSource.COMMON, Constant.SendGiftType.person));
|
||||
return BusiResult.success(giftSendService.sendV5(uid, new Long[]{targetId}, null, giftId, giftNum, null, Constant.GiftSource.COMMON, Constant.SendGiftType.person));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user