免费数量

This commit is contained in:
2025-07-17 14:58:55 +08:00
parent af141161de
commit 64c4180e4d
4 changed files with 17 additions and 4 deletions

View File

@@ -68,6 +68,7 @@ public interface SourceMapper {
List<SourceEntity> listVideoByFaceRelation(Long memberId, Long faceId);
List<SourceEntity> listImageByFaceRelation(Long memberId, Long faceId);
List<MemberSourceEntity> listByFaceRelation(Long memberId, Long faceId, Integer type);
SourceEntity getEntity(Long id);

View File

@@ -34,4 +34,5 @@ public class ContentPageVO {
private Integer isBuy;
private BigDecimal duration;
private Integer goodsType;
private int freeCount;
}

View File

@@ -418,12 +418,14 @@ public class FaceServiceImpl implements FaceService {
} else {
sourceImageContent.setIsBuy(0);
}
List<SourceEntity> sourceEntities = sourceMapper.listImageByFaceRelation(faceRespVO.getMemberId(), faceId);
if (!sourceEntities.isEmpty()) {
List<MemberSourceEntity> relations = sourceMapper.listByFaceRelation(faceRespVO.getMemberId(), faceId, 2);
if (!relations.isEmpty()) {
sourceImageContent.setLockType(-1);
} else {
sourceImageContent.setLockType(1);
}
long freeCount = relations.stream().filter(entity -> Integer.valueOf(1).equals(entity.getIsFree())).count();
sourceImageContent.setFreeCount((int) freeCount);
contentList.add(sourceImageContent);
}
if (!Integer.valueOf(1).equals(scenicConfig.getDisableSourceVideo())) {
@@ -435,12 +437,14 @@ public class FaceServiceImpl implements FaceService {
} else {
sourceVideoContent.setIsBuy(0);
}
List<SourceEntity> sourceEntities = sourceMapper.listVideoByFaceRelation(faceRespVO.getMemberId(), faceId);
if (!sourceEntities.isEmpty()) {
List<MemberSourceEntity> relations = sourceMapper.listByFaceRelation(faceRespVO.getMemberId(), faceId, 1);
if (!relations.isEmpty()) {
sourceVideoContent.setLockType(-1);
} else {
sourceVideoContent.setLockType(1);
}
long freeCount = relations.stream().filter(entity -> Integer.valueOf(1).equals(entity.getIsFree())).count();
sourceVideoContent.setFreeCount((int) freeCount);
contentList.add(sourceVideoContent);
}
sourceList.stream().collect(Collectors.groupingBy(SourceRespVO::getType)).forEach((type, list) -> {