Selaa lähdekoodia

添加非渠道用户提示

chenbiao 2 vuotta sitten
vanhempi
sitoutus
dc12eeff9f

+ 3 - 0
netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAccountServiceImpl.java

@@ -571,6 +571,9 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
             if(!chatgptUser.getIsCar()){
                 throw BusinessRuntimeException.getInstance("您非车队用户,请购买车队套餐");
             }
+            if (chatgptUser.getRelationId() != null) {
+                throw BusinessRuntimeException.getInstance("非渠道用户,请通过官网登录!");
+            }
             return chatgptUser;
         }
         return null;

+ 14 - 0
netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java

@@ -275,6 +275,20 @@ public class MirrorController {
         return GatewayResponse.SUCCESS.newBuilder().toResult(carInfoList);
     }
 
+    /**
+     * 根据userToken获取车队历史记录
+     */
+    @GetMapping("/gpt/car/history")
+    public Result<SearchResult<ChatGptUserConversationRecordHistoryView>> getCarHistory(String userToken) {
+        ChatgptUser carChatGptUser = chatGptAccountService.getCarChatGptUserWithToken(userToken);
+        if (carChatGptUser == null) {
+            throw BusinessRuntimeException.getInstance("车票出现了异常.");
+        }
+        MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap()).field("userToken", carChatGptUser.getUserToken());
+        SearchResult<ChatGptUserConversationRecordHistoryView> search = beanSearcher.search(ChatGptUserConversationRecordHistoryView.class, builder.build());
+        return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+    }
+
 
 
 }