From 8e36a746c6c7a60d12492aae979706c54215357c Mon Sep 17 00:00:00 2001 From: "rui.zhang" Date: Tue, 15 Jan 2019 22:14:49 +0800 Subject: [PATCH] alter Change-Id: Icdf4cb65d11d1bbe835111fa2104d901278f57e9 --- .../org/chobit/wp/model/response/Post.java | 21 +++++++++++-------- src/test/java/org/chobit/wp/Config.java | 3 --- .../java/org/chobit/wp/WordPressTest.java | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/chobit/wp/model/response/Post.java b/src/main/java/org/chobit/wp/model/response/Post.java index be3e3d7..364b3b2 100644 --- a/src/main/java/org/chobit/wp/model/response/Post.java +++ b/src/main/java/org/chobit/wp/model/response/Post.java @@ -1,6 +1,9 @@ package org.chobit.wp.model.response; import com.fasterxml.jackson.annotation.JsonProperty; +import org.chobit.wp.enums.CommentStatus; +import org.chobit.wp.enums.PingStatus; +import org.chobit.wp.enums.PostStatus; import org.chobit.wp.model.interval.Enclosure; import java.util.Date; @@ -27,7 +30,7 @@ public class Post { private Date postModifiedGmt; @JsonProperty("post_status") - private String postStatus; + private PostStatus postStatus; @JsonProperty("post_type") private String postType; @@ -64,10 +67,10 @@ public class Post { private int menuOrder; @JsonProperty("comment_status") - private String commentStatus; + private CommentStatus commentStatus; @JsonProperty("ping_status") - private String pingStatus; + private PingStatus pingStatus; private boolean sticky; @@ -122,11 +125,11 @@ public class Post { this.postModifiedGmt = postModifiedGmt; } - public String getPostStatus() { + public PostStatus getPostStatus() { return postStatus; } - public void setPostStatus(String postStatus) { + public void setPostStatus(PostStatus postStatus) { this.postStatus = postStatus; } @@ -226,19 +229,19 @@ public class Post { this.menuOrder = menuOrder; } - public String getCommentStatus() { + public CommentStatus getCommentStatus() { return commentStatus; } - public void setCommentStatus(String commentStatus) { + public void setCommentStatus(CommentStatus commentStatus) { this.commentStatus = commentStatus; } - public String getPingStatus() { + public PingStatus getPingStatus() { return pingStatus; } - public void setPingStatus(String pingStatus) { + public void setPingStatus(PingStatus pingStatus) { this.pingStatus = pingStatus; } diff --git a/src/test/java/org/chobit/wp/Config.java b/src/test/java/org/chobit/wp/Config.java index 14dc2d5..d5e2aab 100644 --- a/src/test/java/org/chobit/wp/Config.java +++ b/src/test/java/org/chobit/wp/Config.java @@ -10,9 +10,6 @@ public class Config { } - public static final Integer DEFAULT_BLOG_ID = 1; - - public static final String XML_RPC_URL = PropKit.getProp("website", System.getProperty("website")); diff --git a/src/test/java/org/chobit/wp/WordPressTest.java b/src/test/java/org/chobit/wp/WordPressTest.java index 792dd73..6aa7b0d 100644 --- a/src/test/java/org/chobit/wp/WordPressTest.java +++ b/src/test/java/org/chobit/wp/WordPressTest.java @@ -62,7 +62,7 @@ public class WordPressTest { @Test public void getPost() { - Post p = wp.getPost(29, "post_content"); + Post p = wp.getPost(4090); System.out.println(p); Assert.assertNotNull(p); }