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/http"
"net/url"
"os"
"strings"
"sync"
"time"
@ -175,8 +176,8 @@ func (s *minimaxService) processJob(job *ImageGenerationJob) {
// callMiniMaxAPI 调用 MiniMax API
func (s *minimaxService) callMiniMaxAPI(model, prompt, aspectRatio string, refs []dto.SubjectReference, n int) ([]string, error) {
apiURL := s.config.GetMiniMaxAPIURL()
apiKey := s.config.GetMiniMaxAPIKey()
apiURL := os.Getenv("MINIMAX_API_URL")
apiKey := os.Getenv("MINIMAX_API_KEY")
payload := map[string]interface{}{
"model": model,
@ -260,7 +261,7 @@ func (s *minimaxService) compressImageIfNeeded(imageURL string) (string, error)
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
switch format {