update md
This commit is contained in:
parent
bcc94eed62
commit
85645be705
@ -110,6 +110,12 @@ public class WeixinProxy {
|
||||
tokenStorager));
|
||||
}
|
||||
|
||||
/**
|
||||
* 注意:TokenCreator 需为 <font color="red">WeixinTokenCreator</font>
|
||||
*
|
||||
* @see com.foxinmy.weixin4j.mp.token.WeixinTokenCreator.WeixinTokenCreator
|
||||
* @param tokenHolder
|
||||
*/
|
||||
public WeixinProxy(TokenHolder tokenHolder) {
|
||||
this.tokenHolder = tokenHolder;
|
||||
this.mediaApi = new MediaApi(tokenHolder);
|
||||
|
||||
@ -85,7 +85,8 @@ public class WeixinProxy {
|
||||
* token存储策略
|
||||
*/
|
||||
public WeixinProxy(TokenStorager tokenStorager) {
|
||||
this(QyApi.DEFAULT_WEIXIN_ACCOUNT.getId(), QyApi.DEFAULT_WEIXIN_ACCOUNT.getSecret(), tokenStorager);
|
||||
this(QyApi.DEFAULT_WEIXIN_ACCOUNT.getId(), QyApi.DEFAULT_WEIXIN_ACCOUNT
|
||||
.getSecret(), tokenStorager);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,10 +108,18 @@ public class WeixinProxy {
|
||||
* @param tokenStorager
|
||||
* 企业号token存储器
|
||||
*/
|
||||
public WeixinProxy(String corpid, String corpsecret, TokenStorager tokenStorager) {
|
||||
this(new TokenHolder(new WeixinTokenCreator(corpid, corpsecret), tokenStorager));
|
||||
public WeixinProxy(String corpid, String corpsecret,
|
||||
TokenStorager tokenStorager) {
|
||||
this(new TokenHolder(new WeixinTokenCreator(corpid, corpsecret),
|
||||
tokenStorager));
|
||||
}
|
||||
|
||||
/**
|
||||
* 注意:TokenCreator 需为 <font color="red">WeixinTokenCreator</font>
|
||||
*
|
||||
* @see com.foxinmy.weixin4j.mp.token.WeixinTokenCreator.WeixinTokenCreator
|
||||
* @param tokenHolder
|
||||
*/
|
||||
public WeixinProxy(TokenHolder tokenHolder) {
|
||||
this.tokenHolder = tokenHolder;
|
||||
this.partyApi = new PartyApi(tokenHolder);
|
||||
@ -140,8 +149,7 @@ public class WeixinProxy {
|
||||
* @param message
|
||||
* 客服消息对象
|
||||
* @return 如果对应用或收件人、部门、标签任何一个无权限,则本次发送失败;如果收件人、部门或标签不存在,发送仍然执行,但返回无效的部分
|
||||
* </br>
|
||||
* { "errcode": 0, "errmsg": "ok", "invaliduser": "UserID1",
|
||||
* </br> { "errcode": 0, "errmsg": "ok", "invaliduser": "UserID1",
|
||||
* "invalidparty":"PartyID1", "invalidtag":"TagID1" }
|
||||
* @throws WeixinException
|
||||
* @see com.foxinmy.weixin4j.qy.api.NotifyApi
|
||||
@ -160,7 +168,8 @@ public class WeixinProxy {
|
||||
* @see com.foxinmy.weixin4j.tuple.MpNews
|
||||
* @see com.foxinmy.weixin4j.qy.message.NotifyMessage
|
||||
*/
|
||||
public JSONObject sendNotifyMessage(NotifyMessage message) throws WeixinException {
|
||||
public JSONObject sendNotifyMessage(NotifyMessage message)
|
||||
throws WeixinException {
|
||||
return notifyApi.sendNotifyMessage(message);
|
||||
}
|
||||
|
||||
@ -178,7 +187,8 @@ public class WeixinProxy {
|
||||
* 创建自定义菜单</a>
|
||||
* @see com.foxinmy.weixin4j.model.Button
|
||||
*/
|
||||
public JsonResult createMenu(List<Button> btnList, int agentid) throws WeixinException {
|
||||
public JsonResult createMenu(List<Button> btnList, int agentid)
|
||||
throws WeixinException {
|
||||
return menuApi.createMenu(btnList, agentid);
|
||||
}
|
||||
|
||||
@ -239,7 +249,8 @@ public class WeixinProxy {
|
||||
* 上传永久素材文件说明</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public MediaUploadResult uploadMedia(int agentid, InputStream is, String fileName) throws WeixinException {
|
||||
public MediaUploadResult uploadMedia(int agentid, InputStream is,
|
||||
String fileName) throws WeixinException {
|
||||
return mediaApi.uploadMedia(agentid, is, fileName);
|
||||
}
|
||||
|
||||
@ -256,7 +267,8 @@ public class WeixinProxy {
|
||||
* @see com.foxinmy.weixin4j.type.MediaType
|
||||
* @see {@link #downloadMedia(int,String)}
|
||||
*/
|
||||
public File downloadMediaFile(int agentid, String mediaId) throws WeixinException {
|
||||
public File downloadMediaFile(int agentid, String mediaId)
|
||||
throws WeixinException {
|
||||
return mediaApi.downloadMediaFile(agentid, mediaId);
|
||||
}
|
||||
|
||||
@ -278,7 +290,8 @@ public class WeixinProxy {
|
||||
* 获取永久媒体说明</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public MediaDownloadResult downloadMedia(int agentid, String mediaId) throws WeixinException {
|
||||
public MediaDownloadResult downloadMedia(int agentid, String mediaId)
|
||||
throws WeixinException {
|
||||
return mediaApi.downloadMedia(agentid, mediaId);
|
||||
}
|
||||
|
||||
@ -301,7 +314,8 @@ public class WeixinProxy {
|
||||
* 上传永久媒体素材</a>
|
||||
* @see com.foxinmy.weixin4j.tuple.MpArticle
|
||||
*/
|
||||
public String uploadMaterialArticle(int agentid, List<MpArticle> articles) throws WeixinException {
|
||||
public String uploadMaterialArticle(int agentid, List<MpArticle> articles)
|
||||
throws WeixinException {
|
||||
return mediaApi.uploadMaterialArticle(agentid, articles);
|
||||
}
|
||||
|
||||
@ -319,7 +333,8 @@ public class WeixinProxy {
|
||||
* "http://qydev.weixin.qq.com/wiki/index.php?title=%E5%88%A0%E9%99%A4%E6%B0%B8%E4%B9%85%E7%B4%A0%E6%9D%90">
|
||||
* 删除永久媒体素材</a>
|
||||
*/
|
||||
public JsonResult deleteMaterialMedia(int agentid, String mediaId) throws WeixinException {
|
||||
public JsonResult deleteMaterialMedia(int agentid, String mediaId)
|
||||
throws WeixinException {
|
||||
return mediaApi.deleteMaterialMedia(agentid, mediaId);
|
||||
}
|
||||
|
||||
@ -336,7 +351,8 @@ public class WeixinProxy {
|
||||
* @see com.foxinmy.weixin4j.qy.api.MediaApi
|
||||
* @see com.foxinmy.weixin4j.tuple.MpArticle
|
||||
*/
|
||||
public List<MpArticle> downloadArticle(int agentid, String mediaId) throws WeixinException {
|
||||
public List<MpArticle> downloadArticle(int agentid, String mediaId)
|
||||
throws WeixinException {
|
||||
return mediaApi.downloadArticle(agentid, mediaId);
|
||||
}
|
||||
|
||||
@ -357,7 +373,8 @@ public class WeixinProxy {
|
||||
* 修改永久媒体素材</a>
|
||||
* @see com.foxinmy.weixin4j.tuple.MpArticle
|
||||
*/
|
||||
public String updateMaterialArticle(int agentid, String mediaId, List<MpArticle> articles) throws WeixinException {
|
||||
public String updateMaterialArticle(int agentid, String mediaId,
|
||||
List<MpArticle> articles) throws WeixinException {
|
||||
return mediaApi.updateMaterialArticle(agentid, mediaId, articles);
|
||||
}
|
||||
|
||||
@ -399,7 +416,8 @@ public class WeixinProxy {
|
||||
* "http://qydev.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E7%B4%A0%E6%9D%90%E5%88%97%E8%A1%A8">
|
||||
* 获取素材列表</a>
|
||||
*/
|
||||
public MediaRecord listMaterialMedia(int agentid, MediaType mediaType, Pageable pageable) throws WeixinException {
|
||||
public MediaRecord listMaterialMedia(int agentid, MediaType mediaType,
|
||||
Pageable pageable) throws WeixinException {
|
||||
return mediaApi.listMaterialMedia(agentid, mediaType, pageable);
|
||||
}
|
||||
|
||||
@ -415,7 +433,8 @@ public class WeixinProxy {
|
||||
* @see {@link #listMaterialMedia(int,MediaType, Pageable)}
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<MediaItem> listAllMaterialMedia(int agentid, MediaType mediaType) throws WeixinException {
|
||||
public List<MediaItem> listAllMaterialMedia(int agentid, MediaType mediaType)
|
||||
throws WeixinException {
|
||||
return mediaApi.listAllMaterialMedia(agentid, mediaType);
|
||||
}
|
||||
|
||||
@ -500,7 +519,8 @@ public class WeixinProxy {
|
||||
* @return 上传后的mediaId
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String batchUploadParties(List<Party> parties) throws WeixinException {
|
||||
public String batchUploadParties(List<Party> parties)
|
||||
throws WeixinException {
|
||||
return mediaApi.batchUploadParties(parties);
|
||||
}
|
||||
|
||||
@ -536,7 +556,8 @@ public class WeixinProxy {
|
||||
* @return 处理结果
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public JsonResult createUser(User user, InputStream avatar) throws WeixinException {
|
||||
public JsonResult createUser(User user, InputStream avatar)
|
||||
throws WeixinException {
|
||||
return userApi.createUser(user, avatar);
|
||||
}
|
||||
|
||||
@ -572,7 +593,8 @@ public class WeixinProxy {
|
||||
* @return 处理结果
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public JsonResult updateUser(User user, InputStream avatar) throws WeixinException {
|
||||
public JsonResult updateUser(User user, InputStream avatar)
|
||||
throws WeixinException {
|
||||
return userApi.updateUser(user, avatar);
|
||||
}
|
||||
|
||||
@ -643,7 +665,7 @@ public class WeixinProxy {
|
||||
* @param fetchChild
|
||||
* 是否递归获取子部门下面的成员 非必须
|
||||
* @param userStatus
|
||||
* 成员状态 status可叠加 非必须 未填写则默认为未关注(4)
|
||||
* 成员状态 status可叠加 非必须 未填写则默认为未关注(4)
|
||||
* @param findDetail
|
||||
* 是否获取详细信息
|
||||
* @see com.foxinmy.weixin4j.qy.model.User
|
||||
@ -654,8 +676,8 @@ public class WeixinProxy {
|
||||
* @return 成员列表
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<User> listUser(int departId, boolean fetchChild, UserStatus userStatus, boolean findDetail)
|
||||
throws WeixinException {
|
||||
public List<User> listUser(int departId, boolean fetchChild,
|
||||
UserStatus userStatus, boolean findDetail) throws WeixinException {
|
||||
return userApi.listUser(departId, fetchChild, userStatus, findDetail);
|
||||
}
|
||||
|
||||
@ -701,7 +723,8 @@ public class WeixinProxy {
|
||||
* @return 处理结果
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public JsonResult batchDeleteUser(List<String> userIds) throws WeixinException {
|
||||
public JsonResult batchDeleteUser(List<String> userIds)
|
||||
throws WeixinException {
|
||||
return userApi.batchDeleteUser(userIds);
|
||||
}
|
||||
|
||||
@ -719,7 +742,8 @@ public class WeixinProxy {
|
||||
* 邀请成员关注说明</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public InviteType inviteUser(String userId, String tips) throws WeixinException {
|
||||
public InviteType inviteUser(String userId, String tips)
|
||||
throws WeixinException {
|
||||
return userApi.inviteUser(userId, tips);
|
||||
}
|
||||
|
||||
@ -727,9 +751,8 @@ public class WeixinProxy {
|
||||
* 创建标签(创建的标签属于管理组;默认为未加锁状态)
|
||||
*
|
||||
* @param tag
|
||||
* 标签对象;</br>
|
||||
* 标签名称,长度为1~64个字节,标签名不可与其他标签重名;</br>
|
||||
* 标签id,整型, 指定此参数时新增的标签会生成对应的标签id,不指定时则以目前最大的id自增。
|
||||
* 标签对象;</br> 标签名称,长度为1~64个字节,标签名不可与其他标签重名;</br> 标签id,整型,
|
||||
* 指定此参数时新增的标签会生成对应的标签id,不指定时则以目前最大的id自增。
|
||||
* @see <a href=
|
||||
* "http://qydev.weixin.qq.com/wiki/index.php?title=%E7%AE%A1%E7%90%86%E6%A0%87%E7%AD%BE#.E5.88.9B.E5.BB.BA.E6.A0.87.E7.AD.BE">
|
||||
* 创建标签说明</a>
|
||||
@ -823,7 +846,8 @@ public class WeixinProxy {
|
||||
* @return 处理结果
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public JsonResult addTagUsers(int tagId, List<String> userIds, List<Integer> partyIds) throws WeixinException {
|
||||
public JsonResult addTagUsers(int tagId, List<String> userIds,
|
||||
List<Integer> partyIds) throws WeixinException {
|
||||
return tagApi.addTagUsers(tagId, userIds, partyIds);
|
||||
}
|
||||
|
||||
@ -844,7 +868,8 @@ public class WeixinProxy {
|
||||
* @return 处理结果
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public JsonResult deleteTagUsers(int tagId, List<String> userIds, List<Integer> partyIds) throws WeixinException {
|
||||
public JsonResult deleteTagUsers(int tagId, List<String> userIds,
|
||||
List<Integer> partyIds) throws WeixinException {
|
||||
return tagApi.deleteTagUsers(tagId, userIds, partyIds);
|
||||
}
|
||||
|
||||
@ -929,7 +954,8 @@ public class WeixinProxy {
|
||||
* 邀请成员关注</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String batchInviteUser(IdParameter parameter, Callback callback, String tips) throws WeixinException {
|
||||
public String batchInviteUser(IdParameter parameter, Callback callback,
|
||||
String tips) throws WeixinException {
|
||||
return batchApi.inviteUser(parameter, callback, tips);
|
||||
}
|
||||
|
||||
@ -937,8 +963,7 @@ public class WeixinProxy {
|
||||
* 批量更新成员,本接口以userid为主键,增量更新企业号通讯录成员。
|
||||
* <p>
|
||||
* 1.模板中的部门需填写部门ID,多个部门用分号分隔,部门ID必须为数字</br>
|
||||
* 2.文件中存在、通讯录中也存在的成员,更新成员在文件中指定的字段值 </br>
|
||||
* 3.文件中存在、通讯录中不存在的成员,执行添加操作</br>
|
||||
* 2.文件中存在、通讯录中也存在的成员,更新成员在文件中指定的字段值 </br> 3.文件中存在、通讯录中不存在的成员,执行添加操作</br>
|
||||
* 4.通讯录中存在、文件中不存在的成员,保持不变</br>
|
||||
* </p>
|
||||
*
|
||||
@ -954,15 +979,15 @@ public class WeixinProxy {
|
||||
* 批量更新成员</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String batchSyncUser(String mediaId, Callback callback) throws WeixinException {
|
||||
public String batchSyncUser(String mediaId, Callback callback)
|
||||
throws WeixinException {
|
||||
return batchApi.syncUser(mediaId, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量覆盖成员,本接口以userid为主键,全量覆盖企业号通讯录成员,任务完成后企业号通讯录成员与提交的文件完全保持一致。
|
||||
* <p>
|
||||
* 1.模板中的部门需填写部门ID,多个部门用分号分隔,部门ID必须为数字</br>
|
||||
* 2.文件中存在、通讯录中也存在的成员,完全以文件为准</br>
|
||||
* 1.模板中的部门需填写部门ID,多个部门用分号分隔,部门ID必须为数字</br> 2.文件中存在、通讯录中也存在的成员,完全以文件为准</br>
|
||||
* 3.文件中存在、通讯录中不存在的成员,执行添加操作</br>
|
||||
* 4.通讯录中存在、文件中不存在的成员,执行删除操作。出于安全考虑,如果需要删除的成员多于50人,
|
||||
* 且多于现有人数的20%以上,系统将中止导入并返回相应的错误码
|
||||
@ -980,7 +1005,8 @@ public class WeixinProxy {
|
||||
* 批量覆盖成员</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String batchReplaceUser(String mediaId, Callback callback) throws WeixinException {
|
||||
public String batchReplaceUser(String mediaId, Callback callback)
|
||||
throws WeixinException {
|
||||
return batchApi.replaceUser(mediaId, callback);
|
||||
}
|
||||
|
||||
@ -1006,8 +1032,7 @@ public class WeixinProxy {
|
||||
/**
|
||||
* 批量覆盖部门,本接口以partyid为键,全量覆盖企业号通讯录组织架构,任务完成后企业号通讯录组织架构与提交的文件完全保持一致。
|
||||
* <p>
|
||||
* 1.文件中存在、通讯录中也存在的部门,执行修改操作</br>
|
||||
* 2.文件中存在、通讯录中不存在的部门,执行添加操作</br>
|
||||
* 1.文件中存在、通讯录中也存在的部门,执行修改操作</br> 2.文件中存在、通讯录中不存在的部门,执行添加操作</br>
|
||||
* 3.文件中不存在、通讯录中存在的部门,当部门为空时,执行删除操作</br>
|
||||
* 4.CSV文件中,部门名称、部门ID、父部门ID为必填字段,部门ID必须为数字;排序为可选字段,置空或填0不修改排序
|
||||
* </p>
|
||||
@ -1024,7 +1049,8 @@ public class WeixinProxy {
|
||||
* 批量覆盖部门</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String batchReplaceParty(String mediaId, Callback callback) throws WeixinException {
|
||||
public String batchReplaceParty(String mediaId, Callback callback)
|
||||
throws WeixinException {
|
||||
return batchApi.replaceParty(mediaId, callback);
|
||||
}
|
||||
|
||||
@ -1060,7 +1086,8 @@ public class WeixinProxy {
|
||||
* "http://qydev.weixin.qq.com/wiki/index.php?title=Userid%E4%B8%8Eopenid%E4%BA%92%E6%8D%A2%E6%8E%A5%E5%8F%A3">
|
||||
* userid转换成openid</a>
|
||||
*/
|
||||
public String[] userid2openid(String userid, int agentid) throws WeixinException {
|
||||
public String[] userid2openid(String userid, int agentid)
|
||||
throws WeixinException {
|
||||
return userApi.userid2openid(userid, agentid);
|
||||
}
|
||||
|
||||
@ -1134,7 +1161,8 @@ public class WeixinProxy {
|
||||
* 修改会话信息</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public JsonResult updateChat(ChatInfo chatInfo, String operator, List<String> addUsers, List<String> deleteUsers)
|
||||
public JsonResult updateChat(ChatInfo chatInfo, String operator,
|
||||
List<String> addUsers, List<String> deleteUsers)
|
||||
throws WeixinException {
|
||||
return chatApi.updateChat(chatInfo, operator, addUsers, deleteUsers);
|
||||
}
|
||||
@ -1153,7 +1181,8 @@ public class WeixinProxy {
|
||||
* 退出会话</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public JsonResult quitChat(String chatId, String operator) throws WeixinException {
|
||||
public JsonResult quitChat(String chatId, String operator)
|
||||
throws WeixinException {
|
||||
return chatApi.quitChat(chatId, operator);
|
||||
}
|
||||
|
||||
@ -1173,7 +1202,8 @@ public class WeixinProxy {
|
||||
* 清除会话未读状态</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public JsonResult clearChatNotify(String targetId, String owner, ChatType chatType) throws WeixinException {
|
||||
public JsonResult clearChatNotify(String targetId, String owner,
|
||||
ChatType chatType) throws WeixinException {
|
||||
return chatApi.clearChatNotify(targetId, owner, chatType);
|
||||
}
|
||||
|
||||
@ -1191,7 +1221,8 @@ public class WeixinProxy {
|
||||
* @return 列表中不存在的成员,剩余合法成员会继续执行。
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<String> setChatMute(List<ChatMute> chatMutes) throws WeixinException {
|
||||
public List<String> setChatMute(List<ChatMute> chatMutes)
|
||||
throws WeixinException {
|
||||
return chatApi.setChatMute(chatMutes);
|
||||
}
|
||||
|
||||
@ -1208,9 +1239,10 @@ public class WeixinProxy {
|
||||
* 发送消息</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public JsonResult sendChatMessage(ChatMessage message) throws WeixinException {
|
||||
public JsonResult sendChatMessage(ChatMessage message)
|
||||
throws WeixinException {
|
||||
return chatApi.sendChatMessage(message);
|
||||
}
|
||||
|
||||
public final static String VERSION = "1.6.1";
|
||||
public final static String VERSION = "1.6.2";
|
||||
}
|
||||
|
||||
@ -91,5 +91,5 @@ public class WeixinSuiteProxy {
|
||||
return this.suiteMap.get(suiteId);
|
||||
}
|
||||
|
||||
public final static String VERSION = "1.6.1";
|
||||
public final static String VERSION = "1.6.2";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user