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
ab204c18
Commit
ab204c18
authored
Mar 12, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
白名单和推广字段
parent
9917e31e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
3 deletions
+104
-3
AccountController.java
.../browserbackend/account/controller/AccountController.java
+1
-1
Account.java
...java/com/edgec/browserbackend/account/domain/Account.java
+65
-1
Promotion.java
...va/com/edgec/browserbackend/account/domain/Promotion.java
+36
-0
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+2
-1
No files found.
src/main/java/com/edgec/browserbackend/account/controller/AccountController.java
View file @
ab204c18
...
...
@@ -102,7 +102,7 @@ public class AccountController {
// accountService.deleteByName(principal.getName());
// }
@RequestMapping
(
path
=
"/
current"
,
method
=
RequestMethod
.
PU
T
)
@RequestMapping
(
path
=
"/
updatet"
,
method
=
RequestMethod
.
POS
T
)
public
ResultDto
saveCurrentAccount
(
Principal
principal
,
@Valid
@RequestBody
Account
account
)
{
ResultDto
resultDto
=
new
ResultDto
();
try
{
...
...
src/main/java/com/edgec/browserbackend/account/domain/Account.java
View file @
ab204c18
...
...
@@ -6,6 +6,7 @@ import org.springframework.data.annotation.Id;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -40,7 +41,62 @@ public class Account {
private
int
permission
=
00000000
;
private
List
<
String
>
whiteList
=
new
ArrayList
<>();
private
Promotion
promotion
;
private
List
<
String
>
whiteList
=
Arrays
.
asList
(
"amazon.com"
,
"amazon.jp"
,
"amazon.co"
,
"amazon.ca"
,
"amazon.in"
,
"amazon.fr"
,
"amazon.it"
,
"amazon.de"
,
"amazon.es"
,
"amazon.sg"
,
"ebay.com"
,
"ebay.co"
,
"ebay.ca"
,
"ebay.de"
,
"ebay.es"
,
"ebay.fr"
,
"ebay.it"
,
"lazada.com"
,
"lazada.co"
,
"lazada.sg"
,
"lazada.vn"
,
"walmart.com"
,
"walmart.ca"
,
"shopee.cn"
,
"shopee.com"
,
"shopee.co"
,
"shopee.ph"
,
"shopee.sg"
,
"shopee.vn"
,
"paypal.com"
,
"wish.com"
,
"aliexpress.com"
,
"aliexpress.ru"
,
"pinduoduo.com"
,
"taobao.com"
,
"etsy.com"
,
"baidu.com"
,
"souq.com"
,
"joom.com"
,
"cdiscount.com"
,
"vova.com"
,
"eservicesgroup.com"
,
"factorymarket.com"
,
"factorymarket.de"
,
"yahoo.co.jp"
,
"yahoo.com"
,
"ezbuy.com"
,
"wayfair.com"
,
"yandex.com"
,
"rakuma.com"
,
"mymall.com"
,
"lilimall.com"
);
private
int
childCount
=
0
;
...
...
@@ -208,4 +264,12 @@ public class Account {
public
void
setShopCount
(
int
shopCount
)
{
this
.
shopCount
=
shopCount
;
}
public
Promotion
getPromotion
()
{
return
promotion
;
}
public
void
setPromotion
(
Promotion
promotion
)
{
this
.
promotion
=
promotion
;
}
}
src/main/java/com/edgec/browserbackend/account/domain/Promotion.java
0 → 100644
View file @
ab204c18
package
com
.
edgec
.
browserbackend
.
account
.
domain
;
/**
* @Desc
* @Author jason
* @CreateTime 2020/3/12 3:14 下午
**/
public
class
Promotion
{
private
String
link
;
private
int
invitedUsers
;
private
int
commission
;
public
int
getCommission
()
{
return
commission
;
}
public
void
setCommission
(
int
commission
)
{
this
.
commission
=
commission
;
}
public
int
getInvitedUsers
()
{
return
invitedUsers
;
}
public
void
setInvitedUsers
(
int
invitedUsers
)
{
this
.
invitedUsers
=
invitedUsers
;
}
public
String
getLink
()
{
return
link
;
}
public
void
setLink
(
String
link
)
{
this
.
link
=
link
;
}
}
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
ab204c18
...
...
@@ -601,7 +601,7 @@ public class AccountServiceImpl implements AccountService {
account
.
setEmail
(
user
.
getEmail
());
account
.
setPhoneNumber
(
user
.
getUsername
());
account
.
setPermission
(
15
);
account
.
setPromotion
(
new
Promotion
());
account
.
setAllowedToCreateSubUser
(
true
);
user
.
setEnabled
(
true
);
...
...
@@ -793,6 +793,7 @@ public class AccountServiceImpl implements AccountService {
// account.setPhoneNumber(update.getPhoneNumber());
account
.
setEmail
(
update
.
getEmail
());
account
.
setPermission
(
update
.
getPermission
());
account
.
setWhiteList
(
update
.
getWhiteList
());
log
.
debug
(
"account {} changes has been saved"
,
name
);
if
(!
org
.
apache
.
commons
.
lang3
.
StringUtils
.
equalsIgnoreCase
(
preEmail
,
update
.
getEmail
()))
{
Account
account1
=
repository
.
findByEmail
(
update
.
getEmail
());
...
...
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