Commit d8b94347 authored by Administrator's avatar Administrator

Merge branch 'staging' into 'master'

Staging

See merge request !61
parents 2e1fad5f ec6afd2f
...@@ -29,7 +29,7 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String ...@@ -29,7 +29,7 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String
List<IpResource> findByIsDeletedAndShopIdInAndRegionCnLike(boolean isDeleted, List<String> shopIds, String regionCn); List<IpResource> findByIsDeletedAndShopIdInAndRegionCnLike(boolean isDeleted, List<String> shopIds, String regionCn);
List<IpResource> findByOwnerInAndSpecialLine(List<String> owners, boolean specialLine); List<IpResource> findByOwnerInAndSpecialLine(List<String> owners, boolean specialLine);
List<IpResource> findBySpecialLine(boolean specialLine); List<IpResource> findBySpecialLineAndIsDeleted(boolean specialLine, boolean isDeleted);
List<IpResource> findByRegionInAndIsDeleted(List<String> regions, boolean isDeleted); List<IpResource> findByRegionInAndIsDeleted(List<String> regions, boolean isDeleted);
......
...@@ -53,10 +53,10 @@ public class Set3proxyTask { ...@@ -53,10 +53,10 @@ public class Set3proxyTask {
if (Instant.now().toEpochMilli() < proxyConfig.getTimestamp()) if (Instant.now().toEpochMilli() < proxyConfig.getTimestamp())
return; return;
} }
List<String> tokenUsernames = mongoOAuth2AccessTokenRepository.findByCreatedAtGreaterThan(validTime).stream().map(MongoOAuth2AccessToken::getUsername).collect(Collectors.toList()); // List<String> tokenUsernames = mongoOAuth2AccessTokenRepository.findByCreatedAtGreaterThan(validTime).stream().map(MongoOAuth2AccessToken::getUsername).collect(Collectors.toList());
List<String> accountParents = accountRepository.findByNameIn(tokenUsernames).stream().map(x -> x.getParent() == null ? x.getName() : x.getParent()).distinct().collect(Collectors.toList()); // List<String> accountParents = accountRepository.findByNameIn(tokenUsernames).stream().map(x -> x.getParent() == null ? x.getName() : x.getParent()).distinct().collect(Collectors.toList());
List<IpResource> ipResources = ipResourceRepository.findByOwnerInAndSpecialLine(accountParents, true); // List<IpResource> ipResources = ipResourceRepository.findByOwnerInAndSpecialLine(accountParents, true);
// List<IpResource> ipResources = ipResourceRepository.findBySpecialLine(true); List<IpResource> ipResources = ipResourceRepository.findBySpecialLineAndIsDeleted(true, false);
File file = new File("3proxy " + Instant.now().toEpochMilli()); File file = new File("3proxy " + Instant.now().toEpochMilli());
SpecialLine specialLine = specialLineRepository.findAll().get(0); SpecialLine specialLine = specialLineRepository.findAll().get(0);
try { try {
...@@ -85,7 +85,6 @@ public class Set3proxyTask { ...@@ -85,7 +85,6 @@ public class Set3proxyTask {
bw.flush(); bw.flush();
bw.close(); bw.close();
log.error("成功写入文件"); log.error("成功写入文件");
log.error(FileUtils.readFileToString(file));
long nowtime = Instant.now().toEpochMilli(); long nowtime = Instant.now().toEpochMilli();
if (proxyConfigRepository.count() > 0) { if (proxyConfigRepository.count() > 0) {
ProxyConfig proxyConfig = proxyConfigRepository.findAll().get(0); ProxyConfig proxyConfig = proxyConfigRepository.findAll().get(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment