PullUserUtil.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package jnpf.permission.rest;
  2. import jnpf.permission.connector.HttpRequestUserInfoService;
  3. import jnpf.permission.entity.UserEntity;
  4. import jnpf.util.JsonUtil;
  5. import lombok.extern.slf4j.Slf4j;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Component;
  8. import java.util.Map;
  9. /**
  10. * 推送工具类
  11. *
  12. * @author :JNPF开发平台组
  13. * @version: V3.1.0
  14. * @copyright 引迈信息技术有限公司
  15. * @date :2022/7/28 20:56
  16. */
  17. @Slf4j
  18. @Component
  19. public class PullUserUtil {
  20. private static HttpRequestUserInfoService httpRequestUserInfoService;
  21. public PullUserUtil(@Autowired(required = false) HttpRequestUserInfoService httpRequestUserInfoService){
  22. PullUserUtil.httpRequestUserInfoService = httpRequestUserInfoService;
  23. }
  24. /**
  25. * 推送到
  26. *
  27. * @param userEntity
  28. * @param method
  29. * @param tenantId
  30. */
  31. public static void syncUser(UserEntity userEntity, String method, String tenantId) {
  32. if (httpRequestUserInfoService != null) {
  33. Map<String, Object> map = JsonUtil.entityToMap(userEntity);
  34. httpRequestUserInfoService.syncUserInfo(map, method, tenantId);
  35. }
  36. }
  37. }