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
adf15779
Commit
adf15779
authored
Apr 20, 2021
by
huangjiamin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改UA的接口
parent
d81c7504
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
0 deletions
+33
-0
BrowserErrorCode.java
...ec/browserbackend/browser/ErrorCode/BrowserErrorCode.java
+1
-0
ShopController.java
...gec/browserbackend/browser/controller/ShopController.java
+11
-0
ShopRepository.java
...gec/browserbackend/browser/repository/ShopRepository.java
+2
-0
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+14
-0
ShopService.java
...com/edgec/browserbackend/browser/service/ShopService.java
+5
-0
No files found.
src/main/java/com/edgec/browserbackend/browser/ErrorCode/BrowserErrorCode.java
View file @
adf15779
...
@@ -11,6 +11,7 @@ public enum BrowserErrorCode implements ErrorCode {
...
@@ -11,6 +11,7 @@ public enum BrowserErrorCode implements ErrorCode {
INFORMATIONNOTCOMPELETE
(
BROWSER_BASE
+
100
,
"The information about shop does not complete"
),
INFORMATIONNOTCOMPELETE
(
BROWSER_BASE
+
100
,
"The information about shop does not complete"
),
SHOPNOTEXIST
(
BROWSER_BASE
+
101
,
"The shop does not exist"
),
SHOPNOTEXIST
(
BROWSER_BASE
+
101
,
"The shop does not exist"
),
SHOP_BINDED
(
BROWSER_BASE
+
102
,
"The shop has bind with ip"
),
SHOP_BINDED
(
BROWSER_BASE
+
102
,
"The shop has bind with ip"
),
SHOP_ERROR
(
BROWSER_BASE
+
103
,
"Shop error!"
),
IPNOTEXIST
(
BROWSER_BASE
+
201
,
"The ip do not exist"
),
IPNOTEXIST
(
BROWSER_BASE
+
201
,
"The ip do not exist"
),
IPNOTBINDTOSHOP
(
BROWSER_BASE
+
202
,
"The ip does not bind this shop."
),
IPNOTBINDTOSHOP
(
BROWSER_BASE
+
202
,
"The ip does not bind this shop."
),
...
...
src/main/java/com/edgec/browserbackend/browser/controller/ShopController.java
View file @
adf15779
...
@@ -2,6 +2,7 @@ package com.edgec.browserbackend.browser.controller;
...
@@ -2,6 +2,7 @@ package com.edgec.browserbackend.browser.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.edgec.browserbackend.account.dto.ResultDto
;
import
com.edgec.browserbackend.account.dto.ResultDto
;
import
com.edgec.browserbackend.browser.domain.Shop
;
import
com.edgec.browserbackend.browser.dto.ShopPageResultDto
;
import
com.edgec.browserbackend.browser.dto.ShopPageResultDto
;
import
com.edgec.browserbackend.browser.dto.ShopRequestDto
;
import
com.edgec.browserbackend.browser.dto.ShopRequestDto
;
import
com.edgec.browserbackend.browser.dto.ShopResultDto
;
import
com.edgec.browserbackend.browser.dto.ShopResultDto
;
...
@@ -211,6 +212,16 @@ public class ShopController {
...
@@ -211,6 +212,16 @@ public class ShopController {
return
resultDto
;
return
resultDto
;
}
}
@GetMapping
(
"/list"
)
public
List
<
Shop
>
getShops
(
@RequestParam
String
owner
,
@RequestParam
String
shopName
)
{
return
shopService
.
getShopListByOwner
(
owner
,
shopName
);
}
@PutMapping
public
String
putShop
(
@RequestParam
String
id
,
@RequestParam
String
shopUa
)
{
return
shopService
.
updateShopUa
(
id
,
shopUa
);
}
/**
/**
* 针对鹏海的需求
* 针对鹏海的需求
* 当 groupId 传 -1 的时候,查询出来的不应该是所有的店铺,而是所有未分配的店铺
* 当 groupId 传 -1 的时候,查询出来的不应该是所有的店铺,而是所有未分配的店铺
...
...
src/main/java/com/edgec/browserbackend/browser/repository/ShopRepository.java
View file @
adf15779
...
@@ -17,4 +17,6 @@ public interface ShopRepository extends MongoRepository<Shop, String>, ShopRepos
...
@@ -17,4 +17,6 @@ public interface ShopRepository extends MongoRepository<Shop, String>, ShopRepos
List
<
Shop
>
findByShopIdIn
(
List
<
String
>
shopIds
);
List
<
Shop
>
findByShopIdIn
(
List
<
String
>
shopIds
);
List
<
Shop
>
findByOwnerIn
(
List
<
String
>
owners
);
List
<
Shop
>
findByOwnerIn
(
List
<
String
>
owners
);
List
<
Shop
>
findByOwnerAndShopName
(
String
owner
,
String
shopName
);
}
}
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
adf15779
...
@@ -487,6 +487,20 @@ public class ShopServiceImpl implements ShopService {
...
@@ -487,6 +487,20 @@ public class ShopServiceImpl implements ShopService {
return
ShopResultDto
.
of
(
shop
,
userShop
.
getGroupId
(),
ipResourceDto
);
return
ShopResultDto
.
of
(
shop
,
userShop
.
getGroupId
(),
ipResourceDto
);
}
}
@Override
public
List
<
Shop
>
getShopListByOwner
(
String
owner
,
String
shopName
)
{
return
shopRepository
.
findByOwnerAndShopName
(
owner
,
shopName
);
}
@Override
public
String
updateShopUa
(
String
id
,
String
shopUa
)
{
Shop
shop
=
shopRepository
.
findById
(
id
).
orElseThrow
(
()
->
new
ClientRequestException
(
BrowserErrorCode
.
SHOP_ERROR
,
"shop not exists!"
));
shop
.
setShopUA
(
shopUa
);
return
shopRepository
.
save
(
shop
).
getShopId
();
}
@Override
@Override
public
ShopPageResultDto
getShopList
(
String
username
,
String
groupId
,
int
pageNum
,
int
amount
,
ShopFilterDto
shopFilterDto
,
String
tag
)
{
public
ShopPageResultDto
getShopList
(
String
username
,
String
groupId
,
int
pageNum
,
int
amount
,
ShopFilterDto
shopFilterDto
,
String
tag
)
{
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
...
...
src/main/java/com/edgec/browserbackend/browser/service/ShopService.java
View file @
adf15779
package
com
.
edgec
.
browserbackend
.
browser
.
service
;
package
com
.
edgec
.
browserbackend
.
browser
.
service
;
import
com.edgec.browserbackend.browser.domain.Shop
;
import
com.edgec.browserbackend.browser.domain.ShopSummary
;
import
com.edgec.browserbackend.browser.domain.ShopSummary
;
import
com.edgec.browserbackend.browser.dto.FavoriteUrl
;
import
com.edgec.browserbackend.browser.dto.FavoriteUrl
;
import
com.edgec.browserbackend.browser.dto.ShopFilterDto
;
import
com.edgec.browserbackend.browser.dto.ShopFilterDto
;
...
@@ -67,4 +68,8 @@ public interface ShopService {
...
@@ -67,4 +68,8 @@ public interface ShopService {
List
<
FavoriteUrl
>
getFavoritesByShopId
(
String
shopId
);
List
<
FavoriteUrl
>
getFavoritesByShopId
(
String
shopId
);
boolean
delShopUa
(
String
flag
);
boolean
delShopUa
(
String
flag
);
List
<
Shop
>
getShopListByOwner
(
String
owner
,
String
shopName
);
String
updateShopUa
(
String
id
,
String
shopUa
);
}
}
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