|
@@ -104,7 +104,7 @@ public class DomainOrderService {
|
|
|
return m.find();
|
|
return m.find();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public DomainOrder create(Long userId, String domain, BigDecimal price, Long year) {
|
|
|
|
|
|
|
+ public DomainOrder create(Long userId, String domain, BigDecimal price, Long year) throws FontFormatException, IOException, WriterException {
|
|
|
AtomicBoolean checkPoint = checkPoint(userId);
|
|
AtomicBoolean checkPoint = checkPoint(userId);
|
|
|
List<DomainOrder> notPaidOrders = domainOrderRepo.findAllByUserIdAndOrderStatus(userId, OrderStatus.NOT_PAID);
|
|
List<DomainOrder> notPaidOrders = domainOrderRepo.findAllByUserIdAndOrderStatus(userId, OrderStatus.NOT_PAID);
|
|
|
Long superUserId = Long.valueOf(sysConfigService.getString("domain_superUserId"));
|
|
Long superUserId = Long.valueOf(sysConfigService.getString("domain_superUserId"));
|
|
@@ -157,6 +157,18 @@ public class DomainOrderService {
|
|
|
DomainOrder domainOrder = new DomainOrder();
|
|
DomainOrder domainOrder = new DomainOrder();
|
|
|
// domainOrder.setPic(Collections.singletonList(fileObject));
|
|
// domainOrder.setPic(Collections.singletonList(fileObject));
|
|
|
// domain = domain.replaceAll("[^a-zA-Z0-9\\u4E00-\\u9FA5]", "");
|
|
// domain = domain.replaceAll("[^a-zA-Z0-9\\u4E00-\\u9FA5]", "");
|
|
|
|
|
+ BufferedImage img = domainImg(domainOrder.getDomainName());
|
|
|
|
|
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
|
|
+ ImageIO.write(img, "jpg", os);
|
|
|
|
|
+ InputStream input = new ByteArrayInputStream(os.toByteArray());
|
|
|
|
|
+ String path = "image/" + new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date())
|
|
|
|
|
+ + RandomStringUtils.randomAlphabetic(8) + ".jpg";
|
|
|
|
|
+ String realUrl = storageService.uploadFromInputStream(input, path);
|
|
|
|
|
+ FileObject fileObject = new FileObject();
|
|
|
|
|
+ fileObject.setName(domainOrder.getDomainName());
|
|
|
|
|
+ fileObject.setType("image/jpeg");
|
|
|
|
|
+ fileObject.setUrl(realUrl);
|
|
|
|
|
+ domainOrder.setPic(Collections.singletonList(fileObject));
|
|
|
domainOrder.setPicName(domain);
|
|
domainOrder.setPicName(domain);
|
|
|
domainOrder.setPrice(price);
|
|
domainOrder.setPrice(price);
|
|
|
domainOrder.setDomainName((domain + ".nft").toLowerCase());
|
|
domainOrder.setDomainName((domain + ".nft").toLowerCase());
|
|
@@ -375,20 +387,8 @@ public class DomainOrderService {
|
|
|
if (!domainOrder.getOrderStatus().equals(OrderStatus.NOT_PAID)) {
|
|
if (!domainOrder.getOrderStatus().equals(OrderStatus.NOT_PAID)) {
|
|
|
throw new BusinessException("订单已经处理");
|
|
throw new BusinessException("订单已经处理");
|
|
|
}
|
|
}
|
|
|
- BufferedImage img = domainImg(domainOrder.getDomainName());
|
|
|
|
|
- ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
|
|
- ImageIO.write(img, "jpg", os);
|
|
|
|
|
- InputStream input = new ByteArrayInputStream(os.toByteArray());
|
|
|
|
|
- String path = "image/" + new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date())
|
|
|
|
|
- + RandomStringUtils.randomAlphabetic(8) + ".jpg";
|
|
|
|
|
- String realUrl = storageService.uploadFromInputStream(input, path);
|
|
|
|
|
- FileObject fileObject = new FileObject();
|
|
|
|
|
- fileObject.setName(domainOrder.getDomainName());
|
|
|
|
|
- fileObject.setType("image/jpeg");
|
|
|
|
|
- fileObject.setUrl(realUrl);
|
|
|
|
|
domainOrder.setOrderStatus(OrderStatus.FINISH);
|
|
domainOrder.setOrderStatus(OrderStatus.FINISH);
|
|
|
domainOrder.setPayMethod(payMethod);
|
|
domainOrder.setPayMethod(payMethod);
|
|
|
- domainOrder.setPic(Collections.singletonList(fileObject));
|
|
|
|
|
domainOrder.setTransactionId(transactionId);
|
|
domainOrder.setTransactionId(transactionId);
|
|
|
// domainOrder.setStatus(CollectionStatus.SUCCESS);
|
|
// domainOrder.setStatus(CollectionStatus.SUCCESS);
|
|
|
domainOrder.setCreateAssetId(createAsset(domainOrder));
|
|
domainOrder.setCreateAssetId(createAsset(domainOrder));
|