Authored by liangyi.chen@yoho.cn

fix bug

... ... @@ -36,6 +36,7 @@ public class GrassArticlePraiseListener extends AbstractMqListener<GrassArticleP
logger.error("deleteData failed , publicUserPraise is null");
return;
}
publicUserPraise.setPraiseType(DatasyncConstant.PHRAISE_TYPE.ARTICLE_PHRAISE);
praiseService.deletePublicUserPraise(publicUserPraise);
}
... ...
... ... @@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
import com.googlecode.concurrentlinkedhashmap.Weighers;
import com.yoho.datasync.consumer.common.EventEnum;
import com.yoho.datasync.core.base.core.DatasyncConstant;
import com.yoho.datasync.core.base.constant.DatasyncConstant;
import com.yoho.datasync.core.base.message.MessageHelper;
import com.yoho.datasync.core.base.message.MqMessageEntity;
import com.yoho.datasync.core.base.message.TableConfigLoader;
... ...
... ... @@ -26,13 +26,14 @@ public class PublicUserPraiseService {
repository.save(publicUserPraise);
}
public void deletePublicUserPraise(PublicUserPraise publicUserPraise) {
public void deletePublicUserPraise(PublicUserPraise publicUserPraise) throws Exception{
PublicUserPraise publicUserPraiseFromDB = getPublicUserPraiseByUniqueKey(publicUserPraise);
if (publicUserPraiseFromDB != null) {
repository.deleteById(publicUserPraiseFromDB.getId());
}else{
logger.error("数据不存在praiseType={},uid={},targetId={}", publicUserPraise.getPraiseType(),
publicUserPraise.getUid(),publicUserPraise.getTargetId());
throw new Exception();
}
}
... ...