Merge branch 'release/3.1' into dev/3.1_release_merge
# Conflicts: # src/main/java/com/ai/da/common/config/MyTaskScheduler.java # src/main/java/com/ai/da/common/enums/ProductEnum.java # src/main/java/com/ai/da/common/task/PaymentTask.java # src/main/java/com/ai/da/common/utils/LocalCacheUtils.java # src/main/java/com/ai/da/common/utils/RedisUtil.java # src/main/java/com/ai/da/controller/AffiliateController.java # src/main/java/com/ai/da/controller/ConvenientInquiryController.java # src/main/java/com/ai/da/controller/StripeController.java # src/main/java/com/ai/da/mapper/primary/entity/Library.java # src/main/java/com/ai/da/mapper/primary/entity/ProductCoupons.java # src/main/java/com/ai/da/model/dto/CreateCouponDTO.java # src/main/java/com/ai/da/model/vo/CheckCouponsVO.java # src/main/java/com/ai/da/service/AffiliateService.java # src/main/java/com/ai/da/service/PaymentInfoService.java # src/main/java/com/ai/da/service/StripeService.java # src/main/java/com/ai/da/service/impl/AccountServiceImpl.java # src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java # src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java # src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java # src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java # src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java # src/main/java/com/ai/da/service/impl/PaymentInfoServiceImpl.java # src/main/java/com/ai/da/service/impl/StripeServiceImpl.java # src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java # src/main/resources/messages_en.properties # src/main/resources/messages_zh.properties
This commit is contained in:
@@ -130,7 +130,7 @@ public class MyTaskScheduler {
|
||||
private CollectionSortMapper collectionSortMapper;
|
||||
@Resource
|
||||
private DesignService designService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ToProductElementMapper toProductELementMapper;
|
||||
|
||||
@@ -245,30 +245,26 @@ public class MyTaskScheduler {
|
||||
try (FileOutputStream fileOut = new FileOutputStream(fileName)) {
|
||||
workbook.write(fileOut);
|
||||
// SendEmailUtil.sendExcelEmail("1023316923@qq.com", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
// SendEmailUtil.sendExcelEmail("calvinwong@aidlab.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
// SendEmailUtil.sendExcelEmail("kaicpang.pang@connect.polyu.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
// SendEmailUtil.sendExcelEmail("kimwong@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
SendEmailUtil.sendExcelEmail("ningning@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
SendEmailUtil.sendExcelEmail("johnnyho@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
SendEmailUtil.sendExcelEmail("ringolau@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
SendEmailUtil.sendExcelEmail("ningning@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
SendEmailUtil.sendExcelEmail("calvinwong@aidlab.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
SendEmailUtil.sendExcelEmail("kaicpang.pang@connect.polyu.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
SendEmailUtil.sendExcelEmail("kimwong@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
// SendEmailUtil.sendExcelEmail("ningning@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
SendEmailUtil.sendExcelEmail("johnnyho@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
SendEmailUtil.sendExcelEmail("ringolau@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
SendEmailUtil.sendExcelEmail("chelseayu@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}else {
|
||||
// SendEmailUtil.sendNoExcelEmail("1023316923@qq.com", null);
|
||||
// SendEmailUtil.sendNoExcelEmail("calvinwong@aidlab.hk", null);
|
||||
// SendEmailUtil.sendNoExcelEmail("kaicpang.pang@connect.polyu.hk", null);
|
||||
// SendEmailUtil.sendNoExcelEmail("kimwong@code-create.com.hk", null);
|
||||
SendEmailUtil.sendNoExcelEmail("ningning@code-create.com.hk", null);
|
||||
SendEmailUtil.sendNoExcelEmail("johnnyho@code-create.com.hk", null);
|
||||
SendEmailUtil.sendNoExcelEmail("ringolau@code-create.com.hk", null);
|
||||
SendEmailUtil.sendNoExcelEmail("ningning@code-create.com.hk", null);
|
||||
SendEmailUtil.sendNoExcelEmail("calvinwong@aidlab.hk", null);
|
||||
SendEmailUtil.sendNoExcelEmail("kaicpang.pang@connect.polyu.hk", null);
|
||||
SendEmailUtil.sendNoExcelEmail("kimwong@code-create.com.hk", null);
|
||||
// SendEmailUtil.sendNoExcelEmail("ningning@code-create.com.hk", null);
|
||||
SendEmailUtil.sendNoExcelEmail("johnnyho@code-create.com.hk", null);
|
||||
SendEmailUtil.sendNoExcelEmail("ringolau@code-create.com.hk", null);
|
||||
SendEmailUtil.sendNoExcelEmail("chelseayu@code-create.com.hk", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +286,7 @@ public class MyTaskScheduler {
|
||||
|
||||
@Resource
|
||||
private GenerateDetailMapper generateDetailMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private ToProductImageResultMapper toProductImageResultMapper;
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ public class CommonConstant {
|
||||
public static final Integer MINIO_IMAGE_EXPIRE_TIME = 24 * 60;
|
||||
// 单位 秒 一天过期 in redis
|
||||
public static final Long GENERATE_RESULT_EXPIRE_TIME = 24 * 60 * 60L;
|
||||
// 单位 秒 7天过期
|
||||
public static final Long REDIS_SET_EXPIRE_TIME = 24 * 60 * 60 * 7L;
|
||||
|
||||
public static class Numbers{
|
||||
public static final Integer NUMBER_10 = 10;
|
||||
@@ -81,6 +83,8 @@ public class CommonConstant {
|
||||
|
||||
public static final String TIME_FORMAT_MMM_dd_yyyy = "MMM. dd, yyyy";
|
||||
|
||||
public static final String TIME_FORMAT_yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
public static final String AFFILIATE_LINK = "https://www.aida.com.hk?ref=";
|
||||
|
||||
public static final String PARTIAL_DESIGN_FILENAME = "PartialDesign";
|
||||
|
||||
@@ -31,7 +31,9 @@ public enum AuthenticationOperationTypeEnum {
|
||||
/**
|
||||
* 填写用户国家和职业
|
||||
*/
|
||||
UPDATE_USERINFO;
|
||||
UPDATE_USERINFO,
|
||||
|
||||
REGISTER;
|
||||
|
||||
public static AuthenticationOperationTypeEnum of(String name) {
|
||||
return Stream.of(AuthenticationOperationTypeEnum.values()).filter(v -> v.name().equals(name)).findFirst().orElse(null);
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum ProductEnum {
|
||||
// 积分购买
|
||||
CreditsProduct("AiDA credits purchase", 10L, 60L),
|
||||
CreditsProduct("AiDA credits purchase", 10L, 50L),
|
||||
// 年度订阅
|
||||
AnnualSubscription("AiDA Annual Subscription", 5000L, 50000L),
|
||||
// 月度订阅(订阅费500,每月3500 积分)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ai.da.common.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@ApiModel("交易记录分页响应结果")
|
||||
public class TransactionPageResponse<T> extends PageBaseResponse<T> {
|
||||
|
||||
private BigDecimal totalAmount;
|
||||
}
|
||||
@@ -84,6 +84,7 @@ public class PaymentTask {
|
||||
}*/
|
||||
}
|
||||
|
||||
// !!关闭此定时器,改为提前三天站内信提醒!!
|
||||
// 提前7天向用户发送提醒邮件,每天早上8点执行
|
||||
// @Scheduled(cron = "0 0 8 * * ?")
|
||||
public void subscriptionReminder(){
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.ai.da.common.utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ComprehensivePunctuationConverter {
|
||||
private static final Map<Character, Character> FULL_TO_HALF_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
// 中文标点到英文标点的映射(扩展版)
|
||||
FULL_TO_HALF_MAP.put(',', ',');
|
||||
FULL_TO_HALF_MAP.put('。', '.');
|
||||
FULL_TO_HALF_MAP.put(';', ';');
|
||||
FULL_TO_HALF_MAP.put(':', ':');
|
||||
FULL_TO_HALF_MAP.put('?', '?');
|
||||
FULL_TO_HALF_MAP.put('!', '!');
|
||||
FULL_TO_HALF_MAP.put('(', '(');
|
||||
FULL_TO_HALF_MAP.put(')', ')');
|
||||
FULL_TO_HALF_MAP.put('【', '[');
|
||||
FULL_TO_HALF_MAP.put('】', ']');
|
||||
FULL_TO_HALF_MAP.put('「', '\'');
|
||||
FULL_TO_HALF_MAP.put('」', '\'');
|
||||
FULL_TO_HALF_MAP.put('『', '"');
|
||||
FULL_TO_HALF_MAP.put('』', '"');
|
||||
FULL_TO_HALF_MAP.put('、', '\\');
|
||||
FULL_TO_HALF_MAP.put('~', '~');
|
||||
FULL_TO_HALF_MAP.put('—', '-');
|
||||
FULL_TO_HALF_MAP.put('.', '.');
|
||||
FULL_TO_HALF_MAP.put('〈', '<');
|
||||
FULL_TO_HALF_MAP.put('〉', '>');
|
||||
FULL_TO_HALF_MAP.put('《', '«');
|
||||
FULL_TO_HALF_MAP.put('》', '»');
|
||||
FULL_TO_HALF_MAP.put('〝', '"');
|
||||
FULL_TO_HALF_MAP.put('〞', '"');
|
||||
FULL_TO_HALF_MAP.put('﹁', '"');
|
||||
FULL_TO_HALF_MAP.put('﹂', '"');
|
||||
FULL_TO_HALF_MAP.put('…', '.');
|
||||
FULL_TO_HALF_MAP.put('﹏', '_');
|
||||
|
||||
// 全角字母和数字
|
||||
for (char c = 'A'; c <= 'Z'; c++) {
|
||||
FULL_TO_HALF_MAP.put(c, (char)(c - 'A' + 'A'));
|
||||
}
|
||||
for (char c = 'a'; c <= 'z'; c++) {
|
||||
FULL_TO_HALF_MAP.put(c, (char)(c - 'a' + 'a'));
|
||||
}
|
||||
for (char c = '0'; c <= '9'; c++) {
|
||||
FULL_TO_HALF_MAP.put(c, (char)(c - '0' + '0'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串中的全角字符(包括标点、字母、数字)转换为半角字符
|
||||
*/
|
||||
public static String convertToHalfWidth(String input) {
|
||||
if (input == null || input.isEmpty()) {
|
||||
return input;
|
||||
}
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < input.length(); i++) {
|
||||
char c = input.charAt(i);
|
||||
|
||||
// 检查映射表
|
||||
if (FULL_TO_HALF_MAP.containsKey(c)) {
|
||||
result.append(FULL_TO_HALF_MAP.get(c));
|
||||
}
|
||||
// 处理全角空格(Unicode 12288)
|
||||
else if (c == ' ') {
|
||||
result.append(' ');
|
||||
}
|
||||
// 其他字符保持不变
|
||||
else {
|
||||
result.append(c);
|
||||
}
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// String text = "这是一个全角示例,包含:中文标点、全角字母(ABC)、全角数字(123) 还有全角空格!";
|
||||
String text = "birds,yellow";
|
||||
String converted = convertToHalfWidth(text);
|
||||
System.out.println("原始文本: " + text);
|
||||
System.out.println("转换后: " + converted);
|
||||
}
|
||||
}
|
||||
@@ -100,8 +100,10 @@ public class RedisUtil {
|
||||
/**
|
||||
* 将数据放入set缓存
|
||||
*/
|
||||
public void addToSet(String key, String value) {
|
||||
public void addToSet(String key, String value, Long expiresIn) {
|
||||
redisTemplate.opsForSet().add(key, value);
|
||||
// 设置过期时间
|
||||
redisTemplate.expire(key, expiresIn, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -503,6 +505,7 @@ public class RedisUtil {
|
||||
public final static String IMAGE_SEGMENTATION = "ImageSegmentation:";
|
||||
|
||||
public final static String STRIPE_EXCEPTION_LOG = "StripeException:";
|
||||
public final static String SUBSCRIPTION_SENT_EMAIL_TYPE = "SubscriptionEmailSentType:";
|
||||
|
||||
public void batchDeleteKeysWithSamePrefix(String prefix){
|
||||
Set<String> keys = redisTemplate.keys(prefix + "*");
|
||||
|
||||
@@ -611,7 +611,6 @@ public class SendEmailUtil {
|
||||
|
||||
public static void uploadTimeoutReminder(String userName, String time) {
|
||||
String xp = "xupei3360@163.com";
|
||||
String shb = "shahaibodd99@gmail.com";
|
||||
String wxd = "X1627315083@163.com";
|
||||
String pkc = "kaicpang.pang@connect.polyu.hk";
|
||||
try {
|
||||
@@ -630,7 +629,7 @@ public class SendEmailUtil {
|
||||
// 实例化一个请求对象,每个接口都会对应一个request对象
|
||||
SendEmailRequest req = new SendEmailRequest();
|
||||
req.setFromEmailAddress(SEND_ADDRESS);
|
||||
req.setDestination(new String[]{shb, xp, wxd, pkc});
|
||||
req.setDestination(new String[]{xp, wxd, pkc});
|
||||
Template template = new Template();
|
||||
req.setSubject("上传图片超时提醒");
|
||||
template.setTemplateID(UPLOAD_TIMEOUT_REMINDER);
|
||||
@@ -745,9 +744,12 @@ public class SendEmailUtil {
|
||||
// private final static Long NEW_MERCHANT_EN = 130721L;
|
||||
// private final static Long NEW_USER_EN = 130722L;
|
||||
// private final static Long NEW_USER_CN = 130723L;
|
||||
private final static Long NEW_MERCHANT_EN = 135190L;
|
||||
private final static Long NEW_USER_EN = 135189L;
|
||||
private final static Long NEW_USER_CN = 135186L;
|
||||
private final static Long NEW_MERCHANT_EN = 140335L;
|
||||
// private final static Long NEW_MERCHANT_EN = 135190L;
|
||||
// private final static Long NEW_USER_EN = 135189L;
|
||||
// private final static Long NEW_USER_CN = 135186L;
|
||||
private final static Long NEW_USER_EN = 140316L;
|
||||
private final static Long NEW_USER_CN = 140317L;
|
||||
private final static Long RENEWAL_MERCHANT_EN = 130724L;
|
||||
private final static Long RENEWAL_USER_EN = 130725L;
|
||||
private final static Long RENEWAL_USER_CN = 130726L;
|
||||
|
||||
@@ -49,7 +49,9 @@ public class ConvenientInquiryController {
|
||||
String userEmail = accountService.getById(accountId).getUserEmail();
|
||||
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L)
|
||||
|| accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)
|
||||
|| userEmail.equals("joho8228@hotmail.com") || userEmail.equals("wanninghua160@gmail.com")
|
||||
|| userEmail.equals("joho8228@hotmail.com")
|
||||
|| userEmail.equals("chelseayu@code-create.com.hk")
|
||||
|| userEmail.equals("cheungzt007@gmail.com")
|
||||
) {
|
||||
return Response.success(convenientInquiryService.getTrial(queryUserConditionsVO));
|
||||
} else {
|
||||
@@ -61,7 +63,28 @@ public class ConvenientInquiryController {
|
||||
@GetMapping("/getDesignStatistic")
|
||||
public Response<List<UserDesignStatisticDTO>> getDesignStatistic(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,
|
||||
@RequestParam(required = false) List<Long> ids, @RequestParam(required = false) String email) {
|
||||
return Response.success(convenientInquiryService.getDesignStatistic(startTime, endTime, ids, email));
|
||||
Long accountId = UserContext.getUserHolder().getId();
|
||||
String userEmail = accountService.getById(accountId).getUserEmail();
|
||||
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L)
|
||||
|| accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)
|
||||
|| userEmail.equals("joho8228@hotmail.com")
|
||||
|| userEmail.equals("chelseayu@code-create.com.hk")
|
||||
|| userEmail.equals("cheungzt007@gmail.com")
|
||||
) {
|
||||
if (StringUtil.isNullOrEmpty(startTime)) startTime = "2024-02-01 00:00:00";
|
||||
if (StringUtil.isNullOrEmpty(endTime)) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
||||
Date date = new Date();
|
||||
endTime = simpleDateFormat.format(date);
|
||||
}
|
||||
if (!StringUtil.isNullOrEmpty(email)){
|
||||
email = email.trim();
|
||||
}
|
||||
List<UserDesignStatisticDTO> designStatistic = designMapper.getDesignStatistic(startTime, endTime, ids, email);
|
||||
return Response.success(designStatistic);
|
||||
} else {
|
||||
return Response.fail("Sorry, you don't have permission");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +186,9 @@ public class ConvenientInquiryController {
|
||||
String userEmail = accountService.getById(accountId).getUserEmail();
|
||||
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L)
|
||||
|| accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)
|
||||
|| userEmail.equals("joho8228@hotmail.com") || userEmail.equals("wanninghua160@gmail.com")
|
||||
|| userEmail.equals("joho8228@hotmail.com")
|
||||
|| userEmail.equals("chelseayu@code-create.com.hk")
|
||||
|| userEmail.equals("cheungzt007@gmail.com")
|
||||
) {
|
||||
return Response.success(convenientInquiryService.getUserInfo(queryUserConditionsVO));
|
||||
} else {
|
||||
|
||||
@@ -137,9 +137,11 @@ public class StripeController {
|
||||
|
||||
@ApiOperation("更新推广码信息")
|
||||
@GetMapping("/updatePromCodeInfo")
|
||||
public Response<ProductCoupons> updateCouponsInfo(@RequestParam Long id, @RequestParam(required = false) Long paidCommission,
|
||||
@RequestParam(required = false) String cooperator, @RequestParam(required = false) String remark){
|
||||
return Response.success(stripeService.updateCouponsInfo(id, paidCommission, cooperator, remark));
|
||||
public Response<ProductCoupons> updateCouponsInfo(@RequestParam Long id, @RequestParam(required = false) String paidCommission,
|
||||
@RequestParam(required = false) String cooperator,
|
||||
@RequestParam(required = false) String remark,
|
||||
@RequestParam(required = false) Long startTime){
|
||||
return Response.success(stripeService.updateCouponsInfo(id, paidCommission, cooperator, remark, startTime));
|
||||
}
|
||||
|
||||
@ApiOperation("删除推广码")
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.ai.da.model.vo.PaymentInfoVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -24,6 +25,10 @@ public interface PaymentInfoMapper extends BaseMapper<PaymentInfo> {
|
||||
String country, String city, String startTime, String endTime, String payer
|
||||
);
|
||||
|
||||
BigDecimal queryTotalPaymentAmount(String paymentType,String payerTotal, String type, String status,
|
||||
String country, String city, String startTime, String endTime, String payer
|
||||
);
|
||||
|
||||
List<Map<String, String>> getCities();
|
||||
|
||||
List<Map<String, String>> getCountries();
|
||||
|
||||
@@ -7,6 +7,8 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("t_product_coupons")
|
||||
@@ -20,6 +22,8 @@ public class ProductCoupons extends BaseEntity{
|
||||
private String promotionCodeId;
|
||||
// 对应的推广码
|
||||
private String promotionCode;
|
||||
// 优惠券有效期开始时间
|
||||
private Long startTime;
|
||||
// 最大兑换次数
|
||||
private Long maxRedemptions;
|
||||
// 优惠券的折扣
|
||||
@@ -29,13 +33,13 @@ public class ProductCoupons extends BaseEntity{
|
||||
// 合作者
|
||||
private String cooperator;
|
||||
// 使用了该优惠券支付的总金额
|
||||
private float totalEarnings;
|
||||
private BigDecimal totalEarnings = BigDecimal.ZERO;
|
||||
// 佣金
|
||||
private float commission;
|
||||
private BigDecimal commission = BigDecimal.ZERO;
|
||||
// 已付佣金
|
||||
private float paidCommission;
|
||||
private BigDecimal paidCommission = BigDecimal.ZERO;
|
||||
// 未付佣金
|
||||
private float unpaidCommission;
|
||||
private BigDecimal unpaidCommission = BigDecimal.ZERO;
|
||||
// 备注
|
||||
private String remark;
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ public class CreateCouponDTO {
|
||||
@NotNull(message = "Please set the commissionRate.")
|
||||
private Float commissionRate;
|
||||
@ApiModelProperty("推广码到期时间 秒级时间戳")
|
||||
private Long timestamp;
|
||||
private Long endTime;
|
||||
@ApiModelProperty("推广码开始时间 秒级时间戳")
|
||||
private Long startTime;
|
||||
@ApiModelProperty("推广码最大使用次数")
|
||||
private Long maxRedemptions;
|
||||
@ApiModelProperty("合作者/机构名")
|
||||
|
||||
@@ -15,8 +15,8 @@ public class EmailSendDTO {
|
||||
private String email;
|
||||
|
||||
@NotBlank(message = "operationType.cannot.be.empty")
|
||||
@ApiModelProperty("操作类型 LOGIN 注册 FORGET_PWD 忘记密码 BIND_MAILBOX 绑定邮箱 " +
|
||||
"CHANGE_MAILBOX 更改邮箱 UPDATE_USERINFO 仅填写国家、职业(不发送邮件)")
|
||||
@ApiModelProperty("操作类型 LOGIN 登录 FORGET_PWD 忘记密码 BIND_MAILBOX 绑定邮箱 " +
|
||||
"CHANGE_MAILBOX 更改邮箱 UPDATE_USERINFO 仅填写国家、职业(不发送邮件) REGISTER 注册")
|
||||
private String operationType;
|
||||
|
||||
@ApiModelProperty("异常ip")
|
||||
|
||||
@@ -23,6 +23,9 @@ public class GenerateModifyDTO {
|
||||
@ApiModelProperty(value = "sketch所属分类", required = true)
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "originalId的来源 Library || Generate(默认为空)", required = true)
|
||||
private String originalIdSource;
|
||||
|
||||
@NotNull(message = "id cannot be empty")
|
||||
@ApiModelProperty(value = "原图id", required = true)
|
||||
private Long originalId;
|
||||
|
||||
@@ -9,7 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
public class CheckCouponsVO {
|
||||
|
||||
@ApiModelProperty("expired || invalid || valid")
|
||||
@ApiModelProperty("expired 过期 || invalid 无效 || valid 有效 || pending 尚未生效")
|
||||
private String status;
|
||||
|
||||
private String message;
|
||||
|
||||
@@ -13,6 +13,8 @@ public class PaymentInfoVO {
|
||||
private Long id;
|
||||
@ApiModelProperty("付款用户名")
|
||||
private String payer;
|
||||
@ApiModelProperty("付款者邮箱")
|
||||
private String email;
|
||||
@ApiModelProperty("选择的支付平台 PayPal || Stripe || Alipay-HK")
|
||||
private String platform;
|
||||
@ApiModelProperty("支付的金额 单位:HKD")
|
||||
|
||||
@@ -53,6 +53,8 @@ public interface DesignItemService extends IService<DesignItem> {
|
||||
|
||||
DesignSingleVO designSingleIncludeLayers(DesignSingleIncludeLayersDTO designSingleIncludeLayersDTO);
|
||||
|
||||
Map<String, String> setPriorityAndUndividedLayer(JSONArray layers);
|
||||
|
||||
Map<String, String> setTypeAndUndividedLayer(JSONArray layers);
|
||||
|
||||
ComposeLayersVO editLayersPositionAndScale(EditLayersPositionAndScaleVO positionAndScaleVO) throws IOException;
|
||||
|
||||
@@ -61,7 +61,7 @@ public interface StripeService {
|
||||
|
||||
CheckCouponsVO checkProductCoupon(String promotionCode, Long price);
|
||||
|
||||
ProductCoupons updateCouponsInfo(Long id, Long paidCommission, String cooperator, String remark);
|
||||
ProductCoupons updateCouponsInfo(Long id, String paidCommission, String cooperator, String remark, Long startTime);
|
||||
|
||||
ProductCoupons getProductCoupon(String promotionCode, String promotionCodeId);
|
||||
|
||||
|
||||
@@ -549,11 +549,15 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
result = true;
|
||||
}
|
||||
break;
|
||||
case REGISTER:
|
||||
result = SendEmailUtil.designWorksRegister(emailSendDTO.getEmail(), randomVerifyCode);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
if (!result) {
|
||||
throw new BusinessException("failed.to.send.mail");
|
||||
}
|
||||
log.info("向邮箱 {} 发送验证码为:{}, 邮件类型:{}", emailSendDTO.getEmail(), randomVerifyCode, authenticationOperationTypeEnum);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -1182,13 +1186,13 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
}
|
||||
|
||||
String randomVerifyCode = RandomsUtil.generateVerifyCode(100000L, 999999L);
|
||||
LocalCacheUtils.setVerifyCodeCache("DesignWorksRegister" + "_" + accountDesignWorksRegisterDTO.getUserEmail(), randomVerifyCode);
|
||||
LocalCacheUtils.setVerifyCodeCache("REGISTER" + "_" + userEmail, randomVerifyCode);
|
||||
|
||||
Boolean b = SendEmailUtil.designWorksRegister(accountDesignWorksRegisterDTO.getUserEmail(), randomVerifyCode);
|
||||
Boolean b = SendEmailUtil.designWorksRegister(userEmail, randomVerifyCode);
|
||||
if (!b) {
|
||||
throw new BusinessException("failed.to.send.mail");
|
||||
}
|
||||
log.info("注册账号。成功向 {} 账号发送验证码:{}", accountDesignWorksRegisterDTO.getUserEmail(), randomVerifyCode);
|
||||
log.info("向邮箱 {} 发送验证码:{}, 邮件类型:REGISTER", userEmail, randomVerifyCode);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -1196,7 +1200,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
public AccountLoginVO designWorksRegisterCode(AccountDesignWorksRegisterDTO accountDesignWorksRegisterDTO,
|
||||
HttpServletRequest request) {
|
||||
|
||||
String verifyCode = LocalCacheUtils.getVerifyCodeCache("DesignWorksRegister" + "_" + accountDesignWorksRegisterDTO.getUserEmail());
|
||||
String verifyCode = LocalCacheUtils.getVerifyCodeCache("REGISTER" + "_" + accountDesignWorksRegisterDTO.getUserEmail());
|
||||
if (StringUtils.isBlank(verifyCode)) {
|
||||
throw new BusinessException("the.verification.code.has.expired", ResultEnum.PROMPT.getCode());
|
||||
}
|
||||
@@ -1260,9 +1264,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
config.setJdbcUrl("jdbc:mysql://code-create.com.hk:3306/db1nfvsgmjp3b8");
|
||||
config.setUsername("uafqtz4gsvfrw");
|
||||
config.setPassword("aida123456.");
|
||||
// config.setJdbcUrl("jdbc:mysql://18.167.251.121:33008/aida");
|
||||
// config.setUsername("aida_con");
|
||||
// config.setPassword("123456");
|
||||
// config.setJdbcUrl("jdbc:mysql://localhost:3306/code-create-local?serverTimezone=UTC");
|
||||
// config.setUsername("root");
|
||||
// config.setPassword("root");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@ import com.ai.da.common.constant.CommonConstant;
|
||||
import com.ai.da.common.context.UserContext;
|
||||
import com.ai.da.common.enums.CreditsEventsEnum;
|
||||
import com.ai.da.common.response.PageBaseResponse;
|
||||
import com.ai.da.common.response.TransactionPageResponse;
|
||||
import com.ai.da.common.response.ResultEnum;
|
||||
import com.ai.da.common.utils.CopyUtil;
|
||||
import com.ai.da.common.utils.DateUtil;
|
||||
@@ -695,16 +696,21 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
queryPaymentInfoDTO.getType(), queryPaymentInfoDTO.getStatus(),
|
||||
queryPaymentInfoDTO.getCountry(), queryPaymentInfoDTO.getCity(),
|
||||
queryPaymentInfoDTO.getStartTime(), queryPaymentInfoDTO.getEndTime(), queryPaymentInfoDTO.getPayer());
|
||||
|
||||
// 查询符合查询条件的总金额
|
||||
BigDecimal payerTotal = paymentInfoMapper.queryTotalPaymentAmount(queryPaymentInfoDTO.getPlatform(), queryPaymentInfoDTO.getPayerTotal(),
|
||||
queryPaymentInfoDTO.getType(), queryPaymentInfoDTO.getStatus(),
|
||||
queryPaymentInfoDTO.getCountry(), queryPaymentInfoDTO.getCity(),
|
||||
queryPaymentInfoDTO.getStartTime(), queryPaymentInfoDTO.getEndTime(), queryPaymentInfoDTO.getPayer());
|
||||
// 总页数
|
||||
double totalPage = Math.ceil((double) total / size);
|
||||
// 组装返回参数
|
||||
PageBaseResponse<PaymentInfoVO> response = new PageBaseResponse<>();
|
||||
TransactionPageResponse<PaymentInfoVO> response = new TransactionPageResponse<>();
|
||||
response.setContent(paymentInfoVOS);
|
||||
response.setPage(queryPaymentInfoDTO.getPage());
|
||||
response.setSize(size);
|
||||
response.setTotal(total);
|
||||
response.setPages((long) totalPage);
|
||||
response.setTotalAmount(Objects.isNull(payerTotal) ? BigDecimal.ZERO : payerTotal);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@@ -336,7 +336,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
||||
public List<TDesignPythonOutfitDetail> saveDesignSingleItemDetailAndLayers(DesignPythonObjects pythonObjects
|
||||
, Long designId, Long designItemId, Long userId
|
||||
, JSONObject outfit, String timeZone, List<DesignSingleItemDTO> designSingleItemDTOList
|
||||
, Map<String, String> categoryAndUndividedLayer
|
||||
, Map<String, String> priorityAndUndividedLayer
|
||||
, boolean changeModelFlag
|
||||
, Long modelId, String modelType, boolean isSingleCollectionFlag) {
|
||||
|
||||
@@ -374,7 +374,14 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
||||
designItemDetail.setPriority(0);
|
||||
}
|
||||
designItemDetail.setIconPath(detail.getIcon());
|
||||
designItemDetail.setUndividedLayer(categoryAndUndividedLayer.get(detail.getType().toLowerCase()));
|
||||
// designItemDetail.setUndividedLayer(priorityAndUndividedLayer.get(detail.getType().toLowerCase()));
|
||||
if (!detail.getType().equals("Body")) designItemDetail.setUndividedLayer(priorityAndUndividedLayer.get(detail.getPriority().toString()));
|
||||
// 印花存储在design_item_detail_print表中 这里还要存吗?
|
||||
// DesignPythonItemPrint printObject = detail.getPrintToPython();
|
||||
// designItemDetail.setPrintPath(Objects.isNull(printObject) ? "" : printObject.getPath());
|
||||
// 当有多个印花后,返回的printObject太长,导致存储到数据库时报错
|
||||
// designItemDetail.setPrintJson(JSON.toJSONString(printObject));
|
||||
|
||||
designItemDetail.setPartialDesign(Objects.isNull(detail.getPrint()) ? null : detail.getPrint().getPartial());
|
||||
designItemDetails.add(designItemDetail);
|
||||
});
|
||||
@@ -593,13 +600,13 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
||||
JSONObject outfit = data.getJSONObject("0");
|
||||
|
||||
JSONArray layers = outfit.getJSONArray("layers");
|
||||
Map<String, String> categoryAndUndividedLayer = setTypeAndUndividedLayer(layers);
|
||||
Map<String, String> priorityAndUndividedLayer = setPriorityAndUndividedLayer(layers);
|
||||
if (!designSingleIncludeLayersDTO.getIsPreview()) {
|
||||
// 更新及保存图层信息
|
||||
tDesignPythonOutfitDetails = saveDesignSingleItemDetailAndLayers(objects, design.getId(), designSingleIncludeLayersDTO.getDesignItemId()
|
||||
, userId, outfit, designSingleIncludeLayersDTO.getTimeZone()
|
||||
, designSingleIncludeLayersDTO.getDesignSingleItemDTOList()
|
||||
, categoryAndUndividedLayer, changeModelFlag, modelId, modelType, isSingleCollectionFlag);
|
||||
, priorityAndUndividedLayer, changeModelFlag, modelId, modelType, isSingleCollectionFlag);
|
||||
|
||||
saveCollectionElement(designSingleIncludeLayersDTO);
|
||||
} else {
|
||||
@@ -627,13 +634,14 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
||||
}else {
|
||||
updateUserLikeConvertStatus(designSingleIncludeLayersDTO.getDesignItemId(),designSingleIncludeLayersDTO.getTimeZone());
|
||||
}
|
||||
|
||||
return assembleDesignSingleResponse(designItem.getId(),
|
||||
minioUtil.getPreSignedUrl(designPythonOutfit.getDesignUrl(), 24 * 60),
|
||||
outfit.getString("synthesis_url"),
|
||||
designSingleIncludeLayersDTO.getDesignSingleItemDTOList(),
|
||||
detailsVO,
|
||||
design.getSingleOverall(),
|
||||
categoryAndUndividedLayer);
|
||||
priorityAndUndividedLayer);
|
||||
}
|
||||
|
||||
// 方法1:仅查询(无事务)
|
||||
@@ -718,15 +726,28 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> setPriorityAndUndividedLayer(JSONArray layers){
|
||||
HashMap<String, String> priorityAndLayer = new HashMap<>();
|
||||
for (int i = 0; i < layers.size(); i++) {
|
||||
JSONObject jsonObject = layers.getJSONObject(i);
|
||||
String priority = jsonObject.getString("priority");
|
||||
String category = jsonObject.getString("image_category").split("_")[0];
|
||||
if (!category.equals("body") && !priorityAndLayer.containsKey(priority)) priorityAndLayer.put(priority, jsonObject.getString("pattern_image_url"));
|
||||
}
|
||||
return priorityAndLayer;
|
||||
}
|
||||
|
||||
// 由于在design过程中没有priority 优先级的概念,并且在design时,不会出现上下两件使用相同服装类型的情况,所以这里依然保留这个方法。
|
||||
@Override
|
||||
public Map<String, String> setTypeAndUndividedLayer(JSONArray layers){
|
||||
HashMap<String, String> categoryAndLayer = new HashMap<>();
|
||||
HashMap<String, String> typeAndLayer = new HashMap<>();
|
||||
for (int i = 0; i < layers.size(); i++) {
|
||||
JSONObject jsonObject = layers.getJSONObject(i);
|
||||
String category = jsonObject.getString("image_category").split("_")[0];
|
||||
if (!category.equals("body") && !categoryAndLayer.containsKey(category)) categoryAndLayer.put(category, jsonObject.getString("pattern_image_url"));
|
||||
if (!category.equals("body") && !typeAndLayer.containsKey(category)) typeAndLayer.put(category, jsonObject.getString("pattern_image_url"));
|
||||
}
|
||||
return categoryAndLayer;
|
||||
return typeAndLayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -827,7 +848,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
||||
List<DesignSingleItemDTO> designSingleItemDTOList,
|
||||
List<DesignPythonOutfitVO> layersObject,
|
||||
String singleOrOverall,
|
||||
Map<String, String> categoryAndUndividedLayer) {
|
||||
Map<String, String> priorityAndUndividedLayer) {
|
||||
|
||||
DesignSingleVO designSingleVO = new DesignSingleVO();
|
||||
ArrayList<DesignItemClothesDetailVO> clothes = new ArrayList<>();
|
||||
@@ -865,7 +886,8 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
||||
String partialDesignMinioPath = singleItem.getPartialDesign().getPartialDesignMinioPath();
|
||||
String preSignedUrl = StringUtil.isNullOrEmpty(partialDesignMinioPath) ? null : minioUtil.getPreSignedUrl(partialDesignMinioPath, CommonConstant.MINIO_IMAGE_EXPIRE_TIME, true);
|
||||
designItemClothesDetailVO.setPartialDesign(new PartialDesignDTO(partialDesignMinioPath, preSignedUrl));
|
||||
if (categoryAndUndividedLayer.containsKey(singleItem.getType().toLowerCase())) designItemClothesDetailVO.setUndividedLayer(minioUtil.getPreSignedUrl(categoryAndUndividedLayer.get(singleItem.getType().toLowerCase()), CommonConstant.MINIO_IMAGE_EXPIRE_TIME, true));
|
||||
|
||||
if (priorityAndUndividedLayer.containsKey(singleItem.getPriority().toString())) designItemClothesDetailVO.setUndividedLayer(minioUtil.getPreSignedUrl(priorityAndUndividedLayer.get(singleItem.getPriority().toString()), CommonConstant.MINIO_IMAGE_EXPIRE_TIME, true));
|
||||
body.setLayersObject(layersObject.stream().filter(layers -> layers.getImageCategory().equals("body")).collect(Collectors.toList()));
|
||||
|
||||
clothes.add(designItemClothesDetailVO);
|
||||
|
||||
@@ -838,6 +838,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
d -> Math.abs(d.getPriority()),
|
||||
(existing, replacement) -> replacement));
|
||||
Map<String, String> typeAndUndividedLayer = designItemService.setTypeAndUndividedLayer(layers);
|
||||
log.info("all typeLayers Map:{}", typeAndUndividedLayer);
|
||||
for (DesignPythonItem detail : item.getItems()) {
|
||||
if (null == detail) {
|
||||
continue;
|
||||
@@ -848,7 +849,11 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
designItemDetail.setDesignItemId(designItemId);
|
||||
designItemDetail.setCollectionElementId(detail.getElementId());
|
||||
designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||
designItemDetail.setUndividedLayer(typeAndUndividedLayer.get(designItemDetail.getType().toLowerCase()));
|
||||
log.info("detail.getType():{}", detail.getType());
|
||||
if (!detail.getType().equals("Body")){
|
||||
log.info("layer : {}", typeAndUndividedLayer.get(designItemDetail.getType()));
|
||||
designItemDetail.setUndividedLayer(typeAndUndividedLayer.get(designItemDetail.getType()));
|
||||
}
|
||||
if (SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())) {
|
||||
designItemDetail.setPath(detail.getBody_path());
|
||||
//BODY不关联businessId
|
||||
@@ -979,7 +984,10 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
designItemDetail.setDesignItemId(designItemId);
|
||||
designItemDetail.setCollectionElementId(detail.getElementId());
|
||||
designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||
designItemDetail.setUndividedLayer(typeAndUndividedLayer.get(designItemDetail.getType().toLowerCase()));
|
||||
if (!detail.getType().equals("Body")){
|
||||
designItemDetail.setUndividedLayer(typeAndUndividedLayer.get(designItemDetail.getType()));
|
||||
}
|
||||
|
||||
if (SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())) {
|
||||
designItemDetail.setPath(detail.getBody_path());
|
||||
//BODY不关联businessId
|
||||
@@ -2633,7 +2641,9 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
designItemDetail.setDesignItemId(designItemId);
|
||||
designItemDetail.setCollectionElementId(detail.getElementId());
|
||||
designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||
designItemDetail.setUndividedLayer(typeAndUndividedLayer.get(designItemDetail.getType().toLowerCase()));
|
||||
if (!detail.getType().equals("Body")){
|
||||
designItemDetail.setUndividedLayer(typeAndUndividedLayer.get(designItemDetail.getType()));
|
||||
}
|
||||
if (SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())) {
|
||||
designItemDetail.setPath(detail.getBody_path());
|
||||
//BODY不关联businessId
|
||||
|
||||
@@ -184,8 +184,9 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
public void generateThroughImageText(GenerateThroughImageTextDTO generateThroughImageTextDTO) {
|
||||
// 1、获取用户信息
|
||||
Long accountId = generateThroughImageTextDTO.getUserId();
|
||||
String generateType = generateThroughImageTextDTO.getGenerateType();
|
||||
|
||||
GenerateModeEnum modeEnum = getMode(generateThroughImageTextDTO);
|
||||
String generateType = modeEnum.getValue();
|
||||
// 2、判断必须入参是否为非空(在prepare阶段已校验)
|
||||
Generate generate = new Generate();
|
||||
generate.setAccountId(accountId);
|
||||
@@ -214,9 +215,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
CollectionElement collectionElement = collectionElementService.editLevel2Type(elementId, generateThroughImageTextDTO.getLevel2Type(), generateThroughImageTextDTO.getDesignType());
|
||||
|
||||
// 3、向模型发起请求
|
||||
String mode = GenerateModeEnum.TEXT.getValue().equals(generateType) ?
|
||||
GenerateModeEnum.TEXT.getType() :
|
||||
GenerateModeEnum.TEXT_IMAGE.getType();
|
||||
String mode = modeEnum.getType();
|
||||
String category = generateThroughImageTextDTO.getLevel1Type().equals(SKETCH_BOARD.getRealName()) ? "sketch" :
|
||||
generateThroughImageTextDTO.getLevel1Type().equals(PRINT_BOARD.getRealName()) ? "print" : "moodboard";
|
||||
String path = CommonConstant.GENERATE_PATH;
|
||||
@@ -261,7 +260,6 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
jsonString = JSON.toJSONString(generateToPythonDTO, SerializerFeature.WriteMapNullValue);
|
||||
}
|
||||
|
||||
|
||||
Boolean requestResult = pythonService.generateSketchOrPrint(jsonString, port, path);
|
||||
|
||||
// 4、将请求信息落库,将本次generate的请求信息添加到t_generate表中
|
||||
@@ -280,6 +278,21 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
|
||||
}
|
||||
|
||||
public GenerateModeEnum getMode(GenerateThroughImageTextDTO generateThroughImageTextDTO){
|
||||
if (!StringUtil.isNullOrEmpty(generateThroughImageTextDTO.getText())){
|
||||
if (Objects.nonNull(generateThroughImageTextDTO.getCollectionElementId())){
|
||||
return GenerateModeEnum.TEXT_IMAGE;
|
||||
}else {
|
||||
return GenerateModeEnum.TEXT;
|
||||
}
|
||||
}else {
|
||||
if (Objects.nonNull(generateThroughImageTextDTO.getCollectionElementId())){
|
||||
return GenerateModeEnum.IMAGE;
|
||||
}
|
||||
}
|
||||
return GenerateModeEnum.TEXT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void processGenerateResult(String taskId, String url, String category) {
|
||||
@@ -410,6 +423,10 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
prefix = userInput.substring(0, userInput.indexOf(",")) + ", ";
|
||||
userInput = userInput.substring(userInput.indexOf(",") + 1);
|
||||
}
|
||||
// 替换用户输入中的中文字符
|
||||
log.info("用户输入,处理前:{}", userInput);
|
||||
userInput = ComprehensivePunctuationConverter.convertToHalfWidth(userInput);
|
||||
log.info("用户输入,处理后:{}", userInput);
|
||||
String translated = prefix + pythonService.promptTranslate(userInput);
|
||||
switch (level1Type) {
|
||||
case "Moodboard":
|
||||
@@ -1026,7 +1043,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
// todo 取消待优化
|
||||
uniqueIdList.forEach(uniqueId -> {
|
||||
// 1、将需要取消的唯一id加入redis,以便及时取消生成
|
||||
redisUtil.addToSet(cancelSetKey, uniqueId);
|
||||
redisUtil.addToSet(cancelSetKey, uniqueId, CommonConstant.REDIS_SET_EXPIRE_TIME);
|
||||
|
||||
/*// 1、确认当前消息是否还在排队中
|
||||
Boolean exists = redisUtil.isElementExistsInZSet(consumptionOrderKey, uniqueId);
|
||||
@@ -1354,12 +1371,12 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public GenerateResultVO modifySketch(GenerateModifyDTO generateModifyDTO) {
|
||||
log.info("修改生成或library中的sketch或print");
|
||||
log.info("修改生成或library中的sketch或print,并加入到library");
|
||||
|
||||
// 提取常用参数
|
||||
Long accountId = UserContext.getUserHolder().getId();
|
||||
String base64 = generateModifyDTO.getBase64();
|
||||
String gender = generateModifyDTO.getGender();
|
||||
String gender = generateModifyDTO.getGender().toLowerCase();
|
||||
String category = generateModifyDTO.getCategory();
|
||||
Long originalId = generateModifyDTO.getOriginalId();
|
||||
String originalIdSource = generateModifyDTO.getOriginalIdSource();
|
||||
@@ -3000,6 +3017,4 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -310,6 +310,7 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
|
||||
public PaymentInfo createOrUpdatePaymentInfoForStripe(Charge charge){
|
||||
Stripe.apiKey = privateKey;
|
||||
QueryWrapper<PaymentInfo> qw = new QueryWrapper<>();
|
||||
// todo 首次支付失败,没有invoiceId,所以如果这个order之后成功支付后,会有多条paymentInfo 是否需要优化??
|
||||
qw.eq("transaction_id", charge.getInvoice());
|
||||
PaymentInfo paymentInfo = baseMapper.selectOne(qw);
|
||||
Charge.PaymentMethodDetails paymentMethodDetails = charge.getPaymentMethodDetails();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user