From f75d8db77ce81e349c2e77db8c8fc9eeff2dd350 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Tue, 28 Oct 2025 17:37:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=8D=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E7=B1=BB=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/aida/lanecarford/config/WebConfig.java | 2 +- .../service/impl/TryOnEffectServiceImpl.java | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/aida/lanecarford/config/WebConfig.java b/src/main/java/com/aida/lanecarford/config/WebConfig.java index c034a95..38ef71f 100644 --- a/src/main/java/com/aida/lanecarford/config/WebConfig.java +++ b/src/main/java/com/aida/lanecarford/config/WebConfig.java @@ -40,7 +40,7 @@ public class WebConfig implements WebMvcConfigurer { registry.addInterceptor(jwtInterceptor) .addPathPatterns("/api/**/**") // 保护这些路径 .excludePathPatterns(Arrays.asList("/api/auth/precheckEmail", "/api/auth/registerOrLogin", - "/api/auth/forgotPwd", "/api/style/callback")); // 排除登录接口 + "/api/auth/forgotPwd", "/api/style/callback","/api/try-on-effects/*","/api/customer-photos/*","/api/visit-records/*")); // 排除登录接口 } /** diff --git a/src/main/java/com/aida/lanecarford/service/impl/TryOnEffectServiceImpl.java b/src/main/java/com/aida/lanecarford/service/impl/TryOnEffectServiceImpl.java index 047e9d5..32e5834 100644 --- a/src/main/java/com/aida/lanecarford/service/impl/TryOnEffectServiceImpl.java +++ b/src/main/java/com/aida/lanecarford/service/impl/TryOnEffectServiceImpl.java @@ -11,6 +11,7 @@ import com.aida.lanecarford.mapper.CustomerMapper; import com.aida.lanecarford.mapper.TryOnEffectMapper; import com.aida.lanecarford.service.*; import com.aida.lanecarford.util.MinioUtil; +import com.aida.lanecarford.util.StringListConverter; import com.aida.lanecarford.vo.TryOnResultVo; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; @@ -27,10 +28,7 @@ import org.springframework.stereotype.Service; import java.io.IOException; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; +import java.util.*; import java.util.concurrent.TimeUnit; /** @@ -102,10 +100,19 @@ public class TryOnEffectServiceImpl extends ServiceImpl> maps = StringListConverter.jsonToList(style.getItems()); + StringBuffer sb = new StringBuffer(); + for (Map map : maps) { + String category = map.get("category"); + sb.append("a "); + sb.append( category); + sb.append(","); + } + prompt = "A full-body, photorealistic professional studio shot of a **young " + customer.getGender() + "**, mid-20s, with **clear facial features and a confident expression**. The model is centered in the frame.They are **standing in a direct, static, full-view pose** on a **clean, light white backdrop** **The entire figure, from head to toe, should be in frame and occupy approximately 80% of the vertical space.**.\n" + "\n" + "**CRITICAL COMPOSITION INSTRUCTION:**\n" + - "Generate a single, seamless image of the model with a complete and fully visible head,**wearing ALL distinct items** from the uploaded image. **ALL items MUST be visible and correctly worn in the final outfit.**" + + "Generate a single, seamless image of the model with a complete and fully visible head,**wearing ALL distinct items("+sb.toString()+")** from the uploaded image. **ALL items MUST be visible and correctly worn in the final outfit.**" + "\n" + "**Placement Detail:** Outerwear must be worn on the outside, and if a bag is present, it must be visible.\n" + "**Quality:** Ultra-high resolution, The figure should fill the frame as much as possible,studio photography quality. Emphasize **realistic fabric textures and sharp print fidelity**.\n" +