refactor(face): 优化人脸识别服务中的购买验证逻辑

- 移除多余的空格格式
- 删除重复的购买验证逻辑
- 移除临时解决方案代码
- 简化条件判断流程
This commit is contained in:
2025-12-28 13:58:04 +08:00
parent 71bfa00c25
commit 84cb5ad8f9
2 changed files with 1 additions and 9 deletions

View File

@@ -451,7 +451,7 @@ public class FaceServiceImpl implements FaceService {
contentPageVO.setContentType(1); contentPageVO.setContentType(1);
contentPageVO.setSort(contentPageVO.getSort()); contentPageVO.setSort(contentPageVO.getSort());
if (!memberVideoEntityList.isEmpty()) { if (!memberVideoEntityList.isEmpty()) {
boolean isBuy = orderRepository.checkUserBuyFaceItem(userId, faceId, 0, contentPageVO.getContentId()); boolean isBuy = orderRepository.checkUserBuyFaceItem(userId, faceId, 0, contentPageVO.getContentId());
if (!isBuy) { if (!isBuy) {
isBuy = orderRepository.checkUserBuyFaceItem(userId, faceId, -1, contentPageVO.getTemplateId()); // 购买模板 isBuy = orderRepository.checkUserBuyFaceItem(userId, faceId, -1, contentPageVO.getTemplateId()); // 购买模板
} }
@@ -484,12 +484,6 @@ public class FaceServiceImpl implements FaceService {
contentPageVO.setLockType(1); contentPageVO.setLockType(1);
} }
} }
boolean buy = orderRepository.checkUserBuyFaceItem(userId, faceId, contentPageVO.getGoodsType(), contentPageVO.getContentId());
if (buy) {
contentPageVO.setIsBuy(1);
} else {
contentPageVO.setIsBuy(0);
}
}).collect(Collectors.toList()); }).collect(Collectors.toList());
List<PuzzleTemplateEntity> puzzleTemplateEntityList = puzzleTemplateMapper.list(face.getScenicId(), null, 1); List<PuzzleTemplateEntity> puzzleTemplateEntityList = puzzleTemplateMapper.list(face.getScenicId(), null, 1);

View File

@@ -415,8 +415,6 @@ public class TaskTaskServiceImpl implements TaskService {
memberVideoEntity.setIsBuy(taskVideoRelation.getIsBuy()); memberVideoEntity.setIsBuy(taskVideoRelation.getIsBuy());
memberVideoEntity.setOrderId(taskVideoRelation.getOrderId()); memberVideoEntity.setOrderId(taskVideoRelation.getOrderId());
} }
// TODO: FIXME 临时解决
taskMapper.updateStatus(taskEntity.getId(), taskEntity.getStatus() + 10);
} }
} }
if (taskEntity == null) { if (taskEntity == null) {