Commit a82ca288 authored by renjie's avatar renjie

Merge branch 'dev-zrj' into 'staging'

专线ip debug

See merge request !59
parents 052f04c8 d52056f5
......@@ -29,7 +29,7 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String
List<IpResource> findByIsDeletedAndShopIdInAndRegionCnLike(boolean isDeleted, List<String> shopIds, String regionCn);
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);
......
......@@ -53,10 +53,10 @@ public class Set3proxyTask {
if (Instant.now().toEpochMilli() < proxyConfig.getTimestamp())
return;
}
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<IpResource> ipResources = ipResourceRepository.findByOwnerInAndSpecialLine(accountParents, true);
// List<IpResource> ipResources = ipResourceRepository.findBySpecialLine(true);
// 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<IpResource> ipResources = ipResourceRepository.findByOwnerInAndSpecialLine(accountParents, true);
List<IpResource> ipResources = ipResourceRepository.findBySpecialLineAndIsDeleted(true, false);
File file = new File("3proxy " + Instant.now().toEpochMilli());
SpecialLine specialLine = specialLineRepository.findAll().get(0);
try {
......
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