Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
browser-backend
Commits
d8b94347
Commit
d8b94347
authored
May 07, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'staging' into 'master'
Staging See merge request
!61
parents
2e1fad5f
ec6afd2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
IpResourceRepository.java
...owserbackend/browser/repository/IpResourceRepository.java
+1
-1
Set3proxyTask.java
.../com/edgec/browserbackend/browser/task/Set3proxyTask.java
+4
-5
No files found.
src/main/java/com/edgec/browserbackend/browser/repository/IpResourceRepository.java
View file @
d8b94347
...
@@ -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
>
findBySpecialLine
AndIsDeleted
(
boolean
specialLine
,
boolean
isDeleted
);
List
<
IpResource
>
findByRegionInAndIsDeleted
(
List
<
String
>
regions
,
boolean
isDeleted
);
List
<
IpResource
>
findByRegionInAndIsDeleted
(
List
<
String
>
regions
,
boolean
isDeleted
);
...
...
src/main/java/com/edgec/browserbackend/browser/task/Set3proxyTask.java
View file @
d8b94347
...
@@ -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(tru
e);
List
<
IpResource
>
ipResources
=
ipResourceRepository
.
findBySpecialLineAndIsDeleted
(
true
,
fals
e
);
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment