Commit 852f270f authored by huangjiamin's avatar huangjiamin

迁移ip

parent fa241b6f
......@@ -601,6 +601,7 @@ public class AdministratorController {
* @param owner owner
* @return ResultDto
*/
@PreAuthorize(Securitys.ADMIN_EL)
@GetMapping(value = "/{owner}/ip")
public ResultDto ipMigration(@PathVariable String owner) {
String logs = "【IpMigration】 ";
......@@ -621,6 +622,7 @@ public class AdministratorController {
* @param ips ips
* @return ResultDto
*/
@PreAuthorize(Securitys.ADMIN_EL)
@PutMapping(value = "/{owner}/ip/{newOwner}")
public ResultDto ipMigration(@PathVariable String owner, @PathVariable String newOwner, @RequestParam String ips) {
String logs = "【IpMigration】 ";
......
......@@ -37,6 +37,8 @@ import java.util.*;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
import static com.edgec.browserbackend.browser.domain.IpType.VENDOR;
@Service
@ComponentScan("com.edgec.browserbackend.account.repository")
......@@ -721,7 +723,7 @@ public class AdministratorServiceImpl implements AdministratorService {
@Override
public List<String> getUsernameIpList(String owner) {
return ipResourceRepository.findByOwnerAndIsDeleted(owner, false).stream().map(IpResource::getAddr).collect(Collectors.toList());
return ipResourceRepository.findByOwnerAndIsDeletedAndIpType(owner, false, VENDOR).stream().map(IpResource::getAddr).collect(Collectors.toList());
}
@Override
......
package com.edgec.browserbackend.browser.repository;
import com.edgec.browserbackend.browser.domain.IpResource;
import com.edgec.browserbackend.browser.domain.IpType;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import java.util.Arrays;
import java.util.List;
public interface IpResourceRepository extends MongoRepository<IpResource, String>, IpResourceRepositoryCustom {
......@@ -88,7 +90,8 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String
*
* @param owner owner
* @param isDelete isDelete
* @param vendor vendor
* @return List
*/
List<IpResource> findByOwnerAndIsDeleted(String owner, boolean isDelete);
List<IpResource> findByOwnerAndIsDeletedAndIpType(String owner, boolean isDelete, IpType vendor);
}
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