You've already forked FrameTour-BE
免费数量
This commit is contained in:
@@ -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);
|
||||
|
||||
|
@@ -34,4 +34,5 @@ public class ContentPageVO {
|
||||
private Integer isBuy;
|
||||
private BigDecimal duration;
|
||||
private Integer goodsType;
|
||||
private int freeCount;
|
||||
}
|
||||
|
@@ -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) -> {
|
||||
|
Reference in New Issue
Block a user