KeycloakUserCO.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package com.inspur.customer.service.dto;
  2. import lombok.Data;
  3. import org.springframework.lang.Nullable;
  4. import java.io.Serializable;
  5. import java.util.List;
  6. /**
  7. * keycloak user
  8. * @author linwenhua
  9. * @date 2022-06-14 16:54
  10. **/
  11. @Data
  12. public class KeycloakUserCO implements Serializable {
  13. private static final long serialVersionUID = 6869360605249346844L;
  14. private String id;
  15. private String username;
  16. private String phone;
  17. private String email;
  18. private String wechat;
  19. private String wechatAppletOpenId;
  20. public void setPhone(@Nullable List<String> phones) {
  21. if (phones != null && !phones.isEmpty()) {
  22. phone = phones.get(0);
  23. }
  24. }
  25. public void setWechat(@Nullable List<String> wechats) {
  26. if (wechats != null && !wechats.isEmpty()) {
  27. String temp = wechats.get(0);
  28. if (!temp.contains("{\"")) {
  29. wechat = temp;
  30. }
  31. }
  32. }
  33. public void setWechatApplet(@Nullable List<String> wechatApplets) {
  34. if (wechatApplets != null && !wechatApplets.isEmpty()) {
  35. String temp = wechatApplets.get(0);
  36. if (!temp.contains("{\"")) {
  37. wechatAppletOpenId = temp;
  38. }
  39. }
  40. }
  41. }