fix: minimax_service 修复编译错误

- 使用 resize.Lanczos3 替代不存在的 resize.Lanczos
- 使用 os.Getenv 替代缺失的 config 方法

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
zerosaturation 2026-04-07 23:55:09 +08:00
parent ed2acc3268
commit d09f1122ce

View File

@ -14,6 +14,7 @@ import (
"net" "net"
"net/http" "net/http"
"net/url" "net/url"
"os"
"strings" "strings"
"sync" "sync"
"time" "time"
@ -175,8 +176,8 @@ func (s *minimaxService) processJob(job *ImageGenerationJob) {
// callMiniMaxAPI 调用 MiniMax API // callMiniMaxAPI 调用 MiniMax API
func (s *minimaxService) callMiniMaxAPI(model, prompt, aspectRatio string, refs []dto.SubjectReference, n int) ([]string, error) { func (s *minimaxService) callMiniMaxAPI(model, prompt, aspectRatio string, refs []dto.SubjectReference, n int) ([]string, error) {
apiURL := s.config.GetMiniMaxAPIURL() apiURL := os.Getenv("MINIMAX_API_URL")
apiKey := s.config.GetMiniMaxAPIKey() apiKey := os.Getenv("MINIMAX_API_KEY")
payload := map[string]interface{}{ payload := map[string]interface{}{
"model": model, "model": model,
@ -260,7 +261,7 @@ func (s *minimaxService) compressImageIfNeeded(imageURL string) (string, error)
return "data:image/jpeg;base64," + base64.StdEncoding.EncodeToString(imgData), nil return "data:image/jpeg;base64," + base64.StdEncoding.EncodeToString(imgData), nil
} }
resized := resize.Thumbnail(newWidth, newHeight, img, resize.Lanczos) resized := resize.Thumbnail(newWidth, newHeight, img, resize.Lanczos3)
var buf bytes.Buffer var buf bytes.Buffer
switch format { switch format {