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
f08caa40
Commit
f08caa40
authored
Mar 27, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ip地域中文
parent
0d92b023
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
7 deletions
+21
-7
Shop.java
...in/java/com/edgec/browserbackend/browser/domain/Shop.java
+12
-0
IpResourceRepository.java
...owserbackend/browser/repository/IpResourceRepository.java
+1
-1
ShopRepository.java
...gec/browserbackend/browser/repository/ShopRepository.java
+1
-1
IpResourceServiceImpl.java
...erbackend/browser/service/Impl/IpResourceServiceImpl.java
+4
-4
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+3
-1
No files found.
src/main/java/com/edgec/browserbackend/browser/domain/Shop.java
View file @
f08caa40
...
@@ -25,6 +25,8 @@ public class Shop {
...
@@ -25,6 +25,8 @@ public class Shop {
private
String
ipRegion
;
private
String
ipRegion
;
private
String
ipRegionCn
;
private
String
ip
;
private
String
ip
;
private
String
ipId
;
private
String
ipId
;
...
@@ -95,6 +97,8 @@ public class Shop {
...
@@ -95,6 +97,8 @@ public class Shop {
this
.
setShopCookie
(
shop
.
getShopCookie
());
this
.
setShopCookie
(
shop
.
getShopCookie
());
if
(
shop
.
getCreateTime
()
!=
0
)
if
(
shop
.
getCreateTime
()
!=
0
)
this
.
setCreateTime
(
shop
.
getCreateTime
());
this
.
setCreateTime
(
shop
.
getCreateTime
());
if
(
shop
.
getIpRegionCn
()
!=
null
)
this
.
setIpRegionCn
(
shop
.
getIpRegionCn
());
return
this
;
return
this
;
}
}
...
@@ -209,4 +213,12 @@ public class Shop {
...
@@ -209,4 +213,12 @@ public class Shop {
public
void
setCreateTime
(
long
createTime
)
{
public
void
setCreateTime
(
long
createTime
)
{
this
.
createTime
=
createTime
;
this
.
createTime
=
createTime
;
}
}
public
String
getIpRegionCn
()
{
return
ipRegionCn
;
}
public
void
setIpRegionCn
(
String
ipRegionCn
)
{
this
.
ipRegionCn
=
ipRegionCn
;
}
}
}
src/main/java/com/edgec/browserbackend/browser/repository/IpResourceRepository.java
View file @
f08caa40
...
@@ -20,7 +20,7 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String
...
@@ -20,7 +20,7 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String
List
<
IpResource
>
findByStatusAndIdInAndIsDeleted
(
int
status
,
List
<
String
>
ipIds
,
boolean
isDeleted
);
List
<
IpResource
>
findByStatusAndIdInAndIsDeleted
(
int
status
,
List
<
String
>
ipIds
,
boolean
isDeleted
);
Page
<
IpResource
>
findByAddrLikeAndIdInAndIsDeletedOrderByPurchasedTimeDesc
(
String
addr
,
List
<
String
>
ipIds
,
boolean
isDeleted
,
Pageable
pageable
);
Page
<
IpResource
>
findByAddrLikeAndIdInAndIsDeletedOrderByPurchasedTimeDesc
(
String
addr
,
List
<
String
>
ipIds
,
boolean
isDeleted
,
Pageable
pageable
);
Page
<
IpResource
>
findByVendorLikeAndIdInAndIsDeletedOrderByPurchasedTimeDesc
(
String
vendor
,
List
<
String
>
ipIds
,
boolean
isDeleted
,
Pageable
pageable
);
Page
<
IpResource
>
findByVendorLikeAndIdInAndIsDeletedOrderByPurchasedTimeDesc
(
String
vendor
,
List
<
String
>
ipIds
,
boolean
isDeleted
,
Pageable
pageable
);
Page
<
IpResource
>
findByRegionLikeAndIdInAndIsDeletedOrderByPurchasedTimeDesc
(
String
region
,
List
<
String
>
ipIds
,
boolean
isDeleted
,
Pageable
pageable
);
Page
<
IpResource
>
findByRegion
Cn
LikeAndIdInAndIsDeletedOrderByPurchasedTimeDesc
(
String
region
,
List
<
String
>
ipIds
,
boolean
isDeleted
,
Pageable
pageable
);
List
<
IpResource
>
findByStatusAndLockedAndLockTimestampLessThan
(
int
status
,
boolean
locked
,
long
timestamp
);
List
<
IpResource
>
findByStatusAndLockedAndLockTimestampLessThan
(
int
status
,
boolean
locked
,
long
timestamp
);
...
...
src/main/java/com/edgec/browserbackend/browser/repository/ShopRepository.java
View file @
f08caa40
...
@@ -8,7 +8,7 @@ import org.springframework.data.mongodb.repository.MongoRepository;
...
@@ -8,7 +8,7 @@ import org.springframework.data.mongodb.repository.MongoRepository;
import
java.util.List
;
import
java.util.List
;
public
interface
ShopRepository
extends
MongoRepository
<
Shop
,
String
>
{
public
interface
ShopRepository
extends
MongoRepository
<
Shop
,
String
>
{
Page
<
Shop
>
findByShopIdInAndIpRegionLikeOrderByCreateTimeDesc
(
List
<
String
>
shopIds
,
String
ipRegion
,
Pageable
pageable
);
Page
<
Shop
>
findByShopIdInAndIpRegion
Cn
LikeOrderByCreateTimeDesc
(
List
<
String
>
shopIds
,
String
ipRegion
,
Pageable
pageable
);
Page
<
Shop
>
findByShopIdInAndShopAccountLikeOrderByCreateTimeDesc
(
List
<
String
>
shopIds
,
String
shopAccount
,
Pageable
pageable
);
Page
<
Shop
>
findByShopIdInAndShopAccountLikeOrderByCreateTimeDesc
(
List
<
String
>
shopIds
,
String
shopAccount
,
Pageable
pageable
);
Page
<
Shop
>
findByShopIdInAndShopNameLikeOrderByCreateTimeDesc
(
List
<
String
>
shopIds
,
String
shopName
,
Pageable
pageable
);
Page
<
Shop
>
findByShopIdInAndShopNameLikeOrderByCreateTimeDesc
(
List
<
String
>
shopIds
,
String
shopName
,
Pageable
pageable
);
Page
<
Shop
>
findByShopIdInOrderByCreateTimeDesc
(
List
<
String
>
shopIds
,
Pageable
pageable
);
Page
<
Shop
>
findByShopIdInOrderByCreateTimeDesc
(
List
<
String
>
shopIds
,
Pageable
pageable
);
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/IpResourceServiceImpl.java
View file @
f08caa40
...
@@ -475,7 +475,7 @@ public class IpResourceServiceImpl implements IpResourceService {
...
@@ -475,7 +475,7 @@ public class IpResourceServiceImpl implements IpResourceService {
List
<
String
>
allIpIds
=
ipResources
.
stream
().
map
(
x
->
x
.
getId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
allIpIds
=
ipResources
.
stream
().
map
(
x
->
x
.
getId
()).
collect
(
Collectors
.
toList
());
Page
<
IpResource
>
ipResources1
=
null
;
Page
<
IpResource
>
ipResources1
=
null
;
if
(
ipFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
ipFilterDto
.
getRegion
()))
{
if
(
ipFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
ipFilterDto
.
getRegion
()))
{
ipResources1
=
ipResourceRepository
.
findByRegionLikeAndIdInAndIsDeletedOrderByPurchasedTimeDesc
(
ipFilterDto
.
getRegion
(),
allIpIds
,
false
,
pageable
);
ipResources1
=
ipResourceRepository
.
findByRegion
Cn
LikeAndIdInAndIsDeletedOrderByPurchasedTimeDesc
(
ipFilterDto
.
getRegion
(),
allIpIds
,
false
,
pageable
);
}
}
else
if
(
ipFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
ipFilterDto
.
getAddr
()))
{
else
if
(
ipFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
ipFilterDto
.
getAddr
()))
{
ipResources1
=
ipResourceRepository
.
findByAddrLikeAndIdInAndIsDeletedOrderByPurchasedTimeDesc
(
ipFilterDto
.
getAddr
(),
allIpIds
,
false
,
pageable
);
ipResources1
=
ipResourceRepository
.
findByAddrLikeAndIdInAndIsDeletedOrderByPurchasedTimeDesc
(
ipFilterDto
.
getAddr
(),
allIpIds
,
false
,
pageable
);
...
@@ -499,12 +499,12 @@ public class IpResourceServiceImpl implements IpResourceService {
...
@@ -499,12 +499,12 @@ public class IpResourceServiceImpl implements IpResourceService {
}
}
if
(
StringUtils
.
isNotBlank
(
x
.
getAddr
()))
{
if
(
StringUtils
.
isNotBlank
(
x
.
getAddr
()))
{
if
(
x
.
getValidTime
()
<=
Instant
.
now
().
plusSeconds
(
60
*
60
*
24
*
7
).
toEpochMilli
()
&&
x
.
getValidTime
()
>
Instant
.
now
().
toEpochMilli
())
{
if
(
x
.
getValidTime
()
<=
Instant
.
now
().
plusSeconds
(
60
*
60
*
24
*
7
).
toEpochMilli
()
&&
x
.
getValidTime
()
>
Instant
.
now
().
toEpochMilli
())
{
if
(
x
.
getStatus
()
!=
5
)
{
if
(
x
.
getStatus
()
!=
5
&&
x
.
getStatus
()
!=
3
&&
x
.
getStatus
()
!=
6
)
{
x
.
setStatus
(
2
);
x
.
setStatus
(
2
);
ipResourceRepository
.
save
(
x
);
ipResourceRepository
.
save
(
x
);
}
}
}
}
else
if
(
x
.
getValidTime
()
<=
Instant
.
now
().
minusSeconds
(
60
*
60
*
24
*
7
).
toEpochMilli
())
{
else
if
(
x
.
getValidTime
()
<=
Instant
.
now
().
minusSeconds
(
60
*
60
*
24
*
7
).
toEpochMilli
()
&&
x
.
getStatus
()
!=
3
&&
x
.
getStatus
()
!=
6
)
{
if
(
x
.
getIpType
()
==
IpType
.
VENDOR
)
{
if
(
x
.
getIpType
()
==
IpType
.
VENDOR
)
{
IpResourceRequestDto
ipResourceRequestDto
=
new
IpResourceRequestDto
();
IpResourceRequestDto
ipResourceRequestDto
=
new
IpResourceRequestDto
();
ipResourceRequestDto
.
setAddr
(
Arrays
.
asList
(
x
.
getAddr
()));
ipResourceRequestDto
.
setAddr
(
Arrays
.
asList
(
x
.
getAddr
()));
...
@@ -516,7 +516,7 @@ public class IpResourceServiceImpl implements IpResourceService {
...
@@ -516,7 +516,7 @@ public class IpResourceServiceImpl implements IpResourceService {
}
}
return
;
return
;
}
}
else
if
(
x
.
getValidTime
()
<=
Instant
.
now
().
toEpochMilli
())
{
else
if
(
x
.
getValidTime
()
<=
Instant
.
now
().
toEpochMilli
()
&&
x
.
getStatus
()
!=
3
&&
x
.
getStatus
()
!=
6
)
{
x
.
setStatus
(
1
);
x
.
setStatus
(
1
);
ipResourceRepository
.
save
(
x
);
ipResourceRepository
.
save
(
x
);
}
}
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
f08caa40
...
@@ -249,6 +249,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -249,6 +249,7 @@ public class ShopServiceImpl implements ShopService {
shop
.
setIp
(
ipResource
.
getAddr
());
shop
.
setIp
(
ipResource
.
getAddr
());
shop
.
setIpId
(
ipResource
.
getId
());
shop
.
setIpId
(
ipResource
.
getId
());
shop
.
setIpRegion
(
ipResource
.
getRegion
());
shop
.
setIpRegion
(
ipResource
.
getRegion
());
shop
.
setIpRegionCn
(
ipResource
.
getRegionCn
());
shopRepository
.
save
(
shop
);
shopRepository
.
save
(
shop
);
ipResource
.
setShopId
(
shopId
);
ipResource
.
setShopId
(
shopId
);
if
(
shop
.
getShopName
()!=
null
)
if
(
shop
.
getShopName
()!=
null
)
...
@@ -299,6 +300,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -299,6 +300,7 @@ public class ShopServiceImpl implements ShopService {
shop
.
setIp
(
null
);
shop
.
setIp
(
null
);
shop
.
setIpId
(
null
);
shop
.
setIpId
(
null
);
shop
.
setIpRegion
(
null
);
shop
.
setIpRegion
(
null
);
shop
.
setIpRegionCn
(
null
);
ipResource
.
setShopId
(
null
);
ipResource
.
setShopId
(
null
);
ipResource
.
setShopName
(
null
);
ipResource
.
setShopName
(
null
);
ipResourceRepository
.
save
(
ipResource
);
ipResourceRepository
.
save
(
ipResource
);
...
@@ -412,7 +414,7 @@ public class ShopServiceImpl implements ShopService {
...
@@ -412,7 +414,7 @@ public class ShopServiceImpl implements ShopService {
}
}
Page
<
Shop
>
shops
;
Page
<
Shop
>
shops
;
if
(
shopFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
shopFilterDto
.
getIpRegion
()))
if
(
shopFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
shopFilterDto
.
getIpRegion
()))
shops
=
shopRepository
.
findByShopIdInAndIpRegionLikeOrderByCreateTimeDesc
(
shopIds
,
shopFilterDto
.
getIpRegion
(),
pageable
);
shops
=
shopRepository
.
findByShopIdInAndIpRegion
Cn
LikeOrderByCreateTimeDesc
(
shopIds
,
shopFilterDto
.
getIpRegion
(),
pageable
);
else
if
(
shopFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
shopFilterDto
.
getShopAccount
()))
else
if
(
shopFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
shopFilterDto
.
getShopAccount
()))
shops
=
shopRepository
.
findByShopIdInAndShopAccountLikeOrderByCreateTimeDesc
(
shopIds
,
shopFilterDto
.
getShopAccount
(),
pageable
);
shops
=
shopRepository
.
findByShopIdInAndShopAccountLikeOrderByCreateTimeDesc
(
shopIds
,
shopFilterDto
.
getShopAccount
(),
pageable
);
else
if
(
shopFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
shopFilterDto
.
getShopName
()))
else
if
(
shopFilterDto
!=
null
&&
StringUtils
.
isNotBlank
(
shopFilterDto
.
getShopName
()))
...
...
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