Skip to content

Commit

Permalink
fix: Serializable should be implemented at the top level
Browse files Browse the repository at this point in the history
  • Loading branch information
chxfantasy committed Dec 18, 2017
1 parent f5b3e3a commit 04247e5
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import spring.cloud.client.model.AccountModel;

import java.io.Serializable;
import java.util.Date;

public class AccountDo extends AccountModel implements Serializable {
/**
* AccountModel should implements Serializable, otherwise userId and userName will not be serialized
*/
public class AccountDo extends AccountModel {

private static final long serialVersionUID = 12345;
private static final long serialVersionUID = 8400094943305435805L;

private String password;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,15 @@
package spring.cloud.biz.dataaccess.dataobject;

import java.util.Date;
import spring.cloud.client.model.CommentModel;

public class CommentDo {
private Long id;
import java.io.Serializable;

private Long momentId;
public class CommentDo extends CommentModel {

private String content;

private Date gmtCreated;

private Date gmtModified;
private static final long serialVersionUID = 4716466311760136418L;

private Boolean isDeleted;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Long getMomentId() {
return momentId;
}

public void setMomentId(Long momentId) {
this.momentId = momentId;
}

public Date getGmtCreated() {
return gmtCreated;
}

public void setGmtCreated(Date gmtCreated) {
this.gmtCreated = gmtCreated;
}

public Date getGmtModified() {
return gmtModified;
}

public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}

public Boolean getIsDeleted() {
return isDeleted;
}
Expand All @@ -55,11 +18,4 @@ public void setIsDeleted(Boolean isDeleted) {
this.isDeleted = isDeleted;
}

public String getContent() {
return content;
}

public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
}
Original file line number Diff line number Diff line change
@@ -1,65 +1,18 @@
package spring.cloud.biz.dataaccess.dataobject;

import java.util.Date;
import spring.cloud.client.model.MomentModel;

public class MomentDo {
private Long id;
public class MomentDo extends MomentModel {

private String userId;

private String content;

private Date gmtCreated;

private Date gmtModified;
private static final long serialVersionUID = 1404709910095824920L;

private Boolean isDeleted;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getUserId() {
return userId;
}

public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}

public Date getGmtCreated() {
return gmtCreated;
}

public void setGmtCreated(Date gmtCreated) {
this.gmtCreated = gmtCreated;
}

public Date getGmtModified() {
return gmtModified;
}

public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}

public Boolean getIsDeleted() {
return isDeleted;
}

public void setIsDeleted(Boolean isDeleted) {
this.isDeleted = isDeleted;
}

public String getContent() {
return content;
}

public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package spring.cloud.client.model;

import java.io.Serializable;

/**
* Created by Harry on 13/12/2017.
*/
public class AccountModel {
public class AccountModel implements Serializable {

private static final long serialVersionUID = 1409585292972743405L;

private String userId;
private String userName;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package spring.cloud.client.model;

import java.io.Serializable;
import java.util.Date;

/**
* Created by Harry on 16/12/2017.
*/
public class CommentModel {
public class CommentModel implements Serializable {

private static final long serialVersionUID = 838968462413447168L;

private Long id;

private Long momentId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package spring.cloud.client.model;

import java.io.Serializable;
import java.util.Date;

/**
* Created by Harry on 16/12/2017.
*/
public class MomentModel {
public class MomentModel implements Serializable {

private static final long serialVersionUID = -4265065943301487413L;

private Long id;

Expand Down

0 comments on commit 04247e5

Please sign in to comment.