Selaa lähdekoodia

Merge branch 'mj_func_28' into pre

zoujiajian 2 vuotta sitten
vanhempi
sitoutus
9890b292ee

+ 2 - 2
netflix-common/src/main/java/com/cyksj/common/util/StringUtil.java

@@ -561,9 +561,9 @@ public final class StringUtil {
 	/**
 	 * 获取账号登录验证码
 	 */
-	public static String getVerifyCodePattern(String code) {
+	public static String getVerifyCodePattern(String code, Integer length) {
 		if (StrUtil.isNotEmpty(code)) {
-			Pattern pattern = Pattern.compile("\\d{4,}");
+			Pattern pattern = Pattern.compile(String.format("\\d{%s,}", length));
 			Matcher matcher = pattern.matcher(code);
 			while (matcher.find()) {
 				return matcher.group();

+ 43 - 0
netflix-common/src/main/java/com/cyksj/common/util/TicketCodeCommonUtil.java

@@ -0,0 +1,43 @@
+package com.cyksj.common.util;
+
+import cn.hutool.core.util.StrUtil;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: TicketCodeCommonUtil
+ * 创建者: JavaZou
+ * 创建时间:2024/5/24 15:31
+ */
+
+public class TicketCodeCommonUtil {
+	/**
+	 * 车票邮箱验证码
+	 */
+	public static String getTicketCodeStr(String body, Long goodsId) {
+		if (StrUtil.isEmpty(body)) {
+			return body;
+		}
+		String str = null;
+		if (goodsId == 33l) {
+			str = "color:#505050; font-family:adobe-clean, Helvetica Neue, Helvetica, Verdana, Arial, sans-serif;";
+		}
+		if (goodsId == 3l) {
+			str = "letter-spacing:4px; line-height:38px; mso-line-height-rule: exactly";
+		}
+		if (StrUtil.isEmpty(str)) {
+			return str;
+		}
+		int index = body.indexOf(str);
+		if (index == -1) {
+			if (goodsId == 33l) {
+				str = "X-Report-Abuse: abuse@adobe.com";
+			}
+			index = body.indexOf(str);
+		}
+		String code = StrUtil.subWithLength(body, index, 512);
+		if (StrUtil.isNotBlank(code)) {
+			code = code.replace(str, "");
+		}
+		return code;
+	}
+}

+ 18 - 0
netflix-dao/src/main/java/com/cyksj/mapper/GroupsRelationExpiryNotifyRecordMapper.java

@@ -0,0 +1,18 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.GroupsRelationExpiryNotifyRecord;
+import com.cyksj.model.views.RenewalView;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: GroupsRelationExpiryNotifyRecordMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/5/24 14:56
+ */
+public interface GroupsRelationExpiryNotifyRecordMapper extends BaseMapper<GroupsRelationExpiryNotifyRecord> {
+	void batchInsert(@Param("userId") Long userId, @Param("list") List<RenewalView> expiryTickets);
+}

+ 24 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/GroupsRelationExpiryNotifyRecord.java

@@ -0,0 +1,24 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: GroupsRelationExpiryNotifyRecord
+ * 创建者: JavaZou
+ * 创建时间:2024/5/24 14:55
+ */
+@Getter
+@Setter
+public class GroupsRelationExpiryNotifyRecord extends BaseEntity{
+	private Long userId;
+
+	private Long relationId;
+
+	private Long skuId;
+
+	private Date expiryTime;
+}

+ 4 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/OrderDon.java

@@ -290,6 +290,10 @@ public class OrderDon extends BaseEntity implements Serializable {
      */
     private String phone;
 
+    @DbIgnore
+    @TableField(exist = false)
+    private Boolean isMirror;
+
     public enum Status {
         /**
          * 订单状态

+ 12 - 0
netflix-dao/src/main/java/com/cyksj/model/views/RenewalView.java

@@ -204,4 +204,16 @@ public class RenewalView {
      */
     @DbIgnore
     private BigDecimal mjPackagePrice;
+
+    /**
+     * 用户 mj fast次数
+     */
+    @DbIgnore
+    private Integer mjUserFastNum;
+
+    /**
+     * 用户 mj relax次数
+     */
+    @DbIgnore
+    private Integer mjUserRelaxNum;
 }

+ 14 - 0
netflix-dao/src/main/resources/mapper/GroupsRelationExpiryNotifyRecordMapper.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.cyksj.mapper.GroupsRelationExpiryNotifyRecordMapper">
+
+
+    <insert id="batchInsert">
+        insert into
+        groups_relation_expiry_notify_record(`user_id`,`relation_id`,`sku_id`,`expiry_time`,`created_time`,`update_time`)
+        values
+        <foreach collection="list" item="item" separator=",">
+            (#{userId},#{item.relationId},#{item.skuId},#{item.expiryTimeStr},now(),now())
+        </foreach>
+    </insert>
+</mapper>

+ 20 - 7
netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAccountServiceImpl.java

@@ -431,11 +431,10 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
     @Override
     public void saveConversationRecord(String userToken, ConversationRequest conversationRequest) {
         LambdaQueryWrapper<ChatgptSession> wrapper = Wrappers.lambdaQuery(ChatgptSession.class);
-
+        ChatgptUser chatgptUser = chatgptUserMapper.selectOne(Wrappers.lambdaQuery(ChatgptUser.class).eq(ChatgptUser::getUserToken, userToken));
         if (StringUtils.isNotBlank(conversationRequest.getCarId())) {
             wrapper.eq(ChatgptSession::getCarId, conversationRequest.getCarId());
         } else {
-            ChatgptUser chatgptUser = chatgptUserMapper.selectOne(Wrappers.lambdaQuery(ChatgptUser.class).eq(ChatgptUser::getUserToken, userToken));
             if (chatgptUser.getSessionId() != null) {
                 wrapper.eq(ChatgptSession::getId, chatgptUser.getSessionId());
             }
@@ -454,6 +453,24 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
         chatgptUserConversationRecord.setModel(conversationRequest.getModel());
         chatgptUserConversationRecordMapper.insert(chatgptUserConversationRecord);
 
+        if(!"text-davinci-002-render-sha".equals(conversationRequest.getModel())){
+            String key = RedisService.key.CHATGPT_CONVERSATION_LIMIT.getName() + ":" + userToken;
+            long currentTimeMillis = System.currentTimeMillis();
+
+            redisService.del();
+            if(redisService.hasKey("chatgpt:team:clears_in:" + chatgptSession.getCarId())){
+                redisService.del("chatgpt:team:clears_in:" + chatgptSession.getCarId());
+            }
+            if (redisService.hasKey("chatgpt:clears_in:" + chatgptSession.getCarId())) {
+                redisService.del("chatgpt:clears_in:" + chatgptSession.getCarId());
+            }
+
+            // 如果未超过限制,记录当前请求的时间戳
+            redisService.zAdd(key, currentTimeMillis, currentTimeMillis);
+            // 设置ZSet的过期时间,窗口大小加上一段冗余时间
+            redisService.expire(key, (chatgptUser.getLimitTime() * 60 * 60) + 20);
+        }
+
         if (StringUtils.isNotBlank(chatgptSession.getCarId())) {
             updateExperienceAndScore(chatgptSession.getCarId(), !"text-davinci-002-render-sha".equals(conversationRequest.getModel()), System.currentTimeMillis());
         }
@@ -508,10 +525,6 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
             chatgptUserCarUsedRecordMapper.insert(chatgptUserCarUsedRecord);
             return conversationLimitResponse;
         } else {
-            // 如果未超过限制,记录当前请求的时间戳
-            redisService.zAdd(key, currentTimeMillis, currentTimeMillis);
-            // 设置ZSet的过期时间,窗口大小加上一段冗余时间
-            redisService.expire(key, (limitTime * 60 * 60) + 20);
             conversationLimitResponse.setLimited(false);
             return conversationLimitResponse;
         }
@@ -791,7 +804,7 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
                     .expireTime(chatgptUser.getExpireTime())
                     .limitNum(chatgptUser.getLimitNum())
                     .limitTime(chatgptUser.getLimitTime())
-                    .use(getConversationCount(chatgptUser.getUserToken(), chatgptUser.getLimitTime()))
+                    .use(Math.min(chatgptUser.getLimitNum(),getConversationCount(chatgptUser.getUserToken(), chatgptUser.getLimitTime())))
                     .build();
         } else {
             throw BusinessRuntimeException.getInstance("您还未购买该车票");

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mail/CuiQiuMailService.java

@@ -11,5 +11,5 @@ public interface CuiQiuMailService {
 	/**
 	 * 获取最新邮箱 返回验证码
 	 */
-	String getVerifyCode(String email) throws Exception;
+	String getVerifyCode(String email, Long goodsId) throws Exception;
 }

+ 20 - 10
netflix-service/src/main/java/com/cyksj/service/mail/impl/CuiQiuMailServiceImpl.java

@@ -9,6 +9,7 @@ import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.StringUtil;
+import com.cyksj.common.util.TicketCodeCommonUtil;
 import com.cyksj.model.dto.CuiQiuEmailDetailDto;
 import com.cyksj.model.dto.CuiQiuEmailDto;
 import com.cyksj.model.dto.CuiQiuEmailResultDto;
@@ -41,8 +42,10 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 	//PS 验证码官方
 	private final static String PS_ADOBE = "Adobe";
 
+	private final static String DISNEY = "Disney+";
+
 	@Override
-	public String getVerifyCode(String email) throws Exception {
+	public String getVerifyCode(String email, Long goodsId) throws Exception {
 		//获取近二十封邮件
 		String url = "https://domain-open-api.cuiqiu.com/v1/message/list";
 
@@ -67,8 +70,15 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 		list = list.stream().filter(emailInfo -> {
 			CuiQiuEmailDto.CuiQiuUser from = emailInfo.getFrom().get(0);
 			CuiQiuEmailDto.CuiQiuUser cuiQiuUser = emailInfo.getTo().get(0);
-			if (StrUtil.equals(from.getName(), PS_ADOBE) && StrUtil.equals(cuiQiuUser.getAddress(), email)) {
-				return true;
+			if (StrUtil.equalsIgnoreCase(cuiQiuUser.getAddress(), email)) {
+				//PS
+				if (goodsId == 33l && StrUtil.equals(from.getName(), PS_ADOBE)) {
+					return true;
+				}
+				//Disney
+				if (goodsId == 3l && StrUtil.equals(from.getName(), DISNEY)) {
+					return true;
+				}
 			}
 			return false;
 		}).collect(Collectors.toList());
@@ -77,7 +87,7 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 			for (CuiQiuEmailDto cuiQiuEmailDto : list) {
 				Long messageId = cuiQiuEmailDto.getId();
 				try {
-					String code = getVerifyCodeByEmail(messageId);
+					String code = getVerifyCodeByEmail(messageId, goodsId);
 					if (StrUtil.isNotBlank(code)) {
 						return code;
 					}
@@ -88,7 +98,7 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 		return null;
 	}
 
-	public String getVerifyCodeByEmail(Long messageId) throws Exception {
+	public String getVerifyCodeByEmail(Long messageId, Long goodsId) throws Exception {
 		String url = "https://domain-open-api.cuiqiu.com/v1/message/detail";
 		Map<String, Object> params = new HashMap<>();
 		params.put("token", CUI_QIU_TOKEN);
@@ -102,11 +112,11 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 		CuiQiuEmailDetailDto.Content content = cuiQiuEmailDetailDto.getData().getContent();
 
 		String contentBody = content.getBody();
-		String str = "color:#505050; font-family:adobe-clean, Helvetica Neue, Helvetica, Verdana, Arial, sans-serif;";
-		String code = StrUtil.subWithLength(contentBody, contentBody.indexOf(str), 512);
-		if (StrUtil.isNotBlank(code)) {
-			code = code.replace(str, "");
+		String code = TicketCodeCommonUtil.getTicketCodeStr(contentBody, goodsId);
+		int length = 4;
+		if (goodsId == 33l) {
+			length = 6;
 		}
-		return StringUtil.getVerifyCodePattern(code);
+		return StringUtil.getVerifyCodePattern(code, length);
 	}
 }

+ 2 - 1
netflix-service/src/main/java/com/cyksj/service/paypal/PayPalService.java

@@ -50,12 +50,13 @@ public class PayPalService{
 
 
     public String successPayment(String paymentId, String payerId,PaypalPayConfig paypalPayConfig) throws Exception {
+        log.info("paypal回调 paymentId:{},payerId:{}",paymentId,payerId);
         Payment payment = null;
         try {
             payment = this.executePayment(paymentId,payerId,paypalPayConfig.getClientId(),paypalPayConfig.getClientSecret(),paypalPayConfig.getMode());
         } catch (PayPalRESTException e) {
             log.error("支付回调失败",e);
-            return paypalPayConfig.getCancelUrl();
+            payment = Payment.get(getAPIContext(paypalPayConfig.getClientId(),paypalPayConfig.getClientSecret(),paypalPayConfig.getMode()), paymentId);
         }
 
         PayerInfo payerInfo = payment.getPayer().getPayerInfo();

+ 31 - 15
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -1,5 +1,6 @@
 package com.cyksj.service.relation.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.BetweenFormater;
 import cn.hutool.core.date.DateTime;
@@ -17,6 +18,7 @@ import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.StringUtil;
+import com.cyksj.common.util.TicketCodeCommonUtil;
 import com.cyksj.enums.GatewayApiCode;
 import com.cyksj.mapper.*;
 import com.cyksj.mapper.sys.SysEmailMapper;
@@ -29,8 +31,8 @@ import com.cyksj.service.groups.GroupsFuncService;
 import com.cyksj.service.mail.CuiQiuMailService;
 import com.cyksj.service.mail.MailService;
 import com.cyksj.service.mange.coupon.CouponCommonService;
+import com.cyksj.service.midjourney.MidjourneyAccountService;
 import com.cyksj.service.relation.GroupRelationFrontService;
-import com.cyksj.service.shop.YhShopFrontService;
 import com.cyksj.service.user.UserBindRelationService;
 import com.cyksj.service.user.UserLoginRecordService;
 import com.ejlchina.searcher.BeanSearcher;
@@ -83,7 +85,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 
 	private final OrderDonMapper orderDonMapper;
 
-	private final YhShopFrontService yhShopFrontService;
+	private final GroupsRelationExpiryNotifyRecordMapper groupsRelationExpiryNotifyRecordMapper;
 
 	private final HttpServletRequest request;
 
@@ -107,6 +109,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 
 	private final UserCertRecordMapper userCertRecordMapper;
 
+	private final MidjourneyAccountService midjourneyAccountService;
+
 	//脆球邮箱后缀
 	private final static String CUI_QIU_EMAIL_SUFFIX = "@kindvd.com";
 	private final UpgradePackageMapper upgradePackageMapper;
@@ -247,6 +251,20 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				Integer codeNum = getUserCodeNumBySkuId(ticket.getUserId(), ticket.getSkuId(), isHasVerifyCode);
 				ticket.setCodeNum(codeNum);
 			}
+			if (ticket.getGoodsId() == 26l) {
+				MidjourneyUserView search = beanSearcher.searchFirst(MidjourneyUserView.class, MapUtils.flatBuilder(request.getParameterMap())
+						.field(MidjourneyUserView::getUserId, ticket.getUserId()).field(MidjourneyUserView::getRelationId, ticket.getRelationId())
+						.onlySelect(MidjourneyUserView::getMjFastNum, MidjourneyUserView::getMjRelaxNum)
+						.build());
+				if (search == null) {
+					MidjourneyUser midjourneyUser = midjourneyAccountService.getMidjourneyUserToken(ticket.getUserId(), ticket.getRelationId());
+					ticket.setMjUserFastNum(midjourneyUser.getMjFastNum());
+					ticket.setMjUserRelaxNum(midjourneyUser.getMjRelaxNum());
+				} else {
+					ticket.setMjUserFastNum(search.getMjFastNum());
+					ticket.setMjUserRelaxNum(search.getMjRelaxNum());
+				}
+			}
 		});
 		userLoginRecordService.saveUserLoginDayRecord(userId);
 		return list;
@@ -465,8 +483,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		if (StrUtil.hasEmpty(account, password)) {
 			throw BusinessRuntimeException.getInstance("您的车票账号密码异常,请联系客服...");
 		}
-		if (renewalView.getGoodsId() == 33l && renewalView.getAccount().contains(CUI_QIU_EMAIL_SUFFIX)) {
-			return cuiQiuMailService.getVerifyCode(renewalView.getAccount());
+		if (renewalView.getAccount().contains(CUI_QIU_EMAIL_SUFFIX)) {
+			return cuiQiuMailService.getVerifyCode(renewalView.getAccount(), renewalView.getGoodsId());
 		}
 		//获取邮箱密码
 		SysEmail sysEmail = sysEmailMapper.selectOne(Wrappers.lambdaQuery(SysEmail.class)
@@ -653,7 +671,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		List<RenewalView> list = beanSearcher.searchAll(RenewalView.class, builder
 				.field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
 				.field(RenewalView::getUserId, userIds).op(Operator.InList)
-				.field("condition", String.format("(gr.expiry_time is null or gr.expiry_time > '%s')", now))
+				.field(RenewalView::getExpiryTime, now).op(Operator.GreaterThan)
 				.field(RenewalView::getStatus, List.of("validity", "overdue", "outside")).op(Operator.InList)
 				.orderBy(RenewalView::getExpiryTime).asc()
 				.onlySelect(RenewalView::getMonths, RenewalView::getExpiryTime, RenewalView::getRelationId, RenewalView::getAccount, RenewalView::getGoodsId, RenewalView::getTitle, RenewalView::getLogo, RenewalView::getImg, RenewalView::getGroupId, RenewalView::getSkuId, RenewalView::getSpecVal, RenewalView::getGoodsStatus, RenewalView::getSkuStatus)
@@ -685,6 +703,9 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			return false;
 		}).collect(Collectors.toList());
 		redisService.setNx(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId), userId, RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getTimeout());
+		if (CollUtil.isNotEmpty(expiryTickets)) {
+			groupsRelationExpiryNotifyRecordMapper.batchInsert(userId, expiryTickets);
+		}
 		return expiryTickets;
 	}
 
@@ -712,19 +733,14 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				throw BusinessRuntimeException.getInstance("查询失败,请检查是否发送了登陆码..");
 			}
 		}
-		//迪士尼
-		if (goodsId == 3) {
-			int index = body.indexOf("otp_code");
-			if (index == -1) {
-				index = body.indexOf(" 15 ");
-			}
-			code = StrUtil.subWithLength(body, index, 215);
+		if (StrUtil.isEmpty(code)) {
+			code = TicketCodeCommonUtil.getTicketCodeStr(body, goodsId);
 		}
-		//PS
+		int length = 4;
 		if (goodsId == 33l) {
-			code = StrUtil.subWithLength(body, body.indexOf("ADOBE"), 215);
+			length = 6;
 		}
-		code = StringUtil.getVerifyCodePattern(code);
+		code = StringUtil.getVerifyCodePattern(code, length);
 		if (!Validator.isNumber(code)) {
 			log.error("获取账号验证码失败:{}", StrUtil.subSufByLength(code, 512));
 			throw BusinessRuntimeException.getInstance("获取验证码失败,请重新获取..");

+ 5 - 0
netflix-web/src/main/java/com/cyksj/web/controller/market/TaskFrontController.java

@@ -1,6 +1,8 @@
 package com.cyksj.web.controller.market;
 
+import cn.hutool.core.util.StrUtil;
 import com.cyksj.common.annotation.NoSubmit;
+import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.mapper.UserMapper;
@@ -94,6 +96,9 @@ public class TaskFrontController {
 			badIntentionOpService.isBadOpLoginPhone(request, phoneReq.getPhone());
 		}
 		User user = userMapper.selectById(userId);
+		if (StrUtil.isEmpty(phoneReq.getCode())) {
+			throw BusinessRuntimeException.getInstance("请输入验证码");
+		}
 		bindTaskService.bindPhone(user, phoneReq.getPhone(), phoneReq.getCode());
 		return GatewayResponse.SUCCESS.newBuilder().toResult("绑定手机号成功");
 	}

+ 23 - 5
netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java

@@ -34,7 +34,6 @@ import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.io.OutputStream;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.LocalDateTime;
@@ -171,10 +170,6 @@ public class MirrorController {
                 return chatgptConversionLimitView;
             } else {
                 response.setStatus(200);
-                //记录提问时间,车次,标题和模型
-                TASK_EXECUTOR.execute(() -> {
-                    chatGptAccountService.saveConversationRecord(userToken, conversationRequest);
-                });
             }
             //5.获取 conversationRequest 中的model 字段,判断是否为 gpt-4 如果为gpt-4 执行 查看是否达到限制方法
             //6.如果达到限制,返回状态码 429 并返回文本 xxx
@@ -183,6 +178,29 @@ public class MirrorController {
         return new ChatgptConversionLimitView();
     }
 
+    /**
+     * 对话成功后记录次数
+     */
+    @RequestMapping("/gpt/conversation/notifyUrl")
+    public void conversationNotifyUrl(@RequestParam(value = "isCar", defaultValue = "false") Boolean isCar, @RequestBody ConversationRequest conversationRequest) {
+        //1.从request获取请求头Authorization 并取 值内 'Bearer ' 后的值为usertoken
+        String authorization = request.getHeader("Authorization");
+        String carid = request.getHeader("Carid");
+        conversationRequest.setCarId(carid);
+        String userToken = authorization.substring(7);
+        //2.根据usertoken 查询 chatgpt_user 表中的记录
+        ChatgptUser user = chatGptAccountService.findByUserTokenAndExpireTimeAfter(userToken, LocalDateTime.now());
+        //3.如果记录不存在,返回状态码 401
+        if (user == null) {
+            return;
+        }
+        if(StringUtils.isNotBlank(conversationRequest.getCarId())){
+            TASK_EXECUTOR.execute(() -> {
+                chatGptAccountService.saveConversationRecord(userToken, conversationRequest);
+            });
+        }
+    }
+
 
     /**
      * 获取车队列表

+ 8 - 0
netflix-web/src/main/java/com/cyksj/web/controller/payment/OrderController.java

@@ -19,6 +19,7 @@ import com.cyksj.config.zfb.ZfbProductCode;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayApiCode;
 import com.cyksj.enums.GatewayResponse;
+import com.cyksj.mapper.GoodsDonSkuMapper;
 import com.cyksj.mapper.OrderDonWaybillMapper;
 import com.cyksj.mapper.UserMapper;
 import com.cyksj.mapper.channel.UserPayEquipmentAvailableBenefitsMapper;
@@ -124,6 +125,9 @@ public class OrderController {
     @Autowired
     private MidjourneyAccountService midjourneyAccountService;
 
+    @Autowired
+    private GoodsDonSkuMapper skuMapper;
+
     /**
      * 支付
      * @author chan
@@ -165,6 +169,10 @@ public class OrderController {
             cookie.setPath("/");
             response.addCookie(userInfo);
         }
+        if (orderDon.getGoodsId() != null && orderDon.getGoodsId() == 26l) {
+            GoodsDonSku sku = skuMapper.selectById(orderDon.getSkuId());
+            orderDon.setIsMirror(sku.getIsMirror());
+        }
 
         return GatewayResponse.SUCCESS.newBuilder().toResult(orderDon);
     }