|
@@ -851,7 +851,7 @@ public class ExamServiceImpl implements ExamService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public PageInfo<ExamIpLimitInfo> pageIpLimited(Integer curPage, Integer pageSize, Long examId, Integer limitType, String ip) {
|
|
|
|
|
|
+ public PageInfo<ExamIpLimitInfo> pageIpLimited(Integer curPage, Integer pageSize, Long examId, IpLimitType limitType, String ip) {
|
|
Specification<ExamIpLimitEntity> spec = getSpec(examId, limitType, ip);
|
|
Specification<ExamIpLimitEntity> spec = getSpec(examId, limitType, ip);
|
|
|
|
|
|
PageRequest pageRequest = PageRequest.of(curPage, pageSize, Sort.by(Sort.Direction.DESC, "creationTime"));
|
|
PageRequest pageRequest = PageRequest.of(curPage, pageSize, Sort.by(Sort.Direction.DESC, "creationTime"));
|
|
@@ -862,7 +862,7 @@ public class ExamServiceImpl implements ExamService {
|
|
pages.getList().forEach(e -> {
|
|
pages.getList().forEach(e -> {
|
|
ExamIpLimitInfo domain = new ExamIpLimitInfo();
|
|
ExamIpLimitInfo domain = new ExamIpLimitInfo();
|
|
BeanUtils.copyProperties(e, domain);
|
|
BeanUtils.copyProperties(e, domain);
|
|
- domain.setLimitType(e.getLimitType() == null ? "" : e.getLimitType().getName());
|
|
|
|
|
|
+ domain.setLimitType(e.getLimitType() == null ? "" : e.getLimitType().getTitle());
|
|
Optional<ExamEntity> byId = examRepo.findById(examId);
|
|
Optional<ExamEntity> byId = examRepo.findById(examId);
|
|
byId.ifPresent(examEntity -> domain.setExamName(examEntity.getName()));
|
|
byId.ifPresent(examEntity -> domain.setExamName(examEntity.getName()));
|
|
list.add(domain);
|
|
list.add(domain);
|
|
@@ -873,7 +873,7 @@ public class ExamServiceImpl implements ExamService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<ExamIpLimitEntity> findAllIpLimits(Long examId, Integer limitType, String ip) {
|
|
|
|
|
|
+ public List<ExamIpLimitEntity> findAllIpLimits(Long examId, IpLimitType limitType, String ip) {
|
|
Specification<ExamIpLimitEntity> spec = getSpec(examId, limitType, ip);
|
|
Specification<ExamIpLimitEntity> spec = getSpec(examId, limitType, ip);
|
|
long count = examIpLimitRepo.count(spec);
|
|
long count = examIpLimitRepo.count(spec);
|
|
if (100000 < count) {
|
|
if (100000 < count) {
|
|
@@ -1059,7 +1059,7 @@ public class ExamServiceImpl implements ExamService {
|
|
? Boolean.valueOf(propertyEntity.getValue()) : defaultValue;
|
|
? Boolean.valueOf(propertyEntity.getValue()) : defaultValue;
|
|
}
|
|
}
|
|
|
|
|
|
- private Specification<ExamIpLimitEntity> getSpec(Long examId, Integer limitType, String ip) {
|
|
|
|
|
|
+ private Specification<ExamIpLimitEntity> getSpec(Long examId, IpLimitType limitType, String ip) {
|
|
Specification<ExamIpLimitEntity> spec = (root, query, cb) -> {
|
|
Specification<ExamIpLimitEntity> spec = (root, query, cb) -> {
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
if (examId != null) {
|
|
if (examId != null) {
|