Commit ab204c18 authored by renjie's avatar renjie

白名单和推广字段

parent 9917e31e
......@@ -102,7 +102,7 @@ public class AccountController {
// accountService.deleteByName(principal.getName());
// }
@RequestMapping(path = "/current", method = RequestMethod.PUT)
@RequestMapping(path = "/updatet", method = RequestMethod.POST)
public ResultDto saveCurrentAccount(Principal principal, @Valid @RequestBody Account account) {
ResultDto resultDto = new ResultDto();
try {
......
......@@ -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;
}
}
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;
}
}
......@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment