【增加】系统账户余额不足提示

This commit is contained in:
cherishsince
2024-06-18 11:29:19 +08:00
parent bdbe2633e1
commit e1848895da
2 changed files with 4 additions and 0 deletions

View File

@ -147,6 +147,9 @@ public class AiImageServiceImpl implements AiImageService {
// 4、保存任务 id (状态码: 1(提交成功), 21(已存在), 22(排队中), other(错误))
if (!MidjourneyApi.SubmitCodeEnum.SUCCESS_CODES.contains(submitResponse.code())) {
if (submitResponse.description().contains("quota_not_enough")) {
throw exception(AI_IMAGE_SYSTEM_ACCOUNT_INSUFFICIENT_BALANCE, submitResponse.description());
}
throw exception(AI_IMAGE_MIDJOURNEY_SUBMIT_FAIL, submitResponse.description());
}
// 4.1、更新 taskId 和参数