mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 18:46:10 +08:00 
			
		
		
		
	修改WxCpMessage中agentId的数据类型, String-> Integer
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -26,6 +26,7 @@ test-config.xml | ||||
| /gradle/ | ||||
| *.bat | ||||
| /gradlew | ||||
| **/build/ | ||||
|  | ||||
| # OSX | ||||
| # Icon must end with two \r | ||||
|  | ||||
| @ -45,7 +45,7 @@ public interface WxCpConfigStorage { | ||||
|  | ||||
|   String getCorpSecret(); | ||||
|  | ||||
|   String getAgentId(); | ||||
|   Integer getAgentId(); | ||||
|  | ||||
|   String getToken(); | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ public class WxCpInMemoryConfigStorage implements WxCpConfigStorage { | ||||
|   protected volatile String token; | ||||
|   protected volatile String accessToken; | ||||
|   protected volatile String aesKey; | ||||
|   protected volatile String agentId; | ||||
|   protected volatile Integer agentId; | ||||
|   protected volatile long expiresTime; | ||||
|  | ||||
|   protected volatile String oauth2redirectUri; | ||||
| @ -146,11 +146,11 @@ public class WxCpInMemoryConfigStorage implements WxCpConfigStorage { | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public String getAgentId() { | ||||
|   public Integer getAgentId() { | ||||
|     return this.agentId; | ||||
|   } | ||||
|  | ||||
|   public void setAgentId(String agentId) { | ||||
|   public void setAgentId(Integer agentId) { | ||||
|     this.agentId = agentId; | ||||
|   } | ||||
|  | ||||
|  | ||||
| @ -25,7 +25,7 @@ public class WxCpJedisConfigStorage implements WxCpConfigStorage { | ||||
|  | ||||
| 	private volatile String token; | ||||
| 	private volatile String aesKey; | ||||
| 	private volatile String agentId; | ||||
| 	private volatile Integer agentId; | ||||
|  | ||||
| 	private volatile String oauth2redirectUri; | ||||
|  | ||||
| @ -150,7 +150,7 @@ public class WxCpJedisConfigStorage implements WxCpConfigStorage { | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public String getAgentId() { | ||||
| 	public Integer getAgentId() { | ||||
| 		return this.agentId; | ||||
| 	} | ||||
|  | ||||
| @ -230,7 +230,7 @@ public class WxCpJedisConfigStorage implements WxCpConfigStorage { | ||||
| 		this.aesKey = aesKey; | ||||
| 	} | ||||
|  | ||||
| 	public void setAgentId(String agentId) { | ||||
| 	public void setAgentId(Integer agentId) { | ||||
| 		this.agentId = agentId; | ||||
| 	} | ||||
|  | ||||
|  | ||||
| @ -160,7 +160,7 @@ public interface WxCpService { | ||||
|    * | ||||
|    * @param menu | ||||
|    * @throws WxErrorException | ||||
|    * @see #menuCreate(String, me.chanjar.weixin.common.bean.menu.WxMenu) | ||||
|    * @see #menuCreate(Integer, WxMenu) | ||||
|    */ | ||||
|   void menuCreate(WxMenu menu) throws WxErrorException; | ||||
|  | ||||
| @ -177,7 +177,7 @@ public interface WxCpService { | ||||
|    * @throws WxErrorException | ||||
|    * @see #menuCreate(me.chanjar.weixin.common.bean.menu.WxMenu) | ||||
|    */ | ||||
|   void menuCreate(String agentId, WxMenu menu) throws WxErrorException; | ||||
|   void menuCreate(Integer agentId, WxMenu menu) throws WxErrorException; | ||||
|  | ||||
|   /** | ||||
|    * <pre> | ||||
| @ -188,7 +188,7 @@ public interface WxCpService { | ||||
|    * </pre> | ||||
|    * | ||||
|    * @throws WxErrorException | ||||
|    * @see #menuDelete(String) | ||||
|    * @see #menuDelete(Integer) | ||||
|    */ | ||||
|   void menuDelete() throws WxErrorException; | ||||
|  | ||||
| @ -204,7 +204,7 @@ public interface WxCpService { | ||||
|    * @throws WxErrorException | ||||
|    * @see #menuDelete() | ||||
|    */ | ||||
|   void menuDelete(String agentId) throws WxErrorException; | ||||
|   void menuDelete(Integer agentId) throws WxErrorException; | ||||
|  | ||||
|   /** | ||||
|    * <pre> | ||||
| @ -215,7 +215,7 @@ public interface WxCpService { | ||||
|    * </pre> | ||||
|    * | ||||
|    * @throws WxErrorException | ||||
|    * @see #menuGet(String) | ||||
|    * @see #menuGet(Integer) | ||||
|    */ | ||||
|   WxMenu menuGet() throws WxErrorException; | ||||
|  | ||||
| @ -231,7 +231,7 @@ public interface WxCpService { | ||||
|    * @throws WxErrorException | ||||
|    * @see #menuGet() | ||||
|    */ | ||||
|   WxMenu menuGet(String agentId) throws WxErrorException; | ||||
|   WxMenu menuGet(Integer agentId) throws WxErrorException; | ||||
|  | ||||
|   /** | ||||
|    * <pre> | ||||
| @ -425,7 +425,7 @@ public interface WxCpService { | ||||
|    * | ||||
|    * @param code | ||||
|    * @return [userid, deviceid] | ||||
|    * @see #oauth2getUserInfo(String, String) | ||||
|    * @see #oauth2getUserInfo(Integer, String) | ||||
|    */ | ||||
|   String[] oauth2getUserInfo(String code) throws WxErrorException; | ||||
|  | ||||
| @ -443,7 +443,7 @@ public interface WxCpService { | ||||
|    * @return [userid, deviceid] | ||||
|    * @see #oauth2getUserInfo(String) | ||||
|    */ | ||||
|   String[] oauth2getUserInfo(String agentId, String code) throws WxErrorException; | ||||
|   String[] oauth2getUserInfo(Integer agentId, String code) throws WxErrorException; | ||||
|  | ||||
|  | ||||
|   /** | ||||
|  | ||||
| @ -191,7 +191,7 @@ public class WxCpServiceImpl implements WxCpService { | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public void menuCreate(String agentId, WxMenu menu) throws WxErrorException { | ||||
|   public void menuCreate(Integer agentId, WxMenu menu) throws WxErrorException { | ||||
|     String url = "https://qyapi.weixin.qq.com/cgi-bin/menu/create?agentid=" | ||||
|  + this.configStorage.getAgentId(); | ||||
|     post(url, menu.toJson()); | ||||
| @ -203,7 +203,7 @@ public class WxCpServiceImpl implements WxCpService { | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public void menuDelete(String agentId) throws WxErrorException { | ||||
|   public void menuDelete(Integer agentId) throws WxErrorException { | ||||
|     String url = "https://qyapi.weixin.qq.com/cgi-bin/menu/delete?agentid=" + agentId; | ||||
|     get(url, null); | ||||
|   } | ||||
| @ -214,7 +214,7 @@ public class WxCpServiceImpl implements WxCpService { | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public WxMenu menuGet(String agentId) throws WxErrorException { | ||||
|   public WxMenu menuGet(Integer agentId) throws WxErrorException { | ||||
|     String url = "https://qyapi.weixin.qq.com/cgi-bin/menu/get?agentid=" + agentId; | ||||
|     try { | ||||
|       String resultContent = get(url, null); | ||||
| @ -487,7 +487,7 @@ this.configStorage.getOauth2redirectUri(), | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public String[] oauth2getUserInfo(String agentId, String code) throws WxErrorException { | ||||
|   public String[] oauth2getUserInfo(Integer agentId, String code) throws WxErrorException { | ||||
|     String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?" | ||||
|             + "code=" + code | ||||
|             + "&agentid=" + agentId; | ||||
|  | ||||
| @ -1,17 +1,12 @@ | ||||
| package me.chanjar.weixin.cp.bean; | ||||
|  | ||||
| import me.chanjar.weixin.cp.bean.messagebuilder.*; | ||||
| import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||||
|  | ||||
| import java.io.Serializable; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| import me.chanjar.weixin.cp.bean.messagebuilder.FileBuilder; | ||||
| import me.chanjar.weixin.cp.bean.messagebuilder.ImageBuilder; | ||||
| import me.chanjar.weixin.cp.bean.messagebuilder.NewsBuilder; | ||||
| import me.chanjar.weixin.cp.bean.messagebuilder.TextBuilder; | ||||
| import me.chanjar.weixin.cp.bean.messagebuilder.VideoBuilder; | ||||
| import me.chanjar.weixin.cp.bean.messagebuilder.VoiceBuilder; | ||||
| import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||||
|  | ||||
| /** | ||||
|  * 消息 | ||||
|  * | ||||
| @ -23,7 +18,7 @@ public class WxCpMessage implements Serializable { | ||||
|   private String toUser; | ||||
|   private String toParty; | ||||
|   private String toTag; | ||||
|   private String agentId; | ||||
|   private Integer agentId; | ||||
|   private String msgType; | ||||
|   private String content; | ||||
|   private String mediaId; | ||||
| @ -101,11 +96,11 @@ public class WxCpMessage implements Serializable { | ||||
|     this.toTag = toTag; | ||||
|   } | ||||
|  | ||||
|   public String getAgentId() { | ||||
|   public Integer getAgentId() { | ||||
|     return this.agentId; | ||||
|   } | ||||
|  | ||||
|   public void setAgentId(String agentId) { | ||||
|   public void setAgentId(Integer agentId) { | ||||
|     this.agentId = agentId; | ||||
|   } | ||||
|  | ||||
|  | ||||
| @ -5,13 +5,13 @@ import me.chanjar.weixin.cp.bean.WxCpMessage; | ||||
|  | ||||
| public class BaseBuilder<T> { | ||||
|   protected String msgType; | ||||
|   protected String agentId; | ||||
|   protected Integer agentId; | ||||
|   protected String toUser; | ||||
|   protected String toParty; | ||||
|   protected String toTag; | ||||
|   protected String safe; | ||||
|  | ||||
|   public T agentId(String agentId) { | ||||
|   public T agentId(Integer agentId) { | ||||
|     this.agentId = agentId; | ||||
|     return (T) this; | ||||
|   } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 cty
					cty