|
|
package com.yoho.search.consumer.index.increment.database;
|
|
|
package com.yoho.search.consumer.index.increment.otherIndex;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.search.base.utils.ConvertUtils;
|
|
|
import com.yoho.search.base.utils.EventReportEnum;
|
|
|
import com.yoho.search.consumer.index.common.IYohoIndexService;
|
|
|
import com.yoho.search.consumer.index.increment.AbstractMqListener;
|
|
|
import com.yoho.search.consumer.service.daoService.PromotionTypeService;
|
|
|
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
|
|
|
import com.yoho.search.dal.model.PromotionType;
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
...
|
...
|
@@ -20,6 +20,8 @@ public class PromotionTypeMqListener extends AbstractMqListener { |
|
|
|
|
|
@Autowired
|
|
|
private PromotionTypeService promotionTypeService;
|
|
|
@Autowired
|
|
|
private IYohoIndexService indexService;
|
|
|
|
|
|
@Override
|
|
|
protected EventReportEnum getEventReportEnum() {
|
...
|
...
|
@@ -29,6 +31,7 @@ public class PromotionTypeMqListener extends AbstractMqListener { |
|
|
@Override
|
|
|
protected void deleteData(String id) throws Exception {
|
|
|
promotionTypeService.delete(Integer.valueOf(id));
|
|
|
indexService.deleteIndexData(this.getIndexName(), id);
|
|
|
}
|
|
|
|
|
|
@Override
|
...
|
...
|
@@ -37,6 +40,8 @@ public class PromotionTypeMqListener extends AbstractMqListener { |
|
|
if (promotionType == null || promotionType.getId() == null) {
|
|
|
return;
|
|
|
}
|
|
|
String idValue = promotionType.getId().toString();
|
|
|
promotionTypeService.saveOrUpdate(promotionType);
|
|
|
indexService.updateIndexData(this.getIndexName(), idValue, promotionType);
|
|
|
}
|
|
|
} |
...
|
...
|
|