|
|
@@ -7,8 +7,10 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.dromara.common.core.constant.CloudMqEventConstants;
|
|
|
+import org.dromara.common.message.kafka.constant.EventSenderConstants;
|
|
|
import org.dromara.common.message.kafka.constant.EventTypeConstants;
|
|
|
import org.dromara.server.mq.event.kafka.IEventStrategy;
|
|
|
+import org.dromara.server.mq.event.kafka.IYktEventStrategy;
|
|
|
import org.dromara.system.api.RemoteDeptService;
|
|
|
import org.dromara.system.api.RemoteUserService;
|
|
|
import org.dromara.system.api.domain.bo.RemoteDeptBo;
|
|
|
@@ -27,21 +29,20 @@ import org.springframework.stereotype.Service;
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@RequiredArgsConstructor
|
|
|
-@Service(EventTypeConstants.USER)
|
|
|
-public class PushUserEventStrategyImpl implements IEventStrategy {
|
|
|
+//@Service(EventSenderConstants.SYSTEM)
|
|
|
+public class PushUserEventStrategyImpl implements IYktEventStrategy {
|
|
|
@DubboReference
|
|
|
private final RemoteUserService remoteUserService;
|
|
|
|
|
|
@Override
|
|
|
- public void doMsgHandle(JSONObject data) {
|
|
|
- RemoteUserBo remoteBo = JSONUtil.toBean(data, RemoteUserBo.class);
|
|
|
- log.info("[处理云端->本地用户同步请求]-[用户信息:{}]", JSONUtil.toJsonStr(remoteBo));
|
|
|
- RemoteUserVo remoteVo = remoteUserService.selectUserById(remoteBo.getUserId());
|
|
|
- if(ObjectUtil.isEmpty(remoteVo)){
|
|
|
- remoteUserService.insertUser(remoteBo);
|
|
|
- } else {
|
|
|
- remoteUserService.updateUser(remoteBo);
|
|
|
- }
|
|
|
-
|
|
|
+ public void doMsgHandle(String eventType, Object msg) throws Exception {
|
|
|
+ // RemoteUserBo remoteBo = JSONUtil.toBean(JSONUtil.parseObj(msg), RemoteUserBo.class);
|
|
|
+ // log.info("[处理云端->本地用户同步请求]-[用户信息:{}]", JSONUtil.toJsonStr(remoteBo));
|
|
|
+ // RemoteUserVo remoteVo = remoteUserService.selectUserById(remoteBo.getUserId());
|
|
|
+ // if(ObjectUtil.isEmpty(remoteVo)){
|
|
|
+ // remoteUserService.insertUser(remoteBo);
|
|
|
+ // } else {
|
|
|
+ // remoteUserService.updateUser(remoteBo);
|
|
|
+ // }
|
|
|
}
|
|
|
}
|