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
b8163943
Commit
b8163943
authored
Jun 06, 2020
by
jim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
16abe225
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
ShopController.java
...gec/browserbackend/browser/controller/ShopController.java
+14
-13
IpAndShopServiceImpl.java
...serbackend/browser/service/Impl/IpAndShopServiceImpl.java
+1
-1
No files found.
src/main/java/com/edgec/browserbackend/browser/controller/ShopController.java
View file @
b8163943
...
@@ -42,7 +42,7 @@ public class ShopController {
...
@@ -42,7 +42,7 @@ public class ShopController {
shopStringResultDto
.
setId
(
shopService
.
addShop
(
principal
.
getName
(),
shopResultDto
));
shopStringResultDto
.
setId
(
shopService
.
addShop
(
principal
.
getName
(),
shopResultDto
));
resultDto
.
setData
(
shopStringResultDto
);
resultDto
.
setData
(
shopStringResultDto
);
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
@@ -56,7 +56,7 @@ public class ShopController {
...
@@ -56,7 +56,7 @@ public class ShopController {
public
ResultDto
addShops
(
Principal
principal
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
ResultDto
addShops
(
Principal
principal
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
ResultDto
resultDto
=
new
ResultDto
();
ResultDto
resultDto
=
new
ResultDto
();
String
name
=
file
.
getOriginalFilename
();
String
name
=
file
.
getOriginalFilename
();
if
(
name
.
length
()<
6
||
!
name
.
substring
(
name
.
length
()-
5
).
equals
(
".xlsx"
))
{
if
(
name
.
length
()
<
6
||
!
name
.
substring
(
name
.
length
()
-
5
).
equals
(
".xlsx"
))
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
BrowserErrorCode
.
INFORMATIONNOTCOMPELETE
.
getCode
());
statusInfo
.
put
(
"code"
,
BrowserErrorCode
.
INFORMATIONNOTCOMPELETE
.
getCode
());
...
@@ -87,7 +87,7 @@ public class ShopController {
...
@@ -87,7 +87,7 @@ public class ShopController {
shopStringResultDto
.
setId
(
shopService
.
updateShop
(
principal
.
getName
(),
shopResultDto
));
shopStringResultDto
.
setId
(
shopService
.
updateShop
(
principal
.
getName
(),
shopResultDto
));
resultDto
.
setData
(
shopStringResultDto
);
resultDto
.
setData
(
shopStringResultDto
);
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
@@ -103,7 +103,7 @@ public class ShopController {
...
@@ -103,7 +103,7 @@ public class ShopController {
try
{
try
{
shopService
.
deleteShop
(
principal
.
getName
(),
shopRequestDto
.
getShopId
());
shopService
.
deleteShop
(
principal
.
getName
(),
shopRequestDto
.
getShopId
());
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
@@ -119,7 +119,8 @@ public class ShopController {
...
@@ -119,7 +119,8 @@ public class ShopController {
try
{
try
{
ipAndShopService
.
bindShop
(
principal
.
getName
(),
shopRequestDto
);
ipAndShopService
.
bindShop
(
principal
.
getName
(),
shopRequestDto
);
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
logger
.
error
(
"fail to bind shop"
,
e
);
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
@@ -135,7 +136,7 @@ public class ShopController {
...
@@ -135,7 +136,7 @@ public class ShopController {
try
{
try
{
ipAndShopService
.
unBindShop
(
principal
.
getName
(),
shopRequestDto
);
ipAndShopService
.
unBindShop
(
principal
.
getName
(),
shopRequestDto
);
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
@@ -151,7 +152,7 @@ public class ShopController {
...
@@ -151,7 +152,7 @@ public class ShopController {
try
{
try
{
shopService
.
transferShop
(
principal
.
getName
(),
shopRequestDto
.
getShopId
(),
shopRequestDto
.
getToGroup
());
shopService
.
transferShop
(
principal
.
getName
(),
shopRequestDto
.
getShopId
(),
shopRequestDto
.
getToGroup
());
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
@@ -167,7 +168,7 @@ public class ShopController {
...
@@ -167,7 +168,7 @@ public class ShopController {
try
{
try
{
shopService
.
assignShops
(
principal
.
getName
(),
shopRequestDto
.
getShopIds
(),
shopRequestDto
.
getToUsers
());
shopService
.
assignShops
(
principal
.
getName
(),
shopRequestDto
.
getShopIds
(),
shopRequestDto
.
getToUsers
());
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
@@ -177,7 +178,7 @@ public class ShopController {
...
@@ -177,7 +178,7 @@ public class ShopController {
return
resultDto
;
return
resultDto
;
}
}
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
POST
)
public
ResultDto
getShopList
(
Principal
principal
,
@RequestBody
ShopRequestDto
shopRequestDto
)
{
public
ResultDto
getShopList
(
Principal
principal
,
@RequestBody
ShopRequestDto
shopRequestDto
)
{
ResultDto
resultDto
=
new
ResultDto
();
ResultDto
resultDto
=
new
ResultDto
();
try
{
try
{
...
@@ -185,7 +186,7 @@ public class ShopController {
...
@@ -185,7 +186,7 @@ public class ShopController {
shopRequestDto
.
getAmount
(),
shopRequestDto
.
getFilter
());
shopRequestDto
.
getAmount
(),
shopRequestDto
.
getFilter
());
resultDto
.
setData
(
shopDtos
);
resultDto
.
setData
(
shopDtos
);
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
@@ -203,7 +204,7 @@ public class ShopController {
...
@@ -203,7 +204,7 @@ public class ShopController {
List
<
String
>
subUsers
=
shopService
.
getShopUsers
(
principal
.
getName
(),
shopRequestDto
.
getShopId
());
List
<
String
>
subUsers
=
shopService
.
getShopUsers
(
principal
.
getName
(),
shopRequestDto
.
getShopId
());
resultDto
.
setData
(
subUsers
);
resultDto
.
setData
(
subUsers
);
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
@@ -220,7 +221,7 @@ public class ShopController {
...
@@ -220,7 +221,7 @@ public class ShopController {
List
<
String
>
subUsers
=
shopService
.
getBatchShopUsers
(
principal
.
getName
(),
shopRequestDto
.
getShopIds
());
List
<
String
>
subUsers
=
shopService
.
getBatchShopUsers
(
principal
.
getName
(),
shopRequestDto
.
getShopIds
());
resultDto
.
setData
(
subUsers
);
resultDto
.
setData
(
subUsers
);
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
@@ -237,7 +238,7 @@ public class ShopController {
...
@@ -237,7 +238,7 @@ public class ShopController {
ShopResultDto
shopDto
=
shopService
.
queryShop
(
principal
.
getName
(),
shopRequestDto
.
getShopId
());
ShopResultDto
shopDto
=
shopService
.
queryShop
(
principal
.
getName
(),
shopRequestDto
.
getShopId
());
resultDto
.
setData
(
shopDto
);
resultDto
.
setData
(
shopDto
);
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/IpAndShopServiceImpl.java
View file @
b8163943
...
@@ -72,7 +72,7 @@ public class IpAndShopServiceImpl implements IpAndShopService {
...
@@ -72,7 +72,7 @@ public class IpAndShopServiceImpl implements IpAndShopService {
try
{
try
{
ipResourceRepository
.
addShopId
(
ipResource
.
getId
(),
shopId
);
ipResourceRepository
.
addShopId
(
ipResource
.
getId
(),
shopId
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"fail to bind shop and ip"
,
e
.
getMessage
()
);
logger
.
error
(
"fail to bind shop and ip"
,
e
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
UNKNOWN
);
throw
new
ClientRequestException
(
BrowserErrorCode
.
UNKNOWN
);
}
}
}
}
...
...
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