Device.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package cn.efunbox.audio.entity;
  2. import cn.efunbox.audio.consts.Status;
  3. import lombok.Data;
  4. import lombok.ToString;
  5. import org.hibernate.annotations.DynamicInsert;
  6. import org.hibernate.annotations.DynamicUpdate;
  7. import javax.persistence.*;
  8. import java.io.Serializable;
  9. import java.sql.Timestamp;
  10. import java.util.Date;
  11. /**
  12. * Created by yao on 17-9-26.
  13. */
  14. @Data
  15. @ToString
  16. @Entity
  17. @Table(name = "device")
  18. @DynamicInsert
  19. @DynamicUpdate
  20. public class Device implements Serializable, Cloneable{
  21. @Id
  22. @GeneratedValue
  23. private Long id;
  24. //新token
  25. @Column(name = "tokenNew", columnDefinition="varchar(100) comment '新token'")
  26. private String tokenNew="";
  27. //旧token,新token被验证后旧token失效
  28. @Column
  29. private String tokenOld="";
  30. //合作渠道编号
  31. @Column
  32. private Long idChannel;
  33. //设备编号串
  34. @Column
  35. private Long idDevice;
  36. //状态
  37. @Column
  38. private Integer status;
  39. //设备的会员有效期
  40. @Column
  41. @Temporal(TemporalType.TIMESTAMP)
  42. private Date valid;
  43. //上次更新、登陆时间
  44. @Column
  45. // @Temporal(TemporalType.TIMESTAMP)
  46. // private Date updated;
  47. private Timestamp updated;
  48. //在资源平台的账号信息,学号
  49. @Column
  50. private String iaas_eid;
  51. //在资源平台的账号信息,uuid
  52. @Column
  53. private String iaas_uid;
  54. //在资源平台的账号信息,设备id
  55. @Column
  56. private String iaas_name;
  57. //在资源平台的账号信息,设备密码
  58. @Column
  59. private String iaas_pwd;
  60. //在资源平台的账号信息,访问token
  61. @Column
  62. private String iaas_token;
  63. //在资源平台的账号信息,访问token过期时间
  64. @Column
  65. private Timestamp iaas_expiration;
  66. //创建时间
  67. @Column
  68. // @Temporal(TemporalType.TIMESTAMP)
  69. // private Date created;
  70. private Timestamp created;
  71. public Object clone() throws CloneNotSupportedException {
  72. return super.clone();
  73. }
  74. }