edit doc
Change-Id: Ife6e3d3c7ce13b3c8432d0a138686d4994967450
This commit is contained in:
parent
c9f42b42f1
commit
fee61d6b64
@ -18,7 +18,7 @@ WordPress Client是一个Java版的WordPress客户端操作库, 主要基于[W
|
||||
<version>x.x.x</version>
|
||||
</dependency>
|
||||
```
|
||||
目前wp-client的版本是0.1.2。请尽量使用最新版本。
|
||||
目前wp-client的版本是0.1.3。请尽量使用最新版本。
|
||||
|
||||
## 创建WordPress操作实例
|
||||
|
||||
@ -96,8 +96,8 @@ getAuthors()方法返回的是用户相关的信息:
|
||||
PostRequest post = new PostRequest();
|
||||
post.setPostTitle("测试Title");
|
||||
post.setPostContent("这是一段测试文章内容");
|
||||
post.addCategories("分类1","分类2");
|
||||
post.addTags("a", "b", "c");
|
||||
post.setCategories("分类1","分类2");
|
||||
post.setTags("a", "b", "c");
|
||||
post.setPostName("test-post-name");
|
||||
int postId = wp.newPost(post);
|
||||
```
|
||||
|
2
pom.xml
2
pom.xml
@ -12,7 +12,7 @@
|
||||
|
||||
<groupId>org.chobit.wp</groupId>
|
||||
<artifactId>wordpress-client</artifactId>
|
||||
<version>0.1.2</version>
|
||||
<version>0.1.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>WordPress-Client</name>
|
||||
|
@ -218,7 +218,7 @@ public class PostRequest extends Request {
|
||||
}
|
||||
|
||||
@Transient
|
||||
public void addCategories(String... categories) {
|
||||
public void setCategories(String... categories) {
|
||||
if (null == termsNames) {
|
||||
setTermsNames(new HashMap<>(2));
|
||||
}
|
||||
@ -228,7 +228,7 @@ public class PostRequest extends Request {
|
||||
}
|
||||
|
||||
@Transient
|
||||
public void addTags(String... tags) {
|
||||
public void setTags(String... tags) {
|
||||
if (null == termsNames) {
|
||||
setTermsNames(new HashMap<>(2));
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
package org.chobit.wp;
|
||||
|
||||
import org.chobit.wp.model.request.PostRequest;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@ -10,8 +8,7 @@ import java.io.IOException;
|
||||
public class Test {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
PostRequest request = new PostRequest();
|
||||
request.setPostAuthor(11);
|
||||
System.out.println(request.toMap());
|
||||
System.out.println((char)(0X87));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -73,8 +73,8 @@ public class WordPressTest {
|
||||
PostRequest post = new PostRequest();
|
||||
post.setPostTitle("测试PostName");
|
||||
post.setPostContent("这是一段测试文章内容");
|
||||
post.addCategories("分类");
|
||||
post.addTags("a", "b", "c");
|
||||
post.setCategories("分类");
|
||||
post.setTags("a", "b", "c");
|
||||
post.setPostName("test-post-name");
|
||||
int postId = wp.newPost(post);
|
||||
System.out.println(postId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user