修改抓取异常

master
bynt 2 years ago
parent b525c8d221
commit 69cd4db57a

@ -5,6 +5,7 @@ import com.baiyee.adcallback.repository.TbIDFAEntityRepository;
import com.baiyee.adcallback.repository.entity.TbIDFAEntity; import com.baiyee.adcallback.repository.entity.TbIDFAEntity;
import com.baiyee.adcallback.service.IdfaService; import com.baiyee.adcallback.service.IdfaService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -12,6 +13,7 @@ import org.springframework.stereotype.Service;
* @author Enzo * @author Enzo
* @date : 2023/2/28 * @date : 2023/2/28
*/ */
@Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class IdfaServiceImpl implements IdfaService { public class IdfaServiceImpl implements IdfaService {
@ -21,10 +23,14 @@ public class IdfaServiceImpl implements IdfaService {
@Override @Override
public void saveData(String idfa, String tag, String type) { public void saveData(String idfa, String tag, String type) {
TbIDFAEntity entity = new TbIDFAEntity(); try {
entity.setIdfa(idfa); TbIDFAEntity entity = new TbIDFAEntity();
entity.setTag(StringUtils.isNotBlank(tag) ? tag : CharSequenceUtil.EMPTY); entity.setIdfa(idfa);
entity.setDataSource(type); entity.setTag(StringUtils.isNotBlank(tag) ? tag : CharSequenceUtil.EMPTY);
tbIDFAEntityRepository.save(entity); entity.setDataSource(type);
tbIDFAEntityRepository.save(entity);
} catch (Exception e) {
log.error("============= save tag {} error the idfa as {} =============", tag, idfa);
}
} }
} }

Loading…
Cancel
Save