From 0a140250921536d5c2088ece4f1c0cc22823d358 Mon Sep 17 00:00:00 2001 From: bx1834938347-prog Date: Fri, 12 Dec 2025 09:51:56 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Aai=E7=94=9F=E6=88=90=E5=9B=BE?= =?UTF-8?q?=E6=96=87=E6=96=B0=E5=A2=9E=E9=80=89=E6=8B=A9=E5=88=86=E8=BE=A8?= =?UTF-8?q?=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/import/imageContentImport.go | 3 +++ pkg/service/import/imageContentProcessor.go | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/service/import/imageContentImport.go b/pkg/service/import/imageContentImport.go index 42dd400..7470368 100644 --- a/pkg/service/import/imageContentImport.go +++ b/pkg/service/import/imageContentImport.go @@ -42,6 +42,7 @@ type excelData struct { Content string //内容 MediaAccountUuids []string MediaAccountNames []string + PhotoDpi string } type publishImageReq struct { ArtistName string //艺人 @@ -197,6 +198,7 @@ func readExcel(excelPath string) ([]excelData, error) { photoRequire := getCellValue(f, sheetName, i, 7) photoUrl := getCellValue(f, sheetName, i, 8) photoNumStr := getCellValue(f, sheetName, i, 9) + photoDpi := getCellValue(f, sheetName, i, 10) var num int if photoUrl == "" { //如果没有关联画作,数量必须有,需求必须有 //需求必须有 @@ -227,6 +229,7 @@ func readExcel(excelPath string) ([]excelData, error) { PhotoUrl: photoUrl, PhotoNum: num, LineNum: i, //行数 + PhotoDpi: photoDpi, } result = append(result, data) diff --git a/pkg/service/import/imageContentProcessor.go b/pkg/service/import/imageContentProcessor.go index d2544fe..862a6d9 100644 --- a/pkg/service/import/imageContentProcessor.go +++ b/pkg/service/import/imageContentProcessor.go @@ -650,9 +650,13 @@ func (p *BatchProcessor) generateImage(req *excelData) (string, error) { prompt += "\n请基于标题和内容生成单张图片,高质量,高分辨率。" prompt += "\n要求不能出现:低质量、残缺、人物正脸、多余的手指、乱码字符和文字、比例不良,场景以国内场景为主" + if req.PhotoDpi == "" { + req.PhotoDpi = "720*1280" + + } result, err := NewAiGenerator().TextToImage( prompt, - "1024*1024", + req.PhotoDpi, 1, ) if err != nil {