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
8bb64144
Commit
8bb64144
authored
Aug 07, 2020
by
puppetect
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'staging' of
http://120.77.149.83/root/browser-backend
into staging
parents
44475158
94b094bd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
1 deletion
+55
-1
ShopController.java
...gec/browserbackend/browser/controller/ShopController.java
+27
-0
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+19
-0
ShopService.java
...com/edgec/browserbackend/browser/service/ShopService.java
+4
-0
SpecialLineCheckTask.java
...gec/browserbackend/browser/task/SpecialLineCheckTask.java
+5
-1
No files found.
src/main/java/com/edgec/browserbackend/browser/controller/ShopController.java
View file @
8bb64144
...
@@ -232,6 +232,33 @@ public class ShopController {
...
@@ -232,6 +232,33 @@ public class ShopController {
}
}
/**
* 获取cookie
*/
@GetMapping
(
"/cookie/{shopId}"
)
public
ResultDto
getShopCookie
(
@PathVariable
String
shopId
)
{
String
cookie
=
shopService
.
queryShopCookieById
(
shopId
);
ResultDto
resultDto
=
new
ResultDto
();
resultDto
.
setStatus
(
0
);
resultDto
.
setData
(
cookie
);
return
resultDto
;
}
/**
* 删除cookie
*/
@DeleteMapping
(
"/cookie/{shopId}"
)
public
ResultDto
delShopCookie
(
@PathVariable
String
shopId
)
{
Integer
result
=
shopService
.
deleteShopCookieById
(
shopId
);
ResultDto
resultDto
=
new
ResultDto
();
resultDto
.
setStatus
(
result
);
return
resultDto
;
}
private
void
dealClientRequestException
(
ResultDto
resultDto
,
ClientRequestException
e
)
{
private
void
dealClientRequestException
(
ResultDto
resultDto
,
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
8bb64144
...
@@ -649,6 +649,25 @@ public class ShopServiceImpl implements ShopService {
...
@@ -649,6 +649,25 @@ public class ShopServiceImpl implements ShopService {
return
result
;
return
result
;
}
}
@Override
public
String
queryShopCookieById
(
String
id
)
{
Shop
shop
=
shopRepository
.
findById
(
id
).
orElseThrow
(()
->
new
ClientRequestException
(
BrowserErrorCode
.
SHOPNOTEXIST
));
return
shop
.
getShopCookie
();
}
@Override
public
Integer
deleteShopCookieById
(
String
id
)
{
Shop
shop
=
shopRepository
.
findById
(
id
).
orElseThrow
(()
->
new
ClientRequestException
(
BrowserErrorCode
.
SHOPNOTEXIST
));
shop
.
setShopCookie
(
""
);
Shop
save
=
shopRepository
.
save
(
shop
);
Integer
i
=
1
;
if
(
StringUtils
.
isEmpty
(
save
.
getShopCookie
()))
{
i
=
0
;
}
return
i
;
}
private
String
getShopId
(
String
username
,
ShopResultDto
shopResultDto
)
{
private
String
getShopId
(
String
username
,
ShopResultDto
shopResultDto
)
{
Shop
shop
=
new
Shop
();
Shop
shop
=
new
Shop
();
shopResultDto
.
setOwner
(
username
);
shopResultDto
.
setOwner
(
username
);
...
...
src/main/java/com/edgec/browserbackend/browser/service/ShopService.java
View file @
8bb64144
...
@@ -34,4 +34,8 @@ public interface ShopService {
...
@@ -34,4 +34,8 @@ public interface ShopService {
List
<
String
>
getBatchShopUsers
(
String
username
,
List
<
String
>
shopIds
);
List
<
String
>
getBatchShopUsers
(
String
username
,
List
<
String
>
shopIds
);
Integer
dealDirtyData
();
Integer
dealDirtyData
();
String
queryShopCookieById
(
String
id
);
Integer
deleteShopCookieById
(
String
id
);
}
}
src/main/java/com/edgec/browserbackend/browser/task/SpecialLineCheckTask.java
View file @
8bb64144
...
@@ -53,7 +53,7 @@ public class SpecialLineCheckTask {
...
@@ -53,7 +53,7 @@ public class SpecialLineCheckTask {
specialLineState
=
finalFail
==
ipResourceList
.
size
()
?
"off"
:
null
;
specialLineState
=
finalFail
==
ipResourceList
.
size
()
?
"off"
:
null
;
}
}
if
(
"off"
.
equals
(
globalField
.
getSpecialLineState
()))
{
if
(
"off"
.
equals
(
globalField
.
getSpecialLineState
()))
{
specialLineState
=
finalSuccess
>
5
?
"on"
:
null
;
specialLineState
=
finalSuccess
>
1
?
"on"
:
null
;
}
}
if
(!
StringUtils
.
isEmpty
(
specialLineState
))
{
if
(!
StringUtils
.
isEmpty
(
specialLineState
))
{
...
@@ -83,6 +83,10 @@ public class SpecialLineCheckTask {
...
@@ -83,6 +83,10 @@ public class SpecialLineCheckTask {
if
(
success
==
1
)
{
if
(
success
==
1
)
{
finalSuccess
++;
finalSuccess
++;
}
}
// 用于性能优化
if
(
finalSuccess
==
2
)
{
break
;
}
}
}
int
[]
arr
=
{
finalSuccess
,
finalFail
};
int
[]
arr
=
{
finalSuccess
,
finalFail
};
...
...
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