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
9921e4ce
Commit
9921e4ce
authored
Aug 28, 2020
by
xuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
过期未超过七天的 isDelete的状态应该为 false
parent
4c63aaf6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
14 deletions
+4
-14
IpResourceRepositoryCustom.java
...ackend/browser/repository/IpResourceRepositoryCustom.java
+1
-1
IpResourceRepositoryCustomImpl.java
...nd/browser/repository/IpResourceRepositoryCustomImpl.java
+2
-11
IpResourceServiceImpl.java
...erbackend/browser/service/Impl/IpResourceServiceImpl.java
+1
-1
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+0
-1
No files found.
src/main/java/com/edgec/browserbackend/browser/repository/IpResourceRepositoryCustom.java
View file @
9921e4ce
...
@@ -25,7 +25,7 @@ public interface IpResourceRepositoryCustom {
...
@@ -25,7 +25,7 @@ public interface IpResourceRepositoryCustom {
boolean
deleteShopId
(
String
ipId
,
String
shopId
,
BindHistory
bindHistory
);
boolean
deleteShopId
(
String
ipId
,
String
shopId
,
BindHistory
bindHistory
);
boolean
updateStatus
(
String
id
,
int
status
,
Object
...
args
);
boolean
updateStatus
(
String
id
,
int
status
);
boolean
updateBind
(
String
id
,
boolean
isbind
);
boolean
updateBind
(
String
id
,
boolean
isbind
);
...
...
src/main/java/com/edgec/browserbackend/browser/repository/IpResourceRepositoryCustomImpl.java
View file @
9921e4ce
...
@@ -131,26 +131,17 @@ public class IpResourceRepositoryCustomImpl implements IpResourceRepositoryCusto
...
@@ -131,26 +131,17 @@ public class IpResourceRepositoryCustomImpl implements IpResourceRepositoryCusto
}
}
@Override
@Override
public
boolean
updateStatus
(
String
id
,
int
status
,
Object
...
args
)
{
public
boolean
updateStatus
(
String
id
,
int
status
)
{
Document
doc
=
new
Document
();
Document
doc
=
new
Document
();
BasicQuery
basicQuery
=
new
BasicQuery
(
doc
);
BasicQuery
basicQuery
=
new
BasicQuery
(
doc
);
basicQuery
.
addCriteria
(
where
(
"id"
).
is
(
id
).
and
(
"isDeleted"
).
is
(
false
));
basicQuery
.
addCriteria
(
where
(
"id"
).
is
(
id
).
and
(
"isDeleted"
).
is
(
false
));
Update
update
=
new
Update
();
Update
update
=
new
Update
();
if
(
args
.
length
==
0
)
{
update
.
set
(
"status"
,
status
);
update
.
set
(
"status"
,
status
);
}
if
(
args
.
length
==
1
)
{
update
.
set
(
"status"
,
status
).
set
(
"isDeleted"
,
true
);
}
UpdateResult
result
=
mongoTemplate
.
updateFirst
(
basicQuery
,
update
,
IpResource
.
class
);
UpdateResult
result
=
mongoTemplate
.
updateFirst
(
basicQuery
,
update
,
IpResource
.
class
);
if
(
result
.
getModifiedCount
()
<
1
)
return
result
.
getModifiedCount
()
>=
1
;
return
false
;
else
return
true
;
}
}
@Override
@Override
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/IpResourceServiceImpl.java
View file @
9921e4ce
...
@@ -694,7 +694,7 @@ public class IpResourceServiceImpl implements IpResourceService {
...
@@ -694,7 +694,7 @@ public class IpResourceServiceImpl implements IpResourceService {
// 1.4 ip资源到期,且 ip 资源的状态不是 3(正在分配)、6(未分配),则设置 ip 资源的状态为 1(已过期)
// 1.4 ip资源到期,且 ip 资源的状态不是 3(正在分配)、6(未分配),则设置 ip 资源的状态为 1(已过期)
}
else
if
(
x
.
getValidTime
()
<=
Instant
.
now
().
toEpochMilli
()
&&
x
.
getStatus
()
!=
3
&&
x
.
getStatus
()
!=
6
)
{
}
else
if
(
x
.
getValidTime
()
<=
Instant
.
now
().
toEpochMilli
()
&&
x
.
getStatus
()
!=
3
&&
x
.
getStatus
()
!=
6
)
{
// 这个地方可变参数随便传啥都行
// 这个地方可变参数随便传啥都行
ipResourceRepository
.
updateStatus
(
x
.
getId
(),
1
,
true
);
ipResourceRepository
.
updateStatus
(
x
.
getId
(),
1
);
// 1.5 其他
// 1.5 其他
}
else
{
}
else
{
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
9921e4ce
...
@@ -489,7 +489,6 @@ public class ShopServiceImpl implements ShopService {
...
@@ -489,7 +489,6 @@ public class ShopServiceImpl implements ShopService {
// 3. ip资源到期,且 ip 资源的状态不是 3(正在分配)、6(未分配),则设置 ip 资源的状态为 1(已过期)
// 3. ip资源到期,且 ip 资源的状态不是 3(正在分配)、6(未分配),则设置 ip 资源的状态为 1(已过期)
}
else
if
(
ipResource
.
getValidTime
()
<=
Instant
.
now
().
toEpochMilli
()
&&
ipResource
.
getStatus
()
!=
3
&&
ipResource
.
getStatus
()
!=
6
)
{
}
else
if
(
ipResource
.
getValidTime
()
<=
Instant
.
now
().
toEpochMilli
()
&&
ipResource
.
getStatus
()
!=
3
&&
ipResource
.
getStatus
()
!=
6
)
{
ipResource
.
setStatus
(
1
);
ipResource
.
setStatus
(
1
);
ipResource
.
setDeleted
(
true
);
ipResourceRepository
.
save
(
ipResource
);
ipResourceRepository
.
save
(
ipResource
);
// 4. 其他,将ip资源状态设置为 未使用
// 4. 其他,将ip资源状态设置为 未使用
...
...
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