|
@@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.extra.servlet.ServletUtil;
|
|
import cn.hutool.extra.servlet.ServletUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
import cn.hutool.json.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Assert;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.cyksj.common.annotation.NoSubmit;
|
|
import com.cyksj.common.annotation.NoSubmit;
|
|
@@ -30,6 +31,7 @@ import com.cyksj.model.manage.views.GroupsRelationView;
|
|
|
import com.cyksj.model.request.OrderPayRequest;
|
|
import com.cyksj.model.request.OrderPayRequest;
|
|
|
import com.cyksj.model.views.*;
|
|
import com.cyksj.model.views.*;
|
|
|
import com.cyksj.redis.RedisService;
|
|
import com.cyksj.redis.RedisService;
|
|
|
|
|
+import com.cyksj.service.chatgpt.ChatGptAuthService;
|
|
|
import com.cyksj.service.mange.coupon.CouponCommonService;
|
|
import com.cyksj.service.mange.coupon.CouponCommonService;
|
|
|
import com.cyksj.service.mange.ticket.TicketAdvertiseConfigClickRecordService;
|
|
import com.cyksj.service.mange.ticket.TicketAdvertiseConfigClickRecordService;
|
|
|
import com.cyksj.service.order.OrderDonService;
|
|
import com.cyksj.service.order.OrderDonService;
|
|
@@ -95,6 +97,8 @@ public class GroupRelationController {
|
|
|
|
|
|
|
|
private final GlobalThreadPoolTaskExecutor THREAD_POOL;
|
|
private final GlobalThreadPoolTaskExecutor THREAD_POOL;
|
|
|
|
|
|
|
|
|
|
+ private final ChatGptAuthService chatGptAuthService;
|
|
|
|
|
+
|
|
|
private final static Sequence SEQUENCE = new Sequence(0);
|
|
private final static Sequence SEQUENCE = new Sequence(0);
|
|
|
|
|
|
|
|
@RequestMapping("/get/renewal")
|
|
@RequestMapping("/get/renewal")
|
|
@@ -502,4 +506,24 @@ public class GroupRelationController {
|
|
|
Page<UserRecommendGoodsFrontView> page = groupRelationFrontService.getRecommendGoodsViews(isPayNf, filter_goods_id, start, limit);
|
|
Page<UserRecommendGoodsFrontView> page = groupRelationFrontService.getRecommendGoodsViews(isPayNf, filter_goods_id, start, limit);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(page);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(page);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查看GPT token
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/get/gptAccessToken")
|
|
|
|
|
+ public Result<String> getGptAccessToken(Long relationId) throws Exception {
|
|
|
|
|
+ long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
|
|
+ List<Long> userIds = userService.getRelationUserIdList(userId, null);
|
|
|
|
|
+ //存在该车票
|
|
|
|
|
+ RenewalView renewalView = beanSearcher.searchFirst(RenewalView.class, MapUtils.builder()
|
|
|
|
|
+ .field(RenewalView::getRelationId, relationId)
|
|
|
|
|
+ .field(RenewalView::getUserId, userIds).op(Operator.InList).build());
|
|
|
|
|
+ Assert.notNull(renewalView, "您的车票不存在");
|
|
|
|
|
+ if (renewalView.getCategory() != 1) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("该平台类型车票无法获取GPT直连token");
|
|
|
|
|
+ }
|
|
|
|
|
+ String account = renewalView.getAccount();
|
|
|
|
|
+ String accessToken = chatGptAuthService.getAccessToken(account);
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(accessToken);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|