Commit f542b14e authored by renjie's avatar renjie

删除ip

parent b38dff3e
...@@ -391,8 +391,6 @@ public class IpResourceServiceImpl implements IpResourceService { ...@@ -391,8 +391,6 @@ public class IpResourceServiceImpl implements IpResourceService {
try { try {
ResponseEntity<String> result = restTemplate.exchange(URL + "/intelligroup/ipresources?accountId=browser&ip={ip}", HttpMethod.DELETE, httpEntity, String.class, ipAddr); ResponseEntity<String> result = restTemplate.exchange(URL + "/intelligroup/ipresources?accountId=browser&ip={ip}", HttpMethod.DELETE, httpEntity, String.class, ipAddr);
DeleteIpResultDto deleteIpResultDto = JSON.parseObject(result.getBody(), DeleteIpResultDto.class); DeleteIpResultDto deleteIpResultDto = JSON.parseObject(result.getBody(), DeleteIpResultDto.class);
if (StringUtils.isNotBlank(deleteIpResultDto.getErrorCode()))
throw new Exception(deleteIpResultDto.getErrorCode());
ipResource.setDeleted(true); ipResource.setDeleted(true);
ipResourceRepository.save(ipResource); ipResourceRepository.save(ipResource);
if (userShop != null){ if (userShop != null){
......
package com.edgec.browserbackend.browser.task; package com.edgec.browserbackend.browser.task;
import com.edgec.browserbackend.account.repository.AccountRepository;
import com.edgec.browserbackend.browser.ErrorCode.BrowserErrorCode; import com.edgec.browserbackend.browser.ErrorCode.BrowserErrorCode;
import com.edgec.browserbackend.browser.domain.IpResource;
import com.edgec.browserbackend.browser.repository.IpResourceRepository;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List;
@Component @Component
public class BrowserTask { public class BrowserTask {
private static final Logger log = LoggerFactory.getLogger(BrowserTask.class); private static final Logger log = LoggerFactory.getLogger(BrowserTask.class);
// 每天 @Autowired
@Scheduled(cron = "0 * * * * ?") private AccountRepository accountRepository;
// @Scheduled(cron = "0 * * * * ?")
public void checkIpStatus() { @Autowired
private IpResourceRepository ipResourceRepository;
@Scheduled(cron = "0 0 1 * * ?")
public void clearnull() {
} }
} }
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