Commit b79142ac authored by renjie's avatar renjie

shop

parent 569a504f
...@@ -25,4 +25,6 @@ public interface AccountRepository extends MongoRepository<Account, String>, Acc ...@@ -25,4 +25,6 @@ public interface AccountRepository extends MongoRepository<Account, String>, Acc
Page<Account> findAllBySignupDateBetween(Pageable pageable, Date startDate, Date endDate); Page<Account> findAllBySignupDateBetween(Pageable pageable, Date startDate, Date endDate);
Page<Account> findAll(Pageable pageable); Page<Account> findAll(Pageable pageable);
List<Account> findByNameIn(List<String> names);
} }
...@@ -18,7 +18,7 @@ public class IpResource { ...@@ -18,7 +18,7 @@ public class IpResource {
private long validTime; private long validTime;
private long leftTime; private long leftTime;
private String details; private String details;
List<Long> bindHistory; List<String> bindHistory;
private boolean isDeleted; private boolean isDeleted;
public String getDetails() { public String getDetails() {
...@@ -61,11 +61,11 @@ public class IpResource { ...@@ -61,11 +61,11 @@ public class IpResource {
this.ipType = ipType; this.ipType = ipType;
} }
public List<Long> getBindHistory() { public List<String> getBindHistory() {
return bindHistory; return bindHistory;
} }
public void setBindHistory(List<Long> bindHistory) { public void setBindHistory(List<String> bindHistory) {
this.bindHistory = bindHistory; this.bindHistory = bindHistory;
} }
......
...@@ -17,7 +17,7 @@ public class Shop { ...@@ -17,7 +17,7 @@ public class Shop {
private TransferStatus transferStatus; private TransferStatus transferStatus;
private String groupId; private String firstGroupId;
private String groupName; private String groupName;
...@@ -31,13 +31,17 @@ public class Shop { ...@@ -31,13 +31,17 @@ public class Shop {
private String ipId; private String ipId;
private String shopAccount;
private String shopPassword;
public Shop(){ public Shop(){
} }
public Shop of(Shop shop) { public Shop of(Shop shop) {
if (shop.getGroupId() != null) if (shop.getFirstGroupId() != null)
this.setGroupId(shop.getGroupId()); this.setFirstGroupId(shop.getFirstGroupId());
if (shop.getGroupName() != null) if (shop.getGroupName() != null)
this.setGroupName(shop.getGroupName()); this.setGroupName(shop.getGroupName());
if (shop.getIp() != null) if (shop.getIp() != null)
...@@ -56,6 +60,10 @@ public class Shop { ...@@ -56,6 +60,10 @@ public class Shop {
this.setShopName(shop.getShopName()); this.setShopName(shop.getShopName());
if (shop.getTransferStatus() != null) if (shop.getTransferStatus() != null)
this.setTransferStatus(shop.getTransferStatus()); this.setTransferStatus(shop.getTransferStatus());
if (shop.getShopAccount() != null)
this.setShopAccount(shop.getShopAccount());
if (shop.getShopPassword() != null)
this.setShopPassword(shop.getShopPassword());
return this; return this;
} }
...@@ -67,8 +75,8 @@ public class Shop { ...@@ -67,8 +75,8 @@ public class Shop {
return id; return id;
} }
public String getGroupId() { public String getFirstGroupId() {
return groupId; return firstGroupId;
} }
public String getGroupName() { public String getGroupName() {
...@@ -111,8 +119,8 @@ public class Shop { ...@@ -111,8 +119,8 @@ public class Shop {
this.id = id; this.id = id;
} }
public void setGroupId(String groupId) { public void setFirstGroupId(String firstGroupId) {
this.groupId = groupId; this.firstGroupId = firstGroupId;
} }
public void setGroupName(String groupName) { public void setGroupName(String groupName) {
...@@ -146,4 +154,20 @@ public class Shop { ...@@ -146,4 +154,20 @@ public class Shop {
public void setTransferStatus(TransferStatus transferStatus) { public void setTransferStatus(TransferStatus transferStatus) {
this.transferStatus = transferStatus; this.transferStatus = transferStatus;
} }
public String getShopAccount() {
return shopAccount;
}
public void setShopAccount(String shopAccount) {
this.shopAccount = shopAccount;
}
public String getShopPassword() {
return shopPassword;
}
public void setShopPassword(String shopPassword) {
this.shopPassword = shopPassword;
}
} }
...@@ -26,6 +26,12 @@ public class UserShop { ...@@ -26,6 +26,12 @@ public class UserShop {
this.shopId = shopId; this.shopId = shopId;
} }
public UserShop(String username, String shopId, String groupId) {
this.username = username;
this.shopId = shopId;
this.groupId = groupId;
}
public String getId() { public String getId() {
return id; return id;
} }
......
package com.edgec.browserbackend.browser.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class FilterDto {
private String shopName;
private String IpRegion;
private String shopAccount;
public String getShopAccount() {
return shopAccount;
}
public void setShopAccount(String shopAccount) {
this.shopAccount = shopAccount;
}
public String getIpRegion() {
return IpRegion;
}
public void setIpRegion(String ipRegion) {
IpRegion = ipRegion;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
}
...@@ -3,6 +3,11 @@ package com.edgec.browserbackend.browser.repository; ...@@ -3,6 +3,11 @@ package com.edgec.browserbackend.browser.repository;
import com.edgec.browserbackend.browser.domain.Shop; import com.edgec.browserbackend.browser.domain.Shop;
import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.MongoRepository;
public interface ShopRepository extends MongoRepository<Shop, String> { import java.util.List;
public interface ShopRepository extends MongoRepository<Shop, String> {
List<Shop> findByIdInAndIpRegionLike(List<String> shopIds, String ipRegion);
List<Shop> findByIdInAndShopAccountLike(List<String> shopIds, String shopAccount);
List<Shop> findByIdInAndShopNameLike(List<String> shopIds, String shopName);
List<Shop> findByIdIn(List<String> shopIds);
} }
...@@ -9,4 +9,5 @@ public interface UserShopRepository extends MongoRepository<UserShop, String>, U ...@@ -9,4 +9,5 @@ public interface UserShopRepository extends MongoRepository<UserShop, String>, U
List<UserShop> findByUsername(String username); List<UserShop> findByUsername(String username);
UserShop findByUsernameAndShopId(String username, String shopId); UserShop findByUsernameAndShopId(String username, String shopId);
UserShop findByShopId(String shopId); UserShop findByShopId(String shopId);
List<UserShop> findByUsernameAndGroupId(String username, String groupId);
} }
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.Shop;
import com.edgec.browserbackend.browser.dto.FilterDto;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
...@@ -19,9 +20,9 @@ public interface ShopService { ...@@ -19,9 +20,9 @@ public interface ShopService {
void unBindShop(String username, String shopId); void unBindShop(String username, String shopId);
void transferShop(String useranme, String shopId, String groupId); void transferShop(String username, String shopId, String groupId);
void assignShop(String username, String shopId, List<String> users); void assignShop(String username, String shopId, List<String> users);
List<Shop> getShopList(String username, String groupId); List<Shop> getShopList(String username, String groupId, int page, int amount, FilterDto filterDto);
} }
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