|
|
@@ -9,6 +9,9 @@ import cn.hutool.core.lang.Assert;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.http.HttpResponse;
|
|
|
+import cn.hutool.http.HttpUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.cyksj.common.constant.Constant;
|
|
|
@@ -30,10 +33,7 @@ import com.cyksj.mapper.sys.SysConfigMapper;
|
|
|
import com.cyksj.mapper.sys.SysEmailMapper;
|
|
|
import com.cyksj.mapper.vip.VipGoodsSkuMapper;
|
|
|
import com.cyksj.mapper.vip.VipUserMapper;
|
|
|
-import com.cyksj.model.dto.ErrorNetflixChangeOtherSkuTicketDto;
|
|
|
-import com.cyksj.model.dto.NetflixRecoverReceivedGptConditionDto;
|
|
|
-import com.cyksj.model.dto.OrderRefundDto;
|
|
|
-import com.cyksj.model.dto.TicketChangeDto;
|
|
|
+import com.cyksj.model.dto.*;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.manage.views.AccountView;
|
|
|
import com.cyksj.model.manage.views.GroupsRelationView;
|
|
|
@@ -353,6 +353,10 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
ticket.setGptEmailPwd(null);
|
|
|
}
|
|
|
}
|
|
|
+ //邮箱授权码非必填,填的话就不显示邮箱密码
|
|
|
+ if (StrUtil.isNotEmpty(ticket.getEmailAuthCode())) {
|
|
|
+ ticket.setGptEmailPwd(null);
|
|
|
+ }
|
|
|
if (isLoginPopularize != null && isLoginPopularize) {
|
|
|
GoodsDonViews views = beanSearcher.searchFirst(GoodsDonViews.class, MapUtils.builder().field(GoodsDonViews::getId, ticket.getGoodsId()).build());
|
|
|
views.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, views.getId()).build()));
|
|
|
@@ -2692,7 +2696,41 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private GroupsRelationView checkYoutubeTime(Long relationId, Long userId) {
|
|
|
+ @Override
|
|
|
+ public String getEmailCode(long userId, Long relationId) throws Exception {
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ GroupsRelationView relationView = beanSearcher.searchFirst(GroupsRelationView.class, MapUtils.builder()
|
|
|
+ .field(GroupsRelationView::getId, relationId)
|
|
|
+ .field(GroupsRelationView::getUserId, userIdList).op(Operator.InList)
|
|
|
+ .field(GroupsRelationView::getGoodsId, Constant.GPT_PLUS_GID)
|
|
|
+ .build());
|
|
|
+ if (relationView != null && StrUtil.isNotEmpty(relationView.getEmailAuthCode())) {
|
|
|
+ String session_url = "https://mail.cpacc.us.ci/api/open";
|
|
|
+
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
+ params.putOpt("mailbox_token", relationView.getEmailAuthCode());
|
|
|
+
|
|
|
+ HttpResponse result = HttpUtil.createPost(session_url)
|
|
|
+ .header("sec-fetch-site", "same-origin")
|
|
|
+ .setConnectionTimeout(Constant.CONNECT_MILLISECONDS)
|
|
|
+ .body(params.toString())
|
|
|
+ .execute();
|
|
|
+ JSONObject jsonObject = Jsons.parseObject(result.body(), JSONObject.class);
|
|
|
+ String session = jsonObject.getStr("box_session");
|
|
|
+
|
|
|
+ String getCodeUrl = "https://mail.cpacc.us.ci/api/code";
|
|
|
+ HttpResponse execute = HttpUtil.createGet(getCodeUrl)
|
|
|
+ .header("authorization", "Bearer " + session)
|
|
|
+ .setConnectionTimeout(Constant.CONNECT_MILLISECONDS)
|
|
|
+ .execute();
|
|
|
+ MailCodeResponseDTO mailCodeResponseDTO = Jsons.parseObject(execute.body(), MailCodeResponseDTO.class);
|
|
|
+ return mailCodeResponseDTO.getData().getVerification_code();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private GroupsRelationView checkYoutubeTime(Long relationId, Long userId) {
|
|
|
List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
GroupsRelationView relationView = beanSearcher.searchFirst(GroupsRelationView.class, MapUtils.builder()
|
|
|
.field(GroupsRelationView::getId, relationId)
|