|
|
@@ -33,6 +33,7 @@ import com.cyksj.model.response.AliPayTradeStatus;
|
|
|
import com.cyksj.model.views.GoodsDonSkuView;
|
|
|
import com.cyksj.model.views.MidjourneyUserView;
|
|
|
import com.cyksj.model.views.OrderCommentView;
|
|
|
+import com.cyksj.service.midjourney.MidjourneyAccountService;
|
|
|
import com.cyksj.service.order.OrderDonService;
|
|
|
import com.cyksj.service.paypal.PayPalService;
|
|
|
import com.cyksj.service.paypal.PaypalPayConfigService;
|
|
|
@@ -55,6 +56,7 @@ import com.stripe.model.checkout.Session;
|
|
|
import com.stripe.net.Webhook;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@@ -123,6 +125,9 @@ public class OrderController {
|
|
|
@Autowired
|
|
|
private YhShopFrontService yhShopFrontService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private MidjourneyAccountService midjourneyAccountService;
|
|
|
+
|
|
|
/**
|
|
|
* 支付
|
|
|
* @author chan
|
|
|
@@ -788,6 +793,11 @@ public class OrderController {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
MidjourneyUserView search = beanSearcher.searchFirst(MidjourneyUserView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.field(MidjourneyUserView::getUserId, userId).field(MidjourneyUserView::getRelationId, relationId).build());
|
|
|
+ if (search == null) {
|
|
|
+ MidjourneyUser midjourneyUser = midjourneyAccountService.getMidjourneyUserToken(userId, relationId);
|
|
|
+ search = new MidjourneyUserView();
|
|
|
+ BeanUtils.copyProperties(midjourneyUser, search);
|
|
|
+ }
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
}
|