PushUserInfo.java 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package cn.com.ty.lift.common.model;
  2. import cn.com.ty.lift.common.utils.ValuePool;
  3. import lombok.Data;
  4. import java.util.Objects;
  5. /**
  6. * @author huangyuan
  7. * @date 2020/4/17
  8. * @description 推送模块用户信息
  9. */
  10. @Data
  11. public class PushUserInfo {
  12. /**
  13. * 用户id
  14. */
  15. private Long userId;
  16. /**
  17. * 用户名
  18. */
  19. private String userName;
  20. /**
  21. * 用户手机号
  22. */
  23. private String mobile;
  24. /**
  25. * 设备型号
  26. */
  27. private Integer deviceModel;
  28. /**
  29. * 设备标识
  30. */
  31. private String deviceFlag;
  32. /**
  33. * 角色名称
  34. */
  35. private String roleName;
  36. public boolean available(){
  37. return Objects.nonNull(this.deviceModel) && Objects.nonNull(this.deviceFlag);
  38. }
  39. public boolean isAndroid(){
  40. return ValuePool.nullable(this.getDeviceModel(), 0) == ValuePool.PUSH_DEVICE_MODEL_ANDROID;
  41. }
  42. public boolean isIos(){
  43. return ValuePool.nullable(this.getDeviceModel(), 0) == ValuePool.PUSH_DEVICE_MODEL_IOS;
  44. }
  45. public PushUserInfo(Integer deviceModel, String deviceFlag) {
  46. this.deviceModel = deviceModel;
  47. this.deviceFlag = deviceFlag;
  48. }
  49. }