增加丢失代码
parent
91080b333b
commit
b2b03eb17a
|
@ -0,0 +1,42 @@
|
||||||
|
package com.ljsd.jieling.handler.activity;
|
||||||
|
|
||||||
|
import com.google.protobuf.GeneratedMessage;
|
||||||
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
|
import com.ljsd.jieling.util.CBean2Proto;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import rpc.protocols.CommonProto;
|
||||||
|
import rpc.protocols.HeroInfoProto;
|
||||||
|
import rpc.protocols.MessageTypeProto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class GetBeautyBagCardInfoHandler extends BaseHandler<HeroInfoProto.beautyBagWishEquipRequest> {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.beautyBagWishEquipRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GeneratedMessage processWithProto(int uid, HeroInfoProto.beautyBagWishEquipRequest proto) throws Exception {
|
||||||
|
// 用户信息
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
if (user == null) {
|
||||||
|
throw new ErrorCodeException(ErrorCode.UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (proto != null && proto.getInfoListCount() > 0){
|
||||||
|
HeroLogic.getInstance().updateBeautyBagCardInfo(user,proto.getInfoListList());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
List<CommonProto.beautyBagCardInfo> wishCard = CBean2Proto.getBeautyBagCardInfo(user);
|
||||||
|
return HeroInfoProto.beautyBagWishEquipResponse.newBuilder().addAllInfoList(wishCard).build();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue