fix: preserve explicit zero values in native relay requests

This commit is contained in:
Seefs
2026-03-01 15:47:03 +08:00
parent e22f59e449
commit 2cf3c1836c
52 changed files with 523 additions and 232 deletions

View File

@@ -15,6 +15,7 @@ import (
"github.com/QuantumNous/new-api/types"
"github.com/gin-gonic/gin"
"github.com/samber/lo"
)
type Adaptor struct {
@@ -53,7 +54,9 @@ func (a *Adaptor) ConvertImageRequest(c *gin.Context, info *relaycommon.RelayInf
sfRequest.ImageSize = request.Size
}
if sfRequest.BatchSize == 0 {
sfRequest.BatchSize = request.N
if request.N != nil {
sfRequest.BatchSize = lo.FromPtr(request.N)
}
}
return sfRequest, nil