mirror of
https://github.com/vastxie/99AI.git
synced 2025-11-13 12:13:43 +08:00
v 2.5.0
This commit is contained in:
10
dist/modules/midjourney/midjourney.service.js
vendored
10
dist/modules/midjourney/midjourney.service.js
vendored
@@ -92,6 +92,7 @@ let MidjourneyService = class MidjourneyService {
|
||||
await this.updateDrawData(jobData, drawRes);
|
||||
this.lockPrompt = this.lockPrompt.filter((item) => item !== drawInfo.randomDrawId);
|
||||
}
|
||||
this.drawSuccess(jobData);
|
||||
return true;
|
||||
}
|
||||
catch (error) {
|
||||
@@ -754,10 +755,15 @@ let MidjourneyService = class MidjourneyService {
|
||||
}
|
||||
async drawFailed(jobData) {
|
||||
const { id, userId, action } = jobData;
|
||||
const amount = action === 2 ? 1 : 4;
|
||||
await this.userBalanceService.refundMjBalance(userId, amount);
|
||||
await this.midjourneyEntity.update({ id }, { status: 4 });
|
||||
}
|
||||
async drawSuccess(jobData) {
|
||||
const { id, userId, action } = jobData;
|
||||
const amount = action === 2 ? 1 : 4;
|
||||
common_1.Logger.debug(`绘画完成,执行扣费,扣除费用:${amount}积分。`);
|
||||
await this.userBalanceService.refundMjBalance(userId, -amount);
|
||||
await this.midjourneyEntity.update({ id }, { status: 3 });
|
||||
}
|
||||
async getList(params) {
|
||||
const { page = 1, size = 20, rec, userId, status } = params;
|
||||
if (Number(size) === 999) {
|
||||
|
||||
Reference in New Issue
Block a user