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