Merge commit '3d149fedf45472eff92910324974c762fc37dad6'

This commit is contained in:
Laisky.Cai
2024-04-21 15:05:13 +00:00
45 changed files with 649 additions and 223 deletions

View File

@@ -1,13 +1,15 @@
package controller
import (
"net/http"
"strconv"
"github.com/Laisky/one-api/common/config"
"github.com/Laisky/one-api/common/ctxkey"
"github.com/Laisky/one-api/common/helper"
"github.com/Laisky/one-api/common/random"
"github.com/Laisky/one-api/model"
"github.com/gin-gonic/gin"
"net/http"
"strconv"
)
func GetAllRedemptions(c *gin.Context) {
@@ -109,7 +111,7 @@ func AddRedemption(c *gin.Context) {
for i := 0; i < redemption.Count; i++ {
key := random.GetUUID()
cleanRedemption := model.Redemption{
UserId: c.GetInt("id"),
UserId: c.GetInt(ctxkey.Id),
Name: redemption.Name,
Key: key,
CreatedTime: helper.GetTimestamp(),