From 69cd4db57af5d333aa0a5847712b779d05e6e4b3 Mon Sep 17 00:00:00 2001 From: bynt Date: Wed, 22 Mar 2023 13:37:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8A=93=E5=8F=96=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adcallback/service/impl/IdfaServiceImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/baiyee/adcallback/service/impl/IdfaServiceImpl.java b/src/main/java/com/baiyee/adcallback/service/impl/IdfaServiceImpl.java index 8c26970..43da41f 100644 --- a/src/main/java/com/baiyee/adcallback/service/impl/IdfaServiceImpl.java +++ b/src/main/java/com/baiyee/adcallback/service/impl/IdfaServiceImpl.java @@ -5,6 +5,7 @@ import com.baiyee.adcallback.repository.TbIDFAEntityRepository; import com.baiyee.adcallback.repository.entity.TbIDFAEntity; import com.baiyee.adcallback.service.IdfaService; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -12,6 +13,7 @@ import org.springframework.stereotype.Service; * @author Enzo * @date : 2023/2/28 */ +@Slf4j @Service @RequiredArgsConstructor public class IdfaServiceImpl implements IdfaService { @@ -21,10 +23,14 @@ public class IdfaServiceImpl implements IdfaService { @Override public void saveData(String idfa, String tag, String type) { - TbIDFAEntity entity = new TbIDFAEntity(); - entity.setIdfa(idfa); - entity.setTag(StringUtils.isNotBlank(tag) ? tag : CharSequenceUtil.EMPTY); - entity.setDataSource(type); - tbIDFAEntityRepository.save(entity); + try { + TbIDFAEntity entity = new TbIDFAEntity(); + entity.setIdfa(idfa); + entity.setTag(StringUtils.isNotBlank(tag) ? tag : CharSequenceUtil.EMPTY); + entity.setDataSource(type); + tbIDFAEntityRepository.save(entity); + } catch (Exception e) { + log.error("============= save tag {} error the idfa as {} =============", tag, idfa); + } } }