fix:获取历史记录加入顾客id
All checks were successful
git commit 控制 连卡佛 back-java prod 分支构建部署 / build_and_deploy (push) Has been skipped
All checks were successful
git commit 控制 连卡佛 back-java prod 分支构建部署 / build_and_deploy (push) Has been skipped
This commit is contained in:
@@ -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/parseGoogleAccessToken")); // 排除登录接口
|
||||
"/api/auth/forgotPwd", "/api/style/callback", "/api/auth/parseGoogleAccessToken","/api/try-on-effects/getHistoricals")); // 排除登录接口
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,7 +47,7 @@ public class TryOnEffectController {
|
||||
@GetMapping("/getHistoricals")
|
||||
public ApiResponse<List<? extends BaseVO>> getHistoricals(
|
||||
@Parameter(description = "服装ID", required = true)
|
||||
@RequestBody HistoricalDTO historicalDTO) {
|
||||
@ModelAttribute HistoricalDTO historicalDTO) {
|
||||
if (CommonConstants.OUTFIT.equals(historicalDTO.getType())){
|
||||
List<OutfitHisVO> outfitHisVOS = tryOnEffectService.getOutfitHistoricals(historicalDTO);
|
||||
return ApiResponse.success(outfitHisVOS);
|
||||
|
||||
@@ -5,6 +5,10 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HistoricalDTO {
|
||||
|
||||
@Schema(description = "顾客ID",example = "1")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "进店记录ID",example = "1")
|
||||
private Long visitRecordId;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*
|
||||
* @author AI Assistant
|
||||
* @since 2024-01-01
|
||||
/**
|
||||
* /**
|
||||
* 试穿效果服务实现类
|
||||
*/
|
||||
@Service
|
||||
@@ -186,6 +186,7 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
|
||||
/**
|
||||
* 添加意见建议
|
||||
*
|
||||
* @param suggestion 意见建议实体
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
@@ -260,11 +261,12 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
@Override
|
||||
public List<TryOnResultVO> getTryOnHistoricals(HistoricalDTO historicalDTO) {
|
||||
LambdaQueryWrapper<TryOnEffect> tryOnEffectLambdaQueryWrapper = new LambdaQueryWrapper<TryOnEffect>()
|
||||
.eq(TryOnEffect::getCustomerId, historicalDTO.getCustomerId())
|
||||
.orderByDesc(TryOnEffect::getCreatedTime);
|
||||
if (historicalDTO.getVisitRecordId() != null) {
|
||||
tryOnEffectLambdaQueryWrapper.eq(TryOnEffect::getVisitRecordId, historicalDTO.getVisitRecordId());
|
||||
}
|
||||
if (historicalDTO.getIsLibrary() != null||historicalDTO.getIsLibrary()){
|
||||
if (historicalDTO.getIsLibrary() != null && historicalDTO.getIsLibrary()) {
|
||||
tryOnEffectLambdaQueryWrapper.eq(TryOnEffect::getIsFavorite, 1);
|
||||
}
|
||||
if (CommonConstants.TRYON.equals(historicalDTO.getType())) {
|
||||
@@ -301,11 +303,13 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
|
||||
@Override
|
||||
public List<OutfitHisVO> getOutfitHistoricals(HistoricalDTO historicalDTO) {
|
||||
LambdaQueryWrapper<Style> styleLambdaQueryWrapper = new LambdaQueryWrapper<Style>().orderByDesc(Style::getCreatedTime);
|
||||
LambdaQueryWrapper<Style> styleLambdaQueryWrapper = new LambdaQueryWrapper<Style>()
|
||||
.eq(Style::getCustomerId, historicalDTO.getCustomerId())
|
||||
.orderByDesc(Style::getCreatedTime);
|
||||
if (historicalDTO.getVisitRecordId() != null) {
|
||||
styleLambdaQueryWrapper.eq(Style::getVisitRecordId, historicalDTO.getVisitRecordId());
|
||||
}
|
||||
if (historicalDTO.getIsLibrary() != null||historicalDTO.getIsLibrary()){
|
||||
if (historicalDTO.getIsLibrary() != null && historicalDTO.getIsLibrary()) {
|
||||
styleLambdaQueryWrapper.eq(Style::getIsFavorite, 1);
|
||||
}
|
||||
List<Style> styles = styleService.list(styleLambdaQueryWrapper);
|
||||
@@ -684,6 +688,7 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
|
||||
/**
|
||||
* 调用换脸API
|
||||
*
|
||||
* @param imageUrls 图片URL列表,第一个为源图片,第二个为目标图片
|
||||
* @return 换脸后的图片URL
|
||||
*/
|
||||
@@ -801,7 +806,6 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
log.info("换脸成功,图片路径: {}", imagePath);
|
||||
|
||||
|
||||
|
||||
// 下载图片并上传到MinIO
|
||||
return imagePath;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user