TASK:从历史再次生成outfit,添加checkInId
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:
@@ -109,8 +109,10 @@ public class StyleController {
|
|||||||
@GetMapping("/retrieveAndRegenerate")
|
@GetMapping("/retrieveAndRegenerate")
|
||||||
public ApiResponse<List<String>> retrieveAndRegenerate(
|
public ApiResponse<List<String>> retrieveAndRegenerate(
|
||||||
@Parameter(description = "tryOn后的图片id", required = true, example = "1369")
|
@Parameter(description = "tryOn后的图片id", required = true, example = "1369")
|
||||||
@RequestParam Long tryOnEffectsId) {
|
@RequestParam Long tryOnEffectsId,
|
||||||
return ApiResponse.success(styleService.retrieveAndRegenerate(tryOnEffectsId));
|
@Parameter(description = "用户进店记录", required = true, example = "3")
|
||||||
|
@RequestParam Long checkInId ) {
|
||||||
|
return ApiResponse.success(styleService.retrieveAndRegenerate(tryOnEffectsId, checkInId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -31,6 +31,6 @@ public interface StyleService extends IService<Style> {
|
|||||||
*/
|
*/
|
||||||
void cancelFavoriteStyle(Long styleId);
|
void cancelFavoriteStyle(Long styleId);
|
||||||
|
|
||||||
List<String> retrieveAndRegenerate(Long tryOnEffectsId);
|
List<String> retrieveAndRegenerate(Long tryOnEffectsId, Long checkInId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -362,7 +362,7 @@ public class StyleServiceImpl extends ServiceImpl<StyleMapper, Style> implements
|
|||||||
return sessionRecord;
|
return sessionRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> retrieveAndRegenerate(Long tryOnEffectsId) {
|
public List<String> retrieveAndRegenerate(Long tryOnEffectsId, Long checkInId) {
|
||||||
// 1. 判断id是否有效
|
// 1. 判断id是否有效
|
||||||
TryOnEffect tryOnEffect = tryOnEffectMapper.selectById(tryOnEffectsId);
|
TryOnEffect tryOnEffect = tryOnEffectMapper.selectById(tryOnEffectsId);
|
||||||
if (Objects.isNull(tryOnEffect)) {
|
if (Objects.isNull(tryOnEffect)) {
|
||||||
@@ -373,6 +373,10 @@ public class StyleServiceImpl extends ServiceImpl<StyleMapper, Style> implements
|
|||||||
log.error("Id 为:{} 的tryOnEffects记录,没有style_id", tryOnEffectsId);
|
log.error("Id 为:{} 的tryOnEffects记录,没有style_id", tryOnEffectsId);
|
||||||
throw new BusinessException("Cannot recreate outfit from past data.");
|
throw new BusinessException("Cannot recreate outfit from past data.");
|
||||||
}
|
}
|
||||||
|
if (Objects.isNull(checkInId)) {
|
||||||
|
log.error("checkInId 为空");
|
||||||
|
throw new BusinessException("'checkInId' cannot be empty");
|
||||||
|
}
|
||||||
|
|
||||||
// 2. 组装参数
|
// 2. 组装参数
|
||||||
Style style = baseMapper.selectById(tryOnEffect.getStyleId());
|
Style style = baseMapper.selectById(tryOnEffect.getStyleId());
|
||||||
@@ -387,7 +391,7 @@ public class StyleServiceImpl extends ServiceImpl<StyleMapper, Style> implements
|
|||||||
log.error("找不到Id 为:{} 的SessionRecord记录", outfitRequest.getSessionRecordId());
|
log.error("找不到Id 为:{} 的SessionRecord记录", outfitRequest.getSessionRecordId());
|
||||||
throw new BusinessException("Cannot recreate outfit from past data.");
|
throw new BusinessException("Cannot recreate outfit from past data.");
|
||||||
}
|
}
|
||||||
RequestOutfitDTO requestOutfitDTO = getRequestOutfitDTO(outfitRequest, sessionRecord);
|
RequestOutfitDTO requestOutfitDTO = getRequestOutfitDTO(outfitRequest, sessionRecord, checkInId);
|
||||||
|
|
||||||
return requestOutfit(requestOutfitDTO);
|
return requestOutfit(requestOutfitDTO);
|
||||||
} else {
|
} else {
|
||||||
@@ -397,10 +401,10 @@ public class StyleServiceImpl extends ServiceImpl<StyleMapper, Style> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static RequestOutfitDTO getRequestOutfitDTO(OutfitRequest outfitRequest, SessionRecord sessionRecord) {
|
private static RequestOutfitDTO getRequestOutfitDTO(OutfitRequest outfitRequest, SessionRecord sessionRecord, Long checkInId) {
|
||||||
RequestOutfitDTO requestOutfitDTO = new RequestOutfitDTO();
|
RequestOutfitDTO requestOutfitDTO = new RequestOutfitDTO();
|
||||||
requestOutfitDTO.setCustomerId(outfitRequest.getCustomerId());
|
requestOutfitDTO.setCustomerId(outfitRequest.getCustomerId());
|
||||||
requestOutfitDTO.setCheckInId(outfitRequest.getVisitRecordId());
|
requestOutfitDTO.setCheckInId(checkInId);
|
||||||
requestOutfitDTO.setStylist(outfitRequest.getStylist());
|
requestOutfitDTO.setStylist(outfitRequest.getStylist());
|
||||||
requestOutfitDTO.setGender(outfitRequest.getGender());
|
requestOutfitDTO.setGender(outfitRequest.getGender());
|
||||||
requestOutfitDTO.setNum(1);
|
requestOutfitDTO.setNum(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user