Skip to content

Commit

Permalink
#477 企业号接口重构,分类管理
Browse files Browse the repository at this point in the history
  • Loading branch information
binarywang committed Mar 3, 2018
1 parent 20e174e commit 2058623
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 413 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

/**
* 微信API的Service
* @author chanjaster
*/
public interface WxCpService {

/**
* <pre>
* 验证推送过来的消息的正确性
Expand Down Expand Up @@ -85,42 +85,6 @@ public interface WxCpService {
*/
WxJsapiSignature createJsapiSignature(String url) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpMenuService#create(WxMenu)}
*/
@Deprecated
void menuCreate(WxMenu menu) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpMenuService#create(Integer, WxMenu)}
*/
@Deprecated
void menuCreate(Integer agentId, WxMenu menu) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpMenuService#delete()} }
*/
@Deprecated
void menuDelete() throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpMenuService#delete(Integer)}
*/
@Deprecated
void menuDelete(Integer agentId) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpMenuService#get() }
*/
@Deprecated
WxMenu menuGet() throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpMenuService#get(Integer)}
*/
@Deprecated
WxMenu menuGet(Integer agentId) throws WxErrorException;

/**
* <pre>
* 发送消息
Expand All @@ -131,175 +95,6 @@ public interface WxCpService {
*/
WxCpMessageSendResult messageSend(WxCpMessage message) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpDepartmentService#create(WxCpDepart)}
*/
@Deprecated
Integer departCreate(WxCpDepart depart) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpDepartmentService#update(WxCpDepart)}
*/
@Deprecated
void departUpdate(WxCpDepart group) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpDepartmentService#delete(Integer)}
*/
@Deprecated
void departDelete(Integer departId) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpDepartmentService#listAll() }
*/
@Deprecated
List<WxCpDepart> departGet() throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpMediaService#upload(String, String, InputStream)}
*/
@Deprecated
WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream inputStream)
throws WxErrorException, IOException;

/**
* @deprecated 请使用 {@link WxCpMediaService#upload(String, File)}
*/
@Deprecated
WxMediaUploadResult mediaUpload(String mediaType, File file) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpMediaService#download(String)}
*/
@Deprecated
File mediaDownload(String mediaId) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpUserService#authenticate(String)}
*/
@Deprecated
void userAuthenticated(String userId) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpUserService#create(WxCpUser)}
*/
@Deprecated
void userCreate(WxCpUser user) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpUserService#update(WxCpUser)}
*/
@Deprecated
void userUpdate(WxCpUser user) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpUserService#delete(String...)}
*/
@Deprecated
void userDelete(String userid) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpUserService#delete(String...)}
*/
@Deprecated
void userDelete(String[] userids) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpUserService#getById(String)}
*/
@Deprecated
WxCpUser userGet(String userid) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpUserService#listByDepartment(Integer, Boolean, Integer)}
*/
@Deprecated
List<WxCpUser> userList(Integer departId, Boolean fetchChild, Integer status) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpUserService#listSimpleByDepartment(Integer, Boolean, Integer)}
*/
@Deprecated
List<WxCpUser> departGetUsers(Integer departId, Boolean fetchChild, Integer status) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpTagService#create(String)}
*/
@Deprecated
String tagCreate(String tagName) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpTagService#update(String, String)}
*/
@Deprecated
void tagUpdate(String tagId, String tagName) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpTagService#delete(String)}
*/
@Deprecated
void tagDelete(String tagId) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpTagService#listAll()}
*/
@Deprecated
List<WxCpTag> tagGet() throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpTagService#listUsersByTagId(String)}
*/
@Deprecated
List<WxCpUser> tagGetUsers(String tagId) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpTagService#addUsers2Tag(String, List, List)}
*/
@Deprecated
void tagAddUsers(String tagId, List<String> userIds, List<String> partyIds) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpTagService#removeUsersFromTag(String, List)}
*/
@Deprecated
void tagRemoveUsers(String tagId, List<String> userIds) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpOAuth2Service#buildAuthorizationUrl(String)}
*/
@Deprecated
String oauth2buildAuthorizationUrl(String state);

/**
* @deprecated 请使用 {@link WxCpOAuth2Service#buildAuthorizationUrl(String, String)}
*/
@Deprecated
String oauth2buildAuthorizationUrl(String redirectUri, String state);

/**
* @deprecated 请使用 {@link WxCpOAuth2Service#getUserInfo(String)}
*/
@Deprecated
String[] oauth2getUserInfo(String code) throws WxErrorException;

/**
* @deprecated 请使用 {@link WxCpOAuth2Service#getUserInfo(Integer, String)}
*/
@Deprecated
String[] oauth2getUserInfo(Integer agentId, String code) throws WxErrorException;

/**
* <pre>
* 邀请成员关注
* http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E9.82.80.E8.AF.B7.E6.88.90.E5.91.98.E5.85.B3.E6.B3.A8
* </pre>
*
* @param userId 用户的userid
* @param inviteTips 推送到微信上的提示语(只有认证号可以使用)。当使用微信推送时,该字段默认为“请关注XXX企业号”,邮件邀请时,该字段无效。
* @return 1:微信邀请 2.邮件邀请
*/
int invite(String userId, String inviteTips) throws WxErrorException;

/**
* <pre>
* 获取微信服务器的ip段
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,16 @@ public interface WxCpUserService {
* @param userid 用户id
*/
WxCpUser getById(String userid) throws WxErrorException;

/**
* <pre>
* 邀请成员关注
* http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E9.82.80.E8.AF.B7.E6.88.90.E5.91.98.E5.85.B3.E6.B3.A8
* </pre>
*
* @param userId 用户的userid
* @param inviteTips 推送到微信上的提示语(只有认证号可以使用)。当使用微信推送时,该字段默认为“请关注XXX企业号”,邮件邀请时,该字段无效。
* @return 1:微信邀请 2.邮件邀请
*/
int invite(String userId, String inviteTips) throws WxErrorException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public String buildAuthorizationUrl(String redirectUri, String state) {

@Override
public String[] getUserInfo(String code) throws WxErrorException {
return getUserInfo(this.mainService.getWxCpConfigStorage().getAgentId(), code);
return this.getUserInfo(this.mainService.getWxCpConfigStorage().getAgentId(), code);
}

@Override
Expand Down
Loading

0 comments on commit 2058623

Please sign in to comment.