TASK:模块化;

This commit is contained in:
shahaibo
2025-05-02 14:26:21 +08:00
parent 82d65c3015
commit be019dcdd0

View File

@@ -1813,7 +1813,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
}else if (cloudTaskDTO.getBuildType().equals(BuildType.TO_PRODUCT_IMAGE.getValue())) { }else if (cloudTaskDTO.getBuildType().equals(BuildType.TO_PRODUCT_IMAGE.getValue())) {
ToProductImageDTO toProductImageDTO = cloudTaskDTO.getToProductImage(); ToProductImageDTO toProductImageDTO = cloudTaskDTO.getToProductImage();
// 判断用户当前积分是否够本次生成消耗 // 判断用户当前积分是否够本次生成消耗
Boolean preDeduction = creditsService.creditsPreDeduction(cloudTaskDTO.getCostCredits()); Boolean preDeduction = creditsService.creditsPreDeduction(Integer.parseInt(CreditsEventsEnum.TO_PRODUCT_IMAGE.getValue()) * cloudTaskDTO.getNums());
if (!preDeduction) { if (!preDeduction) {
throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode()); throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode());
} }
@@ -2035,7 +2035,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
}else if (cloudTaskDTO.getBuildType().equals(BuildType.RELIGHT.getValue())) { }else if (cloudTaskDTO.getBuildType().equals(BuildType.RELIGHT.getValue())) {
ToProductImageDTO toProductImageDTO = cloudTaskDTO.getToProductImage(); ToProductImageDTO toProductImageDTO = cloudTaskDTO.getToProductImage();
// 判断用户当前积分是否够本次生成消耗 // 判断用户当前积分是否够本次生成消耗
Boolean preDeduction = creditsService.creditsPreDeduction(cloudTaskDTO.getCostCredits()); Boolean preDeduction = creditsService.creditsPreDeduction(Integer.parseInt(CreditsEventsEnum.RELIGHT.getValue()) * cloudTaskDTO.getNums());
if (!preDeduction) { if (!preDeduction) {
throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode()); throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode());
} }
@@ -2142,7 +2142,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
return batchTaskId; return batchTaskId;
} else if (cloudTaskDTO.getBuildType().equals(BuildType.POSE_TRANSFORM.getValue())) { } else if (cloudTaskDTO.getBuildType().equals(BuildType.POSE_TRANSFORM.getValue())) {
Long accountId = UserContext.getUserHolder().getId(); Long accountId = UserContext.getUserHolder().getId();
Boolean preDeduction = creditsService.creditsPreDeduction(cloudTaskDTO.getCostCredits()); Boolean preDeduction = creditsService.creditsPreDeduction(Integer.parseInt(CreditsEventsEnum.POSE_TRANSFORMATION.getValue()) * cloudTaskDTO.getNums());
if (!preDeduction) { if (!preDeduction) {
throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode()); throw new BusinessException("Your remaining credits are insufficient for this generation. Please recharge.", ResultEnum.WARNING.getCode());
} }