标签:img 区分 The enable text ima gen 微服务 hashmap
一、背景描述
二、具体分析
三、具体实现
1、为了达到多个事件可以共用,所有设置通过入参来区分不同的场景
2、调用端和消费端代码
Map<String, Object> bizParam = new HashMap<>(16); bizParam.put("context", context); bizParam.put("userFeature", userFeature); bizParam.put("roleAccuserBuyer", ROLE_ACCUSER_BUYER); applicationContext.publishEvent(
BusinessEvent.generate(this,
EventConstants.BATCH_UPDATE_FEATURE, mediateEntityDTO, bizParam));
return ActionResult.getSuccessResult("操作成功");
@Async @EventListener @Override public void batchUpdateFeature(BusinessEvent event) { if(!EventConstants.BATCH_UPDATE_FEATURE.equals(event.getBizType())) { return; } logger.info("batchUpdateFeature begin. event is : {}", JSONObject.toJSONString(event)); MediateEntityDTO mediateEntityDTO = (MediateEntityDTO) event.getBizObject(); if(StringUtils.isEmpty(mediateEntityDTO.getMobile())) { logger.warn("update other relation entity fail without mobile!"); return ; } //获取参数 Map<String, Object> bizParam = event.getBizParam(); Context context = (Context) bizParam.get("context"); List<String> roleAccuserBuyer = (List<String>) bizParam.get("roleAccuserBuyer"); String userFeature = (String) bizParam.get("userFeature");
}
标签:img 区分 The enable text ima gen 微服务 hashmap
原文地址:https://www.cnblogs.com/ws563573095/p/10332009.html