BUGFIX:检查所有异常提示的语言是否都做了多语言

This commit is contained in:
2025-09-24 14:21:07 +08:00
parent ed86cd45ad
commit dab253c313
17 changed files with 118 additions and 62 deletions

View File

@@ -208,7 +208,7 @@ public class SRConsumer {
redisUtil.removeFromZSet(consumptionOrderKey, uniqueId);
} catch (Exception exception) {
log.error("手动确认,取消返回队列,不再重新消费");
throw new BusinessException("发生错误,手动确认消息");
throw new BusinessException("message.confirm.fail");
}
// 将入参和错误信息存入redis
String exceptionMessage = JSONObject.toJSONString(superResolutionDTO) +

View File

@@ -2,6 +2,7 @@ package com.ai.da.common.utils;
import com.ai.da.common.config.exception.BusinessException;
import com.ai.da.common.constant.CommonConstant;
import com.ai.da.common.response.ResultEnum;
import com.ai.da.mapper.primary.entity.ObjectItem;
import io.minio.*;
import io.minio.errors.*;
@@ -361,7 +362,7 @@ public class MinioUtil {
public void deleteObject(String path) {
if (!path.contains("/")) {
throw new BusinessException("The path is error!");
throw new BusinessException("the.path.is.error");
}
int index = path.indexOf("/");
String bucketName = path.substring(0, index);
@@ -420,7 +421,7 @@ public class MinioUtil {
return LocalCacheUtils.getPresignedUrlCache(path);
} else {
if (!path.contains("/")) {
throw new BusinessException("The path is error!");
throw new BusinessException("the.path.is.error");
}
int index = path.indexOf("/");
String bucketName = path.substring(0, index);
@@ -434,7 +435,7 @@ public class MinioUtil {
public String getPreSignedUrl(String path, int expiry, boolean resetCache) {
if (resetCache || LocalCacheUtils.getPresignedUrlCache(path) == null) {
if (!path.contains("/")) {
throw new BusinessException("The path is error!");
throw new BusinessException("the.path.is.error");
}
int index = path.indexOf("/");
String bucketName = path.substring(0, index);
@@ -675,7 +676,7 @@ public class MinioUtil {
.build());
} catch (MinioException | IOException | NoSuchAlgorithmException | InvalidKeyException e){
log.error("图片上传到minio出错{}", e.getMessage());
throw new BusinessException("file upload exception");
throw new BusinessException("file.upload.fail");
}
}
@@ -713,7 +714,7 @@ public class MinioUtil {
// return base64Image;
} catch (Exception e) {
log.error(e.getMessage());
throw new BusinessException("透明图添加白色背景失败");
throw new BusinessException("white.bg.add.fail", ResultEnum.PROMPT.getCode());
}
}

View File

@@ -215,7 +215,7 @@ public class S3Util {
public void deleteObject(String path) {
if (!path.contains("/")) {
throw new BusinessException("The path is error!");
throw new BusinessException("the.path.is.error");
}
int index = path.indexOf("/");
String bucketName = path.substring(0, index);
@@ -244,7 +244,7 @@ public class S3Util {
return LocalCacheUtils.getPresignedUrlCache(path);
} else {
if (!path.contains("/")) {
throw new BusinessException("The path is error!");
throw new BusinessException("the.path.is.error");
}
int index = path.indexOf("/");
String bucketName = path.substring(0, index);
@@ -258,7 +258,7 @@ public class S3Util {
public String getPreSignedUrl(String path, int expiry, boolean resetCache) {
if (resetCache || LocalCacheUtils.getPresignedUrlCache(path) == null) {
if (!path.contains("/")) {
throw new BusinessException("The path is error!");
throw new BusinessException("the.path.is.error");
}
int index = path.indexOf("/");
String bucketName = path.substring(0, index);

View File

@@ -38,8 +38,8 @@ public class ProjectQueryDTO extends PageQueryBaseVo {
private Integer intersection;
// todo 获取历史列表,允许传入多个类型
// private List<String> process;
private String process;
private List<String> process;
// private String process;
private Integer asc;
}

View File

@@ -631,7 +631,7 @@ public class PythonService {
case SYS_FILE:
return processNoPinOrSysFileAttributeRecognition(attributeRecognition, elementVO, styleCategory, systemScale);
default:
throw new BusinessException("unknown designPictureType");
throw new BusinessException("unknown.designPictureType");
}
}
@@ -674,7 +674,7 @@ public class PythonService {
String recommendSystemSketch = recommentdUrlList.get(0);
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, styleCategory, elementVO);
}else {
throw new BusinessException("Failed to obtain system sketch recommendation.");
throw new BusinessException("failed.to.obtain.system.sketch.recommendation");
}
}else {
if (CollectionUtil.isNotEmpty(collectionElements)) {
@@ -688,7 +688,7 @@ public class PythonService {
String recommendSystemSketch = recommentdUrlList.get(0);
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, styleCategory, elementVO);
}else {
throw new BusinessException("Failed to obtain system sketch recommendation.");
throw new BusinessException("failed.to.obtain.system.sketch.recommendation");
}
}
}
@@ -1044,7 +1044,7 @@ public class PythonService {
String recommendSystemSketch = recommentdUrlList.get(0);
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
}else {
throw new BusinessException("Failed to obtain system sketch recommendation.");
throw new BusinessException("failed.to.obtain.system.sketch.recommendation");
}
// JSONObject attributeRecognition = getAttributeRecognitionBySameCategory(element, validateElementVO.getModelSex());
// return processAttributeRecognitionBySameCategory(attributeRecognition, validateElementVO, element.getLevel2Type());
@@ -1067,7 +1067,7 @@ public class PythonService {
String recommendSystemSketch = recommentdUrlList.get(0);
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
}else {
throw new BusinessException("Failed to obtain system sketch recommendation.");
throw new BusinessException("failed.to.obtain.system.sketch.recommendation");
}
// String tableName = getTableName(validateElementVO.getModelSex(), category);
@@ -1103,7 +1103,7 @@ public class PythonService {
String recommendSystemSketch = recommentdUrlList.get(0);
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
}else {
throw new BusinessException("Failed to obtain system sketch recommendation.");
throw new BusinessException("failed.to.obtain.system.sketch.recommendation");
}
// JSONObject attributeRecognition = getAttributeRecognitionBySameCategory(element, validateElementVO.getModelSex());
// return processAttributeRecognitionBySameCategory(attributeRecognition, validateElementVO, element.getLevel2Type());
@@ -1127,7 +1127,7 @@ public class PythonService {
String recommendSystemSketch = recommentdUrlList.get(0);
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
}else {
throw new BusinessException("Failed to obtain system sketch recommendation.");
throw new BusinessException("failed.to.obtain.system.sketch.recommendation");
}
// String tableName = getTableName(validateElementVO.getModelSex(), category);
//
@@ -2848,7 +2848,7 @@ public class PythonService {
if (!Objects.isNull(designSingleItem.getGradient())) {
String colorImg = designSingleItem.getGradient().getColorImg();
if (StringUtil.isNullOrEmpty(colorImg)) {
throw new BusinessException("The base64 data of the image is empty");
throw new BusinessException("base64.data.empty");
}
minioPath = minioUtil.base64UploadToPath(colorImg, gradientBucketName, null);
designSingleItem.getGradient().setColorImg(null);
@@ -2978,7 +2978,7 @@ public class PythonService {
}
} else {
log.error("designType为Generate的印花path传值为空 {}", print.getPath());
throw new BusinessException("The path for the print is empty.");
throw new BusinessException("path.cannot.be.empty");
}
}
}
@@ -3425,7 +3425,7 @@ public class PythonService {
return response;
}
private List<String> setGenerateImageList(JSONObject jsonObject) {
/* private List<String> setGenerateImageList(JSONObject jsonObject) {
List<String> imageUrlList = JSONObject.parseArray(jsonObject.get("list").toString(), String.class);
if (imageUrlList.isEmpty()) {
log.error("PythonService##generateSketchOrPrint异常###{}", "diffusion response list is null");
@@ -3434,7 +3434,7 @@ public class PythonService {
}
return imageUrlList;
}
}*/
/** 废弃状态 */
public String composeLayers(List<OutfitDetailPythonItem> layersDetail) {
HashMap<String, List<OutfitDetailPythonItem>> layers = new HashMap<>();

View File

@@ -152,7 +152,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
account.setUserPassword(accountDTO.getPassword());
accountMapper.updateById(account);
} else if ("Third-000000".equals(account.getUserPassword())){
throw new BusinessException("Password cannot be empty");
throw new BusinessException("password.cannot.be.empty");
} else {
if (!account.getUserPassword().equals(accountDTO.getPassword())) {
throw new BusinessException("password.error", ResultEnum.PROMPT.getCode());
@@ -632,13 +632,13 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
@Override
public Boolean editUser(AccountEditDTO accountEditDTO) {
if (Objects.isNull(accountEditDTO) || ObjectUtils.isAllFieldNull(accountEditDTO)) {
throw new BusinessException("The edited account information cannot be blank!");
throw new BusinessException("edited.account.information.cannot.be.blank");
}
QueryWrapper<Account> queryTotal = new QueryWrapper<>();
Account account = new Account();
//校验
if (StringUtils.isNotBlank(accountEditDTO.getNewEmail())) {
Assert.isTrue(StringUtils.isNotBlank(accountEditDTO.getOldEmail()), "oldEmail cannot be empty!");
Assert.isTrue(StringUtils.isNotBlank(accountEditDTO.getOldEmail()), "oldEmail.cannot.be.empty");
queryTotal.eq("user_email", accountEditDTO.getOldEmail());
Account accountSelect = accountMapper.selectOne(queryTotal);
Assert.notNull(accountSelect, "oldEmail does not exist!");
@@ -646,31 +646,31 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
account.setUserEmail(accountEditDTO.getNewEmail());
}
if (StringUtils.isNotBlank(accountEditDTO.getNewUserName())) {
Assert.isTrue(StringUtils.isNotBlank(accountEditDTO.getOldUserName()), "oldUserName cannot be empty!");
Assert.isTrue(StringUtils.isNotBlank(accountEditDTO.getOldUserName()), "oldUserName.cannot.be.empty");
queryTotal.eq("user_name", accountEditDTO.getOldUserName());
Account accountSelect = accountMapper.selectOne(queryTotal);
Assert.notNull(accountSelect, "oldUserName does not exist!");
Assert.notNull(accountSelect, "oldUserName.does.not.exist");
account.setUserName(accountEditDTO.getNewUserName());
}
if (StringUtils.isNotBlank(accountEditDTO.getNewValidStartTime())) {
Assert.isTrue(StringUtils.isNotBlank(accountEditDTO.getOldUserName()), "oldUserName cannot be empty!");
Assert.isTrue(StringUtils.isNotBlank(accountEditDTO.getOldUserName()), "oldUserName.cannot.be.empty");
queryTotal.eq("user_name", accountEditDTO.getOldUserName());
Account accountSelect = accountMapper.selectOne(queryTotal);
Assert.notNull(accountSelect, "oldUserName does not exist!");
Assert.notNull(accountSelect, "oldUserName.does.not.exist");
account.setValidStartTime(Long.valueOf(accountEditDTO.getNewValidStartTime()));
}
if (StringUtils.isNotBlank(accountEditDTO.getNewValidEndTime())) {
Assert.isTrue(StringUtils.isNotBlank(accountEditDTO.getOldUserName()), "oldUserName cannot be empty!");
Assert.isTrue(StringUtils.isNotBlank(accountEditDTO.getOldUserName()), "oldUserName.cannot.be.empty");
queryTotal.eq("user_name", accountEditDTO.getOldUserName());
Account accountSelect = accountMapper.selectOne(queryTotal);
Assert.notNull(accountSelect, "oldUserName does not exist!");
Assert.notNull(accountSelect, "oldUserName.does.not.exist");
account.setValidEndTime(toDayEnd(Long.parseLong(accountEditDTO.getNewValidEndTime())));
}
Account accountSelect = accountMapper.selectOne(queryTotal);
Assert.notNull(accountSelect, "oldAccount does not exist!");
Assert.notNull(accountSelect, "oldAccount.does.not.exist");
accountMapper.update(account, queryTotal);
return null;
}
@@ -3165,7 +3165,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
List<AccountExtend> accountExtends = accountExtendMapper.selectList(qw);
if (CollectionUtil.isNotEmpty(accountExtends)) {
throw new BusinessException("The Google has been bound.");
throw new BusinessException("the.Google.has.been.bound");
}
AccountExtend accountExtendInsert = new AccountExtend();
@@ -3194,7 +3194,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
String openId = accessTokenResponse.getString("openid");
if (StringUtils.isEmpty(accessToken) || StringUtils.isEmpty(openId)) {
throw new RuntimeException("微信接口返回数据缺失: " + accessTokenResponse.toJSONString());
log.error("微信接口返回数据缺失: {}", accessTokenResponse.toJSONString());
throw new BusinessException("Unable.to.obtain.WeChat.account.information");
}
// 2. 获取用户信息
@@ -3205,7 +3206,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
String userName = userInfoResponse.getString("nickname");
String headimgurl = userInfoResponse.getString("headimgurl");
if (unionId == null) {
throw new IllegalArgumentException("无法获取 unionid请检查微信开发平台配置");
log.error("无法获取 unionid请检查微信开发平台配置");
throw new BusinessException("Unable.to.obtain.WeChat.account.information");
}
QueryWrapper<AccountExtend> qw = new QueryWrapper<>();
qw.lambda().eq(AccountExtend::getAuth, unionId);

View File

@@ -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.ResultEnum;
import com.ai.da.common.utils.RedisUtil;
import com.ai.da.mapper.primary.AccountMapper;
import com.ai.da.mapper.primary.CreditsDetailMapper;
@@ -183,7 +184,7 @@ public class CreditsServiceImpl extends ServiceImpl<CreditsDetailMapper, Credits
Account account = accountMapper.selectById(accountId);
if (account == null) {
log.error("账户:{} 不存在", accountId);
throw new BusinessException("账户不存在");
throw new BusinessException("user.has.no.account", ResultEnum.PROMPT.getCode());
}
BigDecimal existingCredits = Optional.ofNullable(account.getCredits()).orElse(BigDecimal.ZERO);
BigDecimal subtract = existingCredits.subtract(sum);

View File

@@ -970,7 +970,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
}
} else {
log.error("designType为Generate的印花path传值为空 {}", print.getPath());
throw new BusinessException("The path for the print is empty.");
throw new BusinessException("path.cannot.be.empty");
}
}
}

View File

@@ -1848,7 +1848,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
// 判断用户当前积分是否够本次生成消耗
Boolean preDeduction = creditsService.creditsPreDeduction(CreditsEventsEnum.TO_PRODUCT_IMAGE, cloudTaskDTO.getNums());
if (!preDeduction) {
throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode());
throw new BusinessException("remaining.credits.insufficient", ResultEnum.WARNING.getCode());
}
AuthPrincipalVo userHolder = UserContext.getUserHolder();
@@ -2036,7 +2036,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
// 判断用户当前积分是否够本次生成消耗
Boolean preDeduction = creditsService.creditsPreDeduction(CreditsEventsEnum.RELIGHT, cloudTaskDTO.getNums());
if (!preDeduction) {
throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode());
throw new BusinessException("remaining.credits.insufficient", ResultEnum.WARNING.getCode());
}
AuthPrincipalVo userHolder = UserContext.getUserHolder();
@@ -2206,7 +2206,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
Boolean preDeduction = creditsService.creditsPreDeduction(CreditsEventsEnum.POSE_TRANSFORMATION, cloudTaskDTO.getNums());
if (!preDeduction) {
throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode());
throw new BusinessException("remaining.credits.insufficient", ResultEnum.WARNING.getCode());
}
Long projectId = cloudTaskDTO.getProjectId();

View File

@@ -307,7 +307,8 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
if (e.getMessage().equals("One record is expected, but the query result is multiple records")) {
generate = selectListByUniqueId(taskId).get(0);
} else {
throw new BusinessException("There are some problems with database query, please try again.");
log.error("There are some problems with database query, please try again.");
return;
}
}
// Generate generate = selectByUniqueId(taskId);
@@ -617,7 +618,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
*/
private void validateRequiredParams(GenerateThroughImageTextDTO generateDTO) {
if (Objects.isNull(generateDTO.getUserId())) {
throw new BusinessException("userId cannot be empty");
throw new BusinessException("userId.cannot.be.empty");
}
// Printboard必须要有level2Type
@@ -1552,6 +1553,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
poseTransformationMapper.insert(poseTransformation);
// 当需要默认like
ToProductImageResultVO toProductImageResultVO = new ToProductImageResultVO();
toProductImageResultVO.setId(poseTransformation.getId());
toProductImageResultVO.setParentId(poseTransformDTO.getParentId());
toProductImageResultVO.setResultType(Module.poseTransfer.getValue());
toProductImageResultVO.setTaskId(taskId);
@@ -1585,7 +1587,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
projectService.modifyProjectUpdateTime(projectId);
return toProductImageResultVO;
}
throw new BusinessException("pose transformation error", ResultEnum.ERROR.getCode());
throw new BusinessException("pose.transformation.error", ResultEnum.ERROR.getCode());
}
private CollectionSort addPoseTransferLike(PoseTransformDTO poseTransformDTO, Long poseTransformationId) {

View File

@@ -84,7 +84,7 @@ public class MessageCenterServiceImpl extends ServiceImpl<NotificationMapper, No
public PageBaseResponse<NotificationVO> getHistoryNotification(GetNotificationDTO getNotificationDTO) {
log.info("获取历史消息parameter => {}", getNotificationDTO);
if (StringUtil.isNullOrEmpty(getNotificationDTO.getType())){
throw new BusinessException("type cannot be empty");
throw new BusinessException("type.cannot.be.empty");
}
Long accountId = UserContext.getUserHolder().getId();
// 查动态

View File

@@ -159,7 +159,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
existSameNameQw.lambda().eq(Portfolio::getAccountId, authPrincipalVo.getId());
List<Portfolio> portfoliosSameName = portfolioMapper.selectList(existSameNameQw);
if (!CollectionUtils.isEmpty(portfoliosSameName)) {
throw new BusinessException("The title of the published work has been used.");
throw new BusinessException("title.has.been.used");
}
// 判断用户是否参与#RCAworkshop_2024的活动
// if (hasParticipatedRCAWorkshop(authPrincipalVo.getId(), portfolioDTO.getTagsDTO(), portfolioDTO.getId(), portfolioDTO.getUserLikeGroupId())){
@@ -307,7 +307,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
existSameNameQw.lambda().eq(Portfolio::getAccountId, authPrincipalVo.getId());
List<Portfolio> portfoliosSameName = portfolioMapper.selectList(existSameNameQw);
if (!CollectionUtils.isEmpty(portfoliosSameName)) {
throw new BusinessException("The title of the published work has been used.");
throw new BusinessException("title.has.been.used");
}
if (portfolioDTO.getPortfolioType().equals("History")) {
Long userLikeGroupId;
@@ -986,7 +986,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
AuthPrincipalVo userHolder = UserContext.getUserHolder();
if (!Objects.equals(portfolio.getAccountId(), userHolder.getId())) {
if (!Objects.equals(comment.getAccountId(), userHolder.getId())) {
throw new BusinessException("You do not have the permission to delete this comment");
throw new BusinessException("do.not.have.the.permission.to.delete.this.comment");
}
}

View File

@@ -121,7 +121,7 @@ public class StripeServiceImpl implements StripeService {
productEnum = ProductEnum.DailySubscription;
break;
default:
throw new BusinessException("unknown subscription type");
throw new BusinessException("unknown.subscription.type");
}
// 添加优惠券(只允许在订阅时使用优惠券)
@@ -137,7 +137,7 @@ public class StripeServiceImpl implements StripeService {
// sessionBuilder.setAllowPromotionCodes(true);
break;
default:
throw new BusinessException("unknown product type");
throw new BusinessException("unknown.product.type");
}
log.info("生成订单");
String payType;
@@ -1501,7 +1501,7 @@ public class StripeServiceImpl implements StripeService {
public ProductCoupons updateCouponsInfo(Long id, String paidCommission, String cooperator, String remark, Long startTime){
ProductCoupons productCoupons = productCouponsMapper.selectById(id);
if (Objects.isNull(productCoupons)){
throw new BusinessException("Unknown Promotion Code");
throw new BusinessException("unknown.Promotion.Code");
}
boolean flag = false;
if (!StringUtil.isNullOrEmpty(cooperator)){
@@ -1691,7 +1691,7 @@ public class StripeServiceImpl implements StripeService {
Stripe.apiKey = privateKey;
ProductCoupons productCoupons = productCouponsMapper.selectById(id);
if (Objects.isNull(productCoupons)){
throw new BusinessException("unknown promotion code");
throw new BusinessException("unknown.Promotion.Code");
}
try {
Coupon coupon = Coupon.retrieve(productCoupons.getCouponId());

View File

@@ -77,11 +77,11 @@ public class TrialOrderServiceImpl extends ServiceImpl<TrialOrderMapper, TrialOr
List<Account> accountList = accountMapper.selectList(qw);
if (CollectionUtil.isNotEmpty(accountList) && !accountList.get(0).getSystemUser().equals(0)) {
if (accountList.get(0).getIsTrial() == 1) {
throw new BusinessException("The email has already been registered", ResultEnum.PROMPT.getCode());
throw new BusinessException("email.has.been.registered", ResultEnum.PROMPT.getCode());
} else {
Account account = accountList.get(0);
if (null == account.getValidEndTime() || account.getValidEndTime() > System.currentTimeMillis()) {
throw new BusinessException("The email has already been registered", ResultEnum.PROMPT.getCode());
throw new BusinessException("email.has.been.registered", ResultEnum.PROMPT.getCode());
}
}
}

View File

@@ -359,7 +359,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
AuthPrincipalVo userHolder = UserContext.getUserHolder();
if (Objects.isNull(projectId) && !module.equals("designItemDetail")){
log.warn("用户 {} 保存 {} 模块的画布时, projectId为空", userHolder.getId(), module);
throw new BusinessException("project id cannot be empty", ResultEnum.PROMPT.getCode());
throw new BusinessException("project.id.cannot.be.empty", ResultEnum.PROMPT.getCode());
}
QueryWrapper<ExportFile> qw = new QueryWrapper<>();
@@ -410,7 +410,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
CreditsEventsEnum creditsEventsEnum = fluxTask ? CreditsEventsEnum.TO_PRODUCT_IMAGE_FLUX : CreditsEventsEnum.TO_PRODUCT_IMAGE;
Boolean preDeduction = creditsService.creditsPreDeduction(creditsEventsEnum, toProductImageDTO.getToProductImageVOList().size());
if (!preDeduction) {
throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode());
throw new BusinessException("remaining.credits.insufficient", ResultEnum.WARNING.getCode());
}
AuthPrincipalVo userHolder = UserContext.getUserHolder();
@@ -738,7 +738,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
qw.lambda().eq(ToProductImageResult::getTaskId, taskId);
ToProductImageResult toProductImageResult = toProductImageResultMapper.selectOne(qw);
if (Objects.isNull(toProductImageResult)) {
throw new BusinessException("The source image does not exist.");
throw new BusinessException("source.image.does.not.exist");
}
ToProductImageRecord toProductImageRecord = toProductImageRecordMapper.selectById(toProductImageResult.getToProductImageRecordId());
if (Objects.isNull(toProductImageRecord)) {
@@ -1090,7 +1090,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
CreditsEventsEnum creditsEventsEnum = fluxTask ? CreditsEventsEnum.RELIGHT_FLUX : CreditsEventsEnum.RELIGHT;
Boolean preDeduction = creditsService.creditsPreDeduction(creditsEventsEnum, toProductImageDTO.getToProductImageVOList().size());
if (!preDeduction) {
throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode());
throw new BusinessException("remaining.credits.insufficient", ResultEnum.WARNING.getCode());
}
AuthPrincipalVo userHolder = UserContext.getUserHolder();
@@ -1257,7 +1257,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
qw.lambda().eq(ToProductImageResult::getTaskId, taskId);
ToProductImageResult toProductImageResult = toProductImageResultMapper.selectOne(qw);
if (Objects.isNull(toProductImageResult)) {
throw new BusinessException("The source image does not exist.");
throw new BusinessException("source.image.does.not.exist");
}
ToProductImageRecord toProductImageRecord = toProductImageRecordMapper.selectById(toProductImageResult.getToProductImageRecordId());
if (Objects.isNull(toProductImageRecord)) {
@@ -1726,10 +1726,10 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
if (Objects.nonNull(query.getEndDate())) {
queryWrapper.le("update_time", new Date(query.getEndDate()));
}
if (!StringUtils.isEmpty(query.getProcess())) {
if (Objects.nonNull(query.getProcess()) && !query.getProcess().isEmpty()) {
// todo 获取历史列表,允许传入多个类型
// queryWrapper.in("process", query.getProcess());
queryWrapper.eq("process", query.getProcess());
queryWrapper.in("process", query.getProcess());
// queryWrapper.eq("process", query.getProcess());
}
// 新增分类过滤
if (CollectionUtil.isNotEmpty(query.getClassificationIdList())) {