feat: add funcitons manger page

This commit is contained in:
RockYang
2023-12-21 08:58:24 +08:00
parent bf19120c27
commit 7c4dfe96ee
12 changed files with 216 additions and 190 deletions

View File

@@ -146,6 +146,9 @@ func (h *MidJourneyHandler) Image(c *gin.Context) {
Prompt: fmt.Sprintf("%s %s", taskId, prompt),
UserId: userId,
})
// update user's img calls
h.db.Model(&model.User{}).Where("id = ?", job.UserId).UpdateColumn("img_calls", gorm.Expr("img_calls - ?", 1))
resp.SUCCESS(c)
}
@@ -246,6 +249,9 @@ func (h *MidJourneyHandler) Variation(c *gin.Context) {
MessageId: data.MessageId,
MessageHash: data.MessageHash,
})
// update user's img calls
h.db.Model(&model.User{}).Where("id = ?", job.UserId).UpdateColumn("img_calls", gorm.Expr("img_calls - ?", 1))
resp.SUCCESS(c)
}