Commit b79142ac authored by renjie's avatar renjie

shop

parent 569a504f
......@@ -25,4 +25,6 @@ public interface AccountRepository extends MongoRepository<Account, String>, Acc
Page<Account> findAllBySignupDateBetween(Pageable pageable, Date startDate, Date endDate);
Page<Account> findAll(Pageable pageable);
List<Account> findByNameIn(List<String> names);
}
......@@ -18,7 +18,7 @@ public class IpResource {
private long validTime;
private long leftTime;
private String details;
List<Long> bindHistory;
List<String> bindHistory;
private boolean isDeleted;
public String getDetails() {
......@@ -61,11 +61,11 @@ public class IpResource {
this.ipType = ipType;
}
public List<Long> getBindHistory() {
public List<String> getBindHistory() {
return bindHistory;
}
public void setBindHistory(List<Long> bindHistory) {
public void setBindHistory(List<String> bindHistory) {
this.bindHistory = bindHistory;
}
......
......@@ -17,7 +17,7 @@ public class Shop {
private TransferStatus transferStatus;
private String groupId;
private String firstGroupId;
private String groupName;
......@@ -31,13 +31,17 @@ public class Shop {
private String ipId;
private String shopAccount;
private String shopPassword;
public Shop(){
}
public Shop of(Shop shop) {
if (shop.getGroupId() != null)
this.setGroupId(shop.getGroupId());
if (shop.getFirstGroupId() != null)
this.setFirstGroupId(shop.getFirstGroupId());
if (shop.getGroupName() != null)
this.setGroupName(shop.getGroupName());
if (shop.getIp() != null)
......@@ -56,6 +60,10 @@ public class Shop {
this.setShopName(shop.getShopName());
if (shop.getTransferStatus() != null)
this.setTransferStatus(shop.getTransferStatus());
if (shop.getShopAccount() != null)
this.setShopAccount(shop.getShopAccount());
if (shop.getShopPassword() != null)
this.setShopPassword(shop.getShopPassword());
return this;
}
......@@ -67,8 +75,8 @@ public class Shop {
return id;
}
public String getGroupId() {
return groupId;
public String getFirstGroupId() {
return firstGroupId;
}
public String getGroupName() {
......@@ -111,8 +119,8 @@ public class Shop {
this.id = id;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
public void setFirstGroupId(String firstGroupId) {
this.firstGroupId = firstGroupId;
}
public void setGroupName(String groupName) {
......@@ -146,4 +154,20 @@ public class Shop {
public void setTransferStatus(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 {
this.shopId = shopId;
}
public UserShop(String username, String shopId, String groupId) {
this.username = username;
this.shopId = shopId;
this.groupId = groupId;
}
public String getId() {
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;
import com.edgec.browserbackend.browser.domain.Shop;
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
List<UserShop> findByUsername(String username);
UserShop findByUsernameAndShopId(String username, String shopId);
UserShop findByShopId(String shopId);
List<UserShop> findByUsernameAndGroupId(String username, String groupId);
}
package com.edgec.browserbackend.browser.service;
import com.edgec.browserbackend.browser.domain.Shop;
import com.edgec.browserbackend.browser.dto.FilterDto;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -19,9 +20,9 @@ public interface ShopService {
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);
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