mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-09-21 02:58:09 +08:00
update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.cp.bean.messagebuilder;
|
||||
|
||||
import me.chanjar.weixin.cp.api.WxCpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
|
||||
/**
|
||||
@@ -15,7 +15,7 @@ public final class FileBuilder extends BaseBuilder<FileBuilder> {
|
||||
private String mediaId;
|
||||
|
||||
public FileBuilder() {
|
||||
this.msgType = WxCpConsts.CUSTOM_MSG_FILE;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_FILE;
|
||||
}
|
||||
|
||||
public FileBuilder mediaId(String media_id) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.cp.bean.messagebuilder;
|
||||
|
||||
import me.chanjar.weixin.cp.api.WxCpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
|
||||
/**
|
||||
@@ -15,7 +15,7 @@ public final class ImageBuilder extends BaseBuilder<ImageBuilder> {
|
||||
private String mediaId;
|
||||
|
||||
public ImageBuilder() {
|
||||
this.msgType = WxCpConsts.CUSTOM_MSG_IMAGE;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_IMAGE;
|
||||
}
|
||||
|
||||
public ImageBuilder mediaId(String media_id) {
|
||||
|
@@ -1,11 +1,11 @@
|
||||
package me.chanjar.weixin.cp.bean.messagebuilder;
|
||||
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import me.chanjar.weixin.cp.api.WxCpConsts;
|
||||
import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
|
||||
/**
|
||||
* 图文消息builder
|
||||
* <pre>
|
||||
@@ -20,7 +20,7 @@ public final class NewsBuilder extends BaseBuilder<NewsBuilder> {
|
||||
private List<WxCpMessage.WxArticle> articles = new ArrayList<WxCpMessage.WxArticle>();
|
||||
|
||||
public NewsBuilder() {
|
||||
this.msgType = WxCpConsts.CUSTOM_MSG_NEWS;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_NEWS;
|
||||
}
|
||||
|
||||
public NewsBuilder addArticle(WxCpMessage.WxArticle article) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.cp.bean.messagebuilder;
|
||||
|
||||
import me.chanjar.weixin.cp.api.WxCpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
|
||||
/**
|
||||
@@ -15,7 +15,7 @@ public final class TextBuilder extends BaseBuilder<TextBuilder> {
|
||||
private String content;
|
||||
|
||||
public TextBuilder() {
|
||||
this.msgType = WxCpConsts.CUSTOM_MSG_TEXT;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_TEXT;
|
||||
}
|
||||
|
||||
public TextBuilder content(String content) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.cp.bean.messagebuilder;
|
||||
|
||||
import me.chanjar.weixin.cp.api.WxCpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ public final class VideoBuilder extends BaseBuilder<VideoBuilder> {
|
||||
private String thumbMediaId;
|
||||
|
||||
public VideoBuilder() {
|
||||
this.msgType = WxCpConsts.CUSTOM_MSG_VIDEO;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_VIDEO;
|
||||
}
|
||||
|
||||
public VideoBuilder mediaId(String mediaId) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.cp.bean.messagebuilder;
|
||||
|
||||
import me.chanjar.weixin.cp.api.WxCpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
|
||||
/**
|
||||
@@ -15,7 +15,7 @@ public final class VoiceBuilder extends BaseBuilder<VoiceBuilder> {
|
||||
private String mediaId;
|
||||
|
||||
public VoiceBuilder() {
|
||||
this.msgType = WxCpConsts.CUSTOM_MSG_VOICE;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_VOICE;
|
||||
}
|
||||
|
||||
public VoiceBuilder mediaId(String media_id) {
|
||||
|
@@ -21,7 +21,7 @@ import com.google.inject.Inject;
|
||||
public class WxCpDepartAPITest {
|
||||
|
||||
@Inject
|
||||
protected WxCpServiceImpl wxService;
|
||||
protected WxCpServiceImpl wxCpService;
|
||||
|
||||
protected WxCpDepart depart;
|
||||
|
||||
@@ -30,13 +30,13 @@ public class WxCpDepartAPITest {
|
||||
depart.setName("子部门" + System.currentTimeMillis());
|
||||
depart.setParentId(1);
|
||||
depart.setOrder(1);
|
||||
Integer departId = wxService.departCreate(depart);
|
||||
Integer departId = wxCpService.departCreate(depart);
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testDepartCreate")
|
||||
public void testDepartGet() throws WxErrorException {
|
||||
System.out.println("=================获取部门");
|
||||
List<WxCpDepart> departList = wxService.departGet();
|
||||
List<WxCpDepart> departList = wxCpService.departGet();
|
||||
Assert.assertNotNull(departList);
|
||||
Assert.assertTrue(departList.size() > 0);
|
||||
for (WxCpDepart g : departList) {
|
||||
@@ -50,14 +50,14 @@ public class WxCpDepartAPITest {
|
||||
public void testDepartUpdate() throws WxErrorException {
|
||||
System.out.println("=================更新部门");
|
||||
depart.setName("子部门改名" + System.currentTimeMillis());
|
||||
wxService.departUpdate(depart);
|
||||
wxCpService.departUpdate(depart);
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testDepartUpdate")
|
||||
public void testDepartDelete() throws WxErrorException {
|
||||
System.out.println("=================删除部门");
|
||||
System.out.println(depart.getId() + ":" + depart.getName());
|
||||
wxService.departDelete(depart.getId());
|
||||
wxCpService.departDelete(depart.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
public class WxCpUserAPITest {
|
||||
|
||||
@Inject
|
||||
protected WxCpServiceImpl wxService;
|
||||
protected WxCpServiceImpl wxCpService;
|
||||
|
||||
protected WxCpDepart depart;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class WxCpUserAPITest {
|
||||
user.setPosition("老婆");
|
||||
user.setTel("3300393");
|
||||
user.addExtAttr("爱好", "老公");
|
||||
wxService.userCreate(user);
|
||||
wxCpService.userCreate(user);
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testUserCreate")
|
||||
@@ -44,23 +44,23 @@ public class WxCpUserAPITest {
|
||||
user.setUserId("xiaohe.yang");
|
||||
user.setName("杨宝");
|
||||
user.addExtAttr("爱好", "老公2");
|
||||
wxService.userUpdate(user);
|
||||
wxCpService.userUpdate(user);
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testUserUpdate")
|
||||
public void testUserGet() throws WxErrorException {
|
||||
WxCpUser user = wxService.userGet("xiaohe.yang");
|
||||
WxCpUser user = wxCpService.userGet("xiaohe.yang");
|
||||
Assert.assertNotNull(user);
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testUserGet")
|
||||
public void testDepartGetUsers() throws WxErrorException {
|
||||
List<WxCpUser> users = wxService.departGetUsers(1, true, 0);
|
||||
List<WxCpUser> users = wxCpService.departGetUsers(1, true, 0);
|
||||
Assert.assertNotEquals(users.size(), 0);
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testDepartGetUsers")
|
||||
public void testUserDelete() throws WxErrorException {
|
||||
wxService.userDelete("xiaohe.yang");
|
||||
wxCpService.userDelete("xiaohe.yang");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user