| | |
| | | import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TokenUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.vo.msg.TokenVO;
|
| | |
|
| | | @Service
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public TokenVO discernToken(String token, Long uid) throws TokenRecordException {
|
| | | public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException {
|
| | | // 解析口令
|
| | | String parseToken = TokenUtil.parseToken(token);
|
| | | if (StringUtil.isNullOrEmpty(parseToken))
|
| | |
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | }
|
| | | } else if (tokenType == TokenTypeEnum.redPack) {
|
| | | if(!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | throw new TokenRecordException(1, "请升级到最新版");
|
| | | |
| | | |
| | | type = 13;
|
| | | RedPackGiveRecord giveRecord = redPackGiveRecordService.selectByPrimaryKey(Long.parseLong(identify));
|
| | | if (giveRecord == null)
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public String receiveToken(String token, Long uid) throws TokenRecordException {
|
| | | public String receiveToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException {
|
| | | if (uid == null || uid <= 0)
|
| | | throw new TokenRecordException(1, "用户未登录");
|
| | |
|
| | |
| | | }
|
| | | });
|
| | | } else if (tokenType == TokenTypeEnum.redPack) {
|
| | | if(!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | throw new TokenRecordException(1, "请升级到最新版");
|
| | | |
| | | try {
|
| | | msg = "领取红包成功,请到[我的-红包]中查看";
|
| | | // 领取红包、更新记录
|
| | |
| | | try {
|
| | | UserInfo user = userInfoService.selectByPKey(giveUid);
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | |
| | | String inviteCode = null;
|
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip())) {
|
| | | inviteCode = userInfoExtra.getInviteCodeVip();
|
| | | } else {
|
| | | inviteCode = userInfoExtra.getInviteCode();
|
| | | }
|
| | | |
| | | MsgInviteContentDTO msgInvite = new MsgInviteContentDTO();
|
| | | msgInvite.setTitle("邀请消息");
|
| | | msgInvite.setState("成功激活邀请");
|
| | | msgInvite.setCode("你的邀请码:" + userInfoExtra.getInviteCode());
|
| | | msgInvite.setCode("你的邀请码:" + inviteCode);
|
| | | msgInvite.setInviter("昵称:"+user.getNickName());
|
| | | msgInvite.setMode("成功领取邀请人的" + giftName);
|
| | | userInviteMsgNotificationService.receiveGift(uid, "邀请关系一旦确立无法更改 ", msgInvite);
|