|
@@ -24,6 +24,7 @@ import com.cyksj.server.recharge.dto.TaskSubmitResult;
|
|
|
import com.cyksj.server.recharge.dto.TokenParseResult;
|
|
import com.cyksj.server.recharge.dto.TokenParseResult;
|
|
|
import com.cyksj.service.chatgpt.GptUserRechargeRecordService;
|
|
import com.cyksj.service.chatgpt.GptUserRechargeRecordService;
|
|
|
import com.cyksj.service.recharge.AfDianRechargeService;
|
|
import com.cyksj.service.recharge.AfDianRechargeService;
|
|
|
|
|
+import com.cyksj.service.recharge.ChongAfDianRechargeService;
|
|
|
import com.cyksj.service.recharge.GptRechargeCardKeyChannelService;
|
|
import com.cyksj.service.recharge.GptRechargeCardKeyChannelService;
|
|
|
import com.cyksj.service.user.UserBindRelationService;
|
|
import com.cyksj.service.user.UserBindRelationService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -64,6 +65,8 @@ public class GptProxyRechargeServiceImpl implements GptProxyRechargeService {
|
|
|
|
|
|
|
|
private final AfDianRechargeService afDianRechargeService;
|
|
private final AfDianRechargeService afDianRechargeService;
|
|
|
|
|
|
|
|
|
|
+ private final ChongAfDianRechargeService chongAfDianRechargeService;
|
|
|
|
|
+
|
|
|
private static final GlobalThreadPoolTaskExecutor TASK_EXECUTOR = GlobalThreadPoolTaskExecutor.getInstance();
|
|
private static final GlobalThreadPoolTaskExecutor TASK_EXECUTOR = GlobalThreadPoolTaskExecutor.getInstance();
|
|
|
|
|
|
|
|
private HttpRequest createBaseRequest(String url) {
|
|
private HttpRequest createBaseRequest(String url) {
|
|
@@ -180,6 +183,9 @@ public class GptProxyRechargeServiceImpl implements GptProxyRechargeService {
|
|
|
if (gptRechargeCardKey.getChannelId() == Constant.AF_DIAN_CHANNEL_ID) {
|
|
if (gptRechargeCardKey.getChannelId() == Constant.AF_DIAN_CHANNEL_ID) {
|
|
|
return afDianRechargeService.getTaskResult(relation);
|
|
return afDianRechargeService.getTaskResult(relation);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (gptRechargeCardKey.getChannelId()==Constant.CHONG_AF_DIAN_CHANNEL_ID){
|
|
|
|
|
+ return chongAfDianRechargeService.getTaskResult(relation);
|
|
|
|
|
+ }
|
|
|
String BASE_URL = gptRechargeCardKeyChannelService.getCardKeyDomain(cardKey);
|
|
String BASE_URL = gptRechargeCardKeyChannelService.getCardKeyDomain(cardKey);
|
|
|
String url = BASE_URL + "/tasks/" + taskId;
|
|
String url = BASE_URL + "/tasks/" + taskId;
|
|
|
HttpResponse response = createBaseRequest(url)
|
|
HttpResponse response = createBaseRequest(url)
|
|
@@ -321,6 +327,10 @@ public class GptProxyRechargeServiceImpl implements GptProxyRechargeService {
|
|
|
if (channelId == Constant.AF_DIAN_CHANNEL_ID) {
|
|
if (channelId == Constant.AF_DIAN_CHANNEL_ID) {
|
|
|
return afDianRechargeService.confirmRecharge(relation, gptCardKey, null);
|
|
return afDianRechargeService.confirmRecharge(relation, gptCardKey, null);
|
|
|
}
|
|
}
|
|
|
|
|
+ //chong.afdian
|
|
|
|
|
+ if (channelId == Constant.CHONG_AF_DIAN_CHANNEL_ID) {
|
|
|
|
|
+ return chongAfDianRechargeService.confirmRecharge(relation, gptCardKey, null);
|
|
|
|
|
+ }
|
|
|
//校验卡密是否可用
|
|
//校验卡密是否可用
|
|
|
CardKeyValidationResult cardKeyValidationResult = validateCardKey(gptCardKey);
|
|
CardKeyValidationResult cardKeyValidationResult = validateCardKey(gptCardKey);
|
|
|
if (!cardKeyValidationResult.getAvailable()) {
|
|
if (!cardKeyValidationResult.getAvailable()) {
|