repo
stringclasses
1k values
file_url
stringlengths
96
373
file_path
stringlengths
11
294
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
6 values
commit_sha
stringclasses
1k values
retrieved_at
stringdate
2026-01-04 14:45:56
2026-01-04 18:30:23
truncated
bool
2 classes
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/wxbase/wxmedia/model/WxDescription.java
src/main/java/org/jeewx/api/wxbase/wxmedia/model/WxDescription.java
package org.jeewx.api.wxbase.wxmedia.model; /** * 图文消息 * @author lihongxuan * */ public class WxDescription { /** 视频素材的标题*/ private String title; /** 视频素材的描述 */ private String introduction; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getIntroduction() { return introduction; } public void setIntroduction(String introduction) { this.introduction = introduction; } @Override public String toString() { return "WxDescription [title=" + title + ", introduction=" + introduction + "]"; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/wxbase/wxmedia/model/WxUpdateArticle.java
src/main/java/org/jeewx/api/wxbase/wxmedia/model/WxUpdateArticle.java
package org.jeewx.api.wxbase.wxmedia.model; import org.jeewx.api.wxsendmsg.model.WxArticle; /** * 修改消息素材 * @author lihongxuan * */ public class WxUpdateArticle { private String media_id; private int index; //-- update-begin--Author:gengjiajia Date:2016-11-28 for:TASK #1583 【图文管理】 //原字段名称不符合微信接口条件 //private WxArticle article = new WxArticle(); private WxArticle articles = new WxArticle(); //-- update-end--Author:gengjiajia Date:2016-11-28 for:TASK #1583 【图文管理】 public String getMedia_id() { return media_id; } public void setMedia_id(String media_id) { this.media_id = media_id; } public int getIndex() { return index; } public void setIndex(int index) { this.index = index; } /*public WxArticle getArticle() { return article; } public void setArticle(WxArticle article) { this.article = article; } */ /*@Override public String toString() { return "WxArticlesRequest [media_id=" + media_id +"index=" + index +"article=" + article + "]"; }*/ public WxArticle getArticles() { return articles; } public void setArticles(WxArticle articles) { this.articles = articles; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("WxUpdateArticle [media_id="); builder.append(media_id); builder.append(", index="); builder.append(index); builder.append(", articles="); builder.append(articles); builder.append("]"); return builder.toString(); } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/wxbase/wxmedia/model/WxUpload.java
src/main/java/org/jeewx/api/wxbase/wxmedia/model/WxUpload.java
package org.jeewx.api.wxbase.wxmedia.model; /** * 微信多媒体文件 * @author sfli.sir * */ public class WxUpload { private String type; private String media_id; private String created_at; public String getType() { return type; } public void setType(String type) { this.type = type; } public String getMedia_id() { return media_id; } public void setMedia_id(String media_id) { this.media_id = media_id; } public String getCreated_at() { return created_at; } public void setCreated_at(String created_at) { this.created_at = created_at; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/interfacesummary/JwInterfaceSummaryAPI.java
src/main/java/org/jeewx/api/report/interfacesummary/JwInterfaceSummaryAPI.java
package org.jeewx.api.report.interfacesummary; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.jeewx.api.core.common.AccessToken; import org.jeewx.api.core.common.JSONHelper; import org.jeewx.api.core.common.WxstoreUtils; import org.jeewx.api.core.req.model.interfacesummary.InterfaceSummaryParam; import org.jeewx.api.report.interfacesummary.model.InterfaceSummary; import org.jeewx.api.report.interfacesummary.model.InterfaceSummaryHour; import java.util.List; /** * 接口分析数据接口 * @author qimiao * */ public class JwInterfaceSummaryAPI { //获取接口分析数据 private static String getinterfacesummary_url = "https://api.weixin.qq.com/datacube/getinterfacesummary?access_token=ACCESS_TOKEN"; //获取接口分析分时数据 private static String getinterfacesummaryhour_url = "https://api.weixin.qq.com/datacube/getinterfacesummaryhour?access_token=ACCESS_TOKEN"; /** * 获取接口分析分时数据 * @param begin_date end_date * @return */ public static List<InterfaceSummaryHour> getInterfaceSummaryHour(String accesstoken,InterfaceSummaryParam param) { if (accesstoken != null) { param.setAccess_token(accesstoken); String requestUrl = getinterfacesummaryhour_url.replace("ACCESS_TOKEN", accesstoken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(param)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "GET", obj.toString()); // 正常返回 List<InterfaceSummaryHour> list = null; JSONArray info = result.getJSONArray("list"); list = JSONHelper.toList(info, InterfaceSummaryHour.class); return list; } return null; } /** * 获取接口分析数据 * @param begin_date end_date * @return */ public static List<InterfaceSummary> getInterfaceSummary(String accesstoken,InterfaceSummaryParam param) { if (accesstoken != null) { param.setAccess_token(accesstoken); String requestUrl = getinterfacesummary_url.replace("ACCESS_TOKEN", accesstoken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(param)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "GET", obj.toString()); // 正常返回 List<InterfaceSummary> list = null; JSONArray info = result.getJSONArray("list"); list = JSONHelper.toList(info, InterfaceSummary.class); return list; } return null; } public static void main(String[] args) { //getNewAccessToken("wx00737224cb9dbc7d","b9479ebdb58d1c6b6efd4171ebe718b5"); JwInterfaceSummaryAPI s = new JwInterfaceSummaryAPI(); InterfaceSummaryParam param=new InterfaceSummaryParam(); param.setBegin_date("2015-01-01"); param.setEnd_date("2015-01-01"); //List<InterfaceSummary> list = s.getInterfaceSummary(param); List<InterfaceSummaryHour> list = s.getInterfaceSummaryHour("a8UEhkxmxN269afPJ7SuY9vVroHPYiwm9Yv5gu_yK4GGsA60IafJ3N9We4ubabgZ4lsl4kd0zqcH7JC70UsQ951Ndur4ejSIz7VvroBJn4g",param); for (InterfaceSummaryHour bean : list) { System.out.println(bean.getRef_date()); System.out.println(bean.getRef_hour()); System.out.println(bean.getTotal_time_cost()); } } private static void getNewAccessToken(String appid,String appscret){ AccessToken atoken = new AccessToken(appid, appscret); String newAccessToken = atoken.getNewAccessToken(); System.out.println(newAccessToken); } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/interfacesummary/model/InterfaceSummaryHour.java
src/main/java/org/jeewx/api/report/interfacesummary/model/InterfaceSummaryHour.java
package org.jeewx.api.report.interfacesummary.model; public class InterfaceSummaryHour { // 数据的日期 private String ref_date; // 数据的小时 private Integer ref_hour; // 通过服务器配置地址获得消息后,被动回复用户消息的次数 private Integer callback_count; // 上述动作的失败次数 private Integer fail_count; // 总耗时,除以callback_count即为平均耗时 private Integer total_time_cost; // 最大耗时 private Integer max_time_cost; public String getRef_date() { return ref_date; } public void setRef_date(String ref_date) { this.ref_date = ref_date; } public Integer getRef_hour() { return ref_hour; } public void setRef_hour(Integer ref_hour) { this.ref_hour = ref_hour; } public Integer getCallback_count() { return callback_count; } public void setCallback_count(Integer callback_count) { this.callback_count = callback_count; } public Integer getFail_count() { return fail_count; } public void setFail_count(Integer fail_count) { this.fail_count = fail_count; } public Integer getTotal_time_cost() { return total_time_cost; } public void setTotal_time_cost(Integer total_time_cost) { this.total_time_cost = total_time_cost; } public Integer getMax_time_cost() { return max_time_cost; } public void setMax_time_cost(Integer max_time_cost) { this.max_time_cost = max_time_cost; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/interfacesummary/model/InterfaceSummary.java
src/main/java/org/jeewx/api/report/interfacesummary/model/InterfaceSummary.java
package org.jeewx.api.report.interfacesummary.model; public class InterfaceSummary { // 数据的日期 private String ref_date; // 通过服务器配置地址获得消息后,被动回复用户消息的次数 private Integer callback_count; // 上述动作的失败次数 private Integer fail_count; // 总耗时,除以callback_count即为平均耗时 private Integer total_time_cost; // 最大耗时 private Integer max_time_cost; public String getRef_date() { return ref_date; } public void setRef_date(String ref_date) { this.ref_date = ref_date; } public Integer getCallback_count() { return callback_count; } public void setCallback_count(Integer callback_count) { this.callback_count = callback_count; } public Integer getFail_count() { return fail_count; } public void setFail_count(Integer fail_count) { this.fail_count = fail_count; } public Integer getTotal_time_cost() { return total_time_cost; } public void setTotal_time_cost(Integer total_time_cost) { this.total_time_cost = total_time_cost; } public Integer getMax_time_cost() { return max_time_cost; } public void setMax_time_cost(Integer max_time_cost) { this.max_time_cost = max_time_cost; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datacube/JwDataCubeAPI.java
src/main/java/org/jeewx/api/report/datacube/JwDataCubeAPI.java
package org.jeewx.api.report.datacube; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.jeewx.api.core.common.JSONHelper; import org.jeewx.api.core.common.WxstoreUtils; import org.jeewx.api.core.exception.WexinReqException; import org.jeewx.api.core.req.model.dataCube.*; import org.jeewx.api.report.datacube.model.*; import java.util.List; /** * 分析数据接口service * @author luweichao * * 2015年1月27日 */ public class JwDataCubeAPI { //获取消息发送概况数据 private static String GETUPSTREAMMSG_URL = "https://api.weixin.qq.com/datacube/getupstreammsg?access_token=ACCESS_TOKEN"; //获取消息分送分时数据 private static String GETUPSTREAMMSGHOUR_URL = "https://api.weixin.qq.com/datacube/getupstreammsghour?access_token=ACCESS_TOKEN"; //获取消息发送周数据 private static String GETUPSTREAMMSGWEEK_URL = "https://api.weixin.qq.com/datacube/getupstreammsgweek?access_token=ACCESS_TOKEN"; //获取消息发送月数据 private static String GETUPSTREAMMSGMONTH_URL = "https://api.weixin.qq.com/datacube/getupstreammsgmonth?access_token=ACCESS_TOKEN"; //获取消息发送分布数据 private static String GETUPSTREAMMSGDIST_URL = "https://api.weixin.qq.com/datacube/getupstreammsgdist?access_token=ACCESS_TOKEN"; //获取消息发送分布周数据 private static String GETUPSTREAMMSGDISTWEEK_URL = "https://api.weixin.qq.com/datacube/getupstreammsgdistweek?access_token=ACCESS_TOKEN"; //获取消息发送分布月数据 private static String GETUPSTREAMMSGDISTMONTH_URL = "https://api.weixin.qq.com/datacube/getupstreammsgdistmonth?access_token=ACCESS_TOKEN"; /** * 获取消息发送概况数据 * @param bDate 起始时间 * @param eDate 结束时间 * @return * @throws WexinReqException */ public static List<WxDataCubeStreamMsgInfo> getWxDataCubeStreamMsgInfo(String accesstoken,String bDate,String eDate) throws WexinReqException { if (accesstoken != null) { // 封装请求参数 WxDataCubeStreamMsgParam msgParam = new WxDataCubeStreamMsgParam(); msgParam.setAccess_token(accesstoken); msgParam.setBegin_date(bDate); msgParam.setEnd_date(eDate); // 调用接口 String requestUrl = GETUPSTREAMMSG_URL.replace("ACCESS_TOKEN", accesstoken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(msgParam)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); Object error = result.get("errcode"); // 无错误消息时 返回数据对象 JSONArray arrayResult = result.getJSONArray("list"); // 正常返回 List<WxDataCubeStreamMsgInfo> msgInfoList = null; msgInfoList=JSONHelper.toList(arrayResult, WxDataCubeStreamMsgInfo.class); return msgInfoList; } return null; } /** * 获取消息分送分时数据 * @param bDate 起始时间 * @param eDate 结束时间 * @return * @throws WexinReqException */ public static List<WxDataCubeStreamMsgHourInfo> getWxDataCubeStreamMsgHourInfo(String accesstoken,String bDate,String eDate) throws WexinReqException { if (accesstoken != null) { // 封装请求参数 WxDataCubeStreamMsgHourParam msgParam = new WxDataCubeStreamMsgHourParam(); msgParam.setAccess_token(accesstoken); msgParam.setBegin_date(bDate); msgParam.setEnd_date(eDate); // 调用接口 String requestUrl = GETUPSTREAMMSGHOUR_URL.replace("ACCESS_TOKEN", accesstoken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(msgParam)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); Object error = result.get("errcode"); // 无错误消息时 返回数据对象 JSONArray arrayResult = result.getJSONArray("list"); // 正常返回 List<WxDataCubeStreamMsgHourInfo> msgInfoList = null; msgInfoList=JSONHelper.toList(arrayResult, WxDataCubeStreamMsgHourInfo.class); return msgInfoList; } return null; } /** * 获取消息发送周数据 * @param bDate 起始时间 * @param eDate 结束时间 * @return * @throws WexinReqException */ public static List<WxDataCubeStreamMsgWeekInfo> getWxDataCubeStreamMsgWeekInfo(String accesstoken,String bDate,String eDate) throws WexinReqException { if (accesstoken != null) { // 封装请求参数 WxDataCubeStreamMsgWeekParam msgParam = new WxDataCubeStreamMsgWeekParam(); msgParam.setAccess_token(accesstoken); msgParam.setBegin_date(bDate); msgParam.setEnd_date(eDate); // 调用接口 String requestUrl = GETUPSTREAMMSGWEEK_URL.replace("ACCESS_TOKEN", accesstoken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(msgParam)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); Object error = result.get("errcode"); // 无错误消息时 返回数据对象 JSONArray arrayResult = result.getJSONArray("list"); // 正常返回 List<WxDataCubeStreamMsgWeekInfo> msgInfoList = null; msgInfoList=JSONHelper.toList(arrayResult, WxDataCubeStreamMsgWeekInfo.class); return msgInfoList; } return null; } /** * 获取消息发送月数据 * @param bDate 起始时间 * @param eDate 结束时间 * @return * @throws WexinReqException */ public static List<WxDataCubeStreamMsgMonthInfo> getWxDataCubeStreamMsgMonthInfo(String accesstoken,String bDate,String eDate) throws WexinReqException { if (accesstoken != null) { // 封装请求参数 WxDataCubeStreamMsgMonthParam msgParam = new WxDataCubeStreamMsgMonthParam(); msgParam.setAccess_token(accesstoken); msgParam.setBegin_date(bDate); msgParam.setEnd_date(eDate); // 调用接口 String requestUrl = GETUPSTREAMMSGMONTH_URL.replace("ACCESS_TOKEN", accesstoken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(msgParam)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); Object error = result.get("errcode"); // 无错误消息时 返回数据对象 JSONArray arrayResult = result.getJSONArray("list"); // 正常返回 List<WxDataCubeStreamMsgMonthInfo> msgInfoList = null; msgInfoList=JSONHelper.toList(arrayResult, WxDataCubeStreamMsgMonthInfo.class); return msgInfoList; } return null; } /** * 获取消息发送分布数据 * @param bDate 起始时间 * @param eDate 结束时间 * @return * @throws WexinReqException */ public static List<WxDataCubeStreamMsgDistInfo> getWxDataCubeStreamMsgDistInfo(String accesstoken,String bDate,String eDate) throws WexinReqException { if (accesstoken != null) { // 封装请求参数 WxDataCubeStreamMsgDistParam msgParam = new WxDataCubeStreamMsgDistParam(); msgParam.setAccess_token(accesstoken); msgParam.setBegin_date(bDate); msgParam.setEnd_date(eDate); // 调用接口 String requestUrl = GETUPSTREAMMSGDIST_URL.replace("ACCESS_TOKEN", accesstoken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(msgParam)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); // 无错误消息时 返回数据对象 JSONArray arrayResult = result.getJSONArray("list"); // 正常返回 List<WxDataCubeStreamMsgDistInfo> msgInfoList = null; msgInfoList = JSONHelper.toList(arrayResult, WxDataCubeStreamMsgDistInfo.class); return msgInfoList; } return null; } /** * 获取消息发送分布周数据 * @param bDate 起始时间 * @param eDate 结束时间 * @return * @throws WexinReqException */ public static List<WxDataCubeStreamMsgDistWeekInfo> getWxDataCubeStreamMsgDistWeekInfo(String accesstoken,String bDate,String eDate) throws WexinReqException { if (accesstoken != null) { // 封装请求参数 WxDataCubeStreamMsgDistWeekParam msgParam = new WxDataCubeStreamMsgDistWeekParam(); msgParam.setAccess_token(accesstoken); msgParam.setBegin_date(bDate); msgParam.setEnd_date(eDate); // 调用接口 String requestUrl = GETUPSTREAMMSGDISTWEEK_URL.replace("ACCESS_TOKEN", accesstoken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(msgParam)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); Object error = result.get("errcode"); // 无错误消息时 返回数据对象 JSONArray arrayResult = result.getJSONArray("list"); // 正常返回 List<WxDataCubeStreamMsgDistWeekInfo> msgInfoList = null; msgInfoList=JSONHelper.toList(arrayResult, WxDataCubeStreamMsgDistWeekInfo.class); return msgInfoList; } return null; } /** * 获取消息发送分布月数据 * @param bDate 起始时间 * @param eDate 结束时间 * @return * @throws WexinReqException */ public static List<WxDataCubeStreamMsgDistMonthInfo> getWxDataCubeStreamMsgDistMonthInfo(String accesstoken,String bDate,String eDate) throws WexinReqException { if (accesstoken != null) { // 封装请求参数 WxDataCubeStreamMsgDistMonthParam msgParam = new WxDataCubeStreamMsgDistMonthParam(); msgParam.setAccess_token(accesstoken); msgParam.setBegin_date(bDate); msgParam.setEnd_date(eDate); // 调用接口 String requestUrl = GETUPSTREAMMSGDISTMONTH_URL.replace("ACCESS_TOKEN", accesstoken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(msgParam)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); Object error = result.get("errcode"); // 无错误消息时 返回数据对象 JSONArray arrayResult = result.getJSONArray("list"); // 正常返回 List<WxDataCubeStreamMsgDistMonthInfo> msgInfoList = null; msgInfoList=JSONHelper.toList(arrayResult, WxDataCubeStreamMsgDistMonthInfo.class); return msgInfoList; } return null; } public static void main(String[] args) { // 获取消息发送概况数据 getWxDataCubeStreamMsgInfo(); // 获取消息分送分时数据 testGetWxDataCubeStreamMsgHourInfo(); // 获取消息发送周数据 testGetWxDataCubeStreamMsgWeekInfo(); // 获取消息发送月数据 testGetWxDataCubeStreamMsgMonthInfo(); // 获取消息发送分布数据 testGetWxDataCubeStreamMsgDistInfo(); // 获取消息发送分布周数据 testGetWxDataCubeStreamMsgDistWeekInfo(); // 获取消息发送分布月数据 testGetWxDataCubeStreamMsgDistMonthInfo(); } /** * 获取消息发送概况数据-测试 */ private static void getWxDataCubeStreamMsgInfo(){ System.out.println("test getWxDataCubeStreamMsgInfo start "); JwDataCubeAPI s = new JwDataCubeAPI(); try { List<WxDataCubeStreamMsgInfo> msgInfoList = s.getWxDataCubeStreamMsgInfo("a8UEhkxmxN269afPJ7SuY9vVroHPYiwm9Yv5gu_yK4GGsA60IafJ3N9We4ubabgZ4lsl4kd0zqcH7JC70UsQ951Ndur4ejSIz7VvroBJn4g","2015-01-01","2015-01-07"); if(msgInfoList!=null&&msgInfoList.size()>0){ for (WxDataCubeStreamMsgInfo wxDataCubeStreamMsgInfo : msgInfoList) { System.out.println(wxDataCubeStreamMsgInfo.getMsg_count()); System.out.println(wxDataCubeStreamMsgInfo.getMsg_type()); } } } catch (WexinReqException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("test getWxDataCubeStreamMsgInfo end "); } /** * 获取消息分送分时数据-测试 */ private static void testGetWxDataCubeStreamMsgHourInfo(){ System.out.println("test testGetWxDataCubeStreamMsgHourInfo start "); JwDataCubeAPI s = new JwDataCubeAPI(); try { List<WxDataCubeStreamMsgHourInfo> msgInfoList = s.getWxDataCubeStreamMsgHourInfo("a8UEhkxmxN269afPJ7SuY9vVroHPYiwm9Yv5gu_yK4GGsA60IafJ3N9We4ubabgZ4lsl4kd0zqcH7JC70UsQ951Ndur4ejSIz7VvroBJn4g","2015-01-07","2015-01-07"); if(msgInfoList!=null&&msgInfoList.size()>0){ for (WxDataCubeStreamMsgHourInfo wxDataCubeStreamMsghourInfo : msgInfoList) { System.out.println(wxDataCubeStreamMsghourInfo.getMsg_count()); System.out.println(wxDataCubeStreamMsghourInfo.getMsg_type()); System.out.println(wxDataCubeStreamMsghourInfo.getRef_hour()); } } } catch (WexinReqException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("test testGetWxDataCubeStreamMsgHourInfo end "); } /** * 获取消息发送周数据-测试 */ private static void testGetWxDataCubeStreamMsgWeekInfo(){ System.out.println("test testGetWxDataCubeStreamMsgWeekInfo start "); JwDataCubeAPI s = new JwDataCubeAPI(); try { List<WxDataCubeStreamMsgWeekInfo> msgInfoList = s.getWxDataCubeStreamMsgWeekInfo("a8UEhkxmxN269afPJ7SuY9vVroHPYiwm9Yv5gu_yK4GGsA60IafJ3N9We4ubabgZ4lsl4kd0zqcH7JC70UsQ951Ndur4ejSIz7VvroBJn4g","2015-01-01","2015-01-07"); if(msgInfoList!=null&&msgInfoList.size()>0){ for (WxDataCubeStreamMsgWeekInfo wxDataCubeStreamMsgInfo : msgInfoList) { System.out.println(wxDataCubeStreamMsgInfo.getMsg_count()); System.out.println(wxDataCubeStreamMsgInfo.getMsg_type()); } } } catch (WexinReqException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("test testGetWxDataCubeStreamMsgWeekInfo end "); } /** * 获取消息发送月数据-测试 */ private static void testGetWxDataCubeStreamMsgMonthInfo(){ System.out.println("test testGetWxDataCubeStreamMsgMonthInfo start "); JwDataCubeAPI s = new JwDataCubeAPI(); try { List<WxDataCubeStreamMsgMonthInfo> msgInfoList = s.getWxDataCubeStreamMsgMonthInfo("a8UEhkxmxN269afPJ7SuY9vVroHPYiwm9Yv5gu_yK4GGsA60IafJ3N9We4ubabgZ4lsl4kd0zqcH7JC70UsQ951Ndur4ejSIz7VvroBJn4g","2014-01-01","2015-01-30"); if(msgInfoList!=null&&msgInfoList.size()>0){ for (WxDataCubeStreamMsgMonthInfo wxDataCubeStreamMsgInfo : msgInfoList) { System.out.println(wxDataCubeStreamMsgInfo.getMsg_count()); System.out.println(wxDataCubeStreamMsgInfo.getMsg_type()); } } } catch (WexinReqException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("test testGetWxDataCubeStreamMsgMonthInfo end "); } /** * 获取消息发送分布数据-测试 */ private static void testGetWxDataCubeStreamMsgDistInfo(){ System.out.println("test testGetWxDataCubeStreamMsgDistInfo start "); JwDataCubeAPI s = new JwDataCubeAPI(); try { List<WxDataCubeStreamMsgDistInfo> msgInfoList = s.getWxDataCubeStreamMsgDistInfo("a8UEhkxmxN269afPJ7SuY9vVroHPYiwm9Yv5gu_yK4GGsA60IafJ3N9We4ubabgZ4lsl4kd0zqcH7JC70UsQ951Ndur4ejSIz7VvroBJn4g","2015-01-01","2015-01-15"); if(msgInfoList!=null&&msgInfoList.size()>0){ for (WxDataCubeStreamMsgDistInfo wxDataCubeStreamMsgInfo : msgInfoList) { System.out.println(wxDataCubeStreamMsgInfo.getRef_date()); System.out.println(wxDataCubeStreamMsgInfo.getCount_interval()); } } } catch (WexinReqException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("test testGetWxDataCubeStreamMsgDistInfo end "); } /** * 获取消息发送分布周数据-测试 */ private static void testGetWxDataCubeStreamMsgDistWeekInfo(){ System.out.println("test testGetWxDataCubeStreamMsgDistWeekInfo start "); JwDataCubeAPI s = new JwDataCubeAPI(); try { List<WxDataCubeStreamMsgDistWeekInfo> msgInfoList = s.getWxDataCubeStreamMsgDistWeekInfo("a8UEhkxmxN269afPJ7SuY9vVroHPYiwm9Yv5gu_yK4GGsA60IafJ3N9We4ubabgZ4lsl4kd0zqcH7JC70UsQ951Ndur4ejSIz7VvroBJn4g","2015-01-01","2015-01-15"); if(msgInfoList!=null&&msgInfoList.size()>0){ for (WxDataCubeStreamMsgDistWeekInfo wxDataCubeStreamMsgInfo : msgInfoList) { System.out.println(wxDataCubeStreamMsgInfo.getRef_date()); System.out.println(wxDataCubeStreamMsgInfo.getCount_interval()); } } } catch (WexinReqException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("test testGetWxDataCubeStreamMsgDistWeekInfo end "); } /** * 获取消息发送分布月数据-测试 */ private static void testGetWxDataCubeStreamMsgDistMonthInfo(){ System.out.println("test testGetWxDataCubeStreamMsgDistMonthInfo start "); JwDataCubeAPI s = new JwDataCubeAPI(); try { List<WxDataCubeStreamMsgDistMonthInfo> msgInfoList = s.getWxDataCubeStreamMsgDistMonthInfo("a8UEhkxmxN269afPJ7SuY9vVroHPYiwm9Yv5gu_yK4GGsA60IafJ3N9We4ubabgZ4lsl4kd0zqcH7JC70UsQ951Ndur4ejSIz7VvroBJn4g","2015-01-01","2015-01-15"); if(msgInfoList!=null&&msgInfoList.size()>0){ for (WxDataCubeStreamMsgDistMonthInfo wxDataCubeStreamMsgInfo : msgInfoList) { System.out.println(wxDataCubeStreamMsgInfo.getRef_date()); System.out.println(wxDataCubeStreamMsgInfo.getCount_interval()); } } } catch (WexinReqException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("test testGetWxDataCubeStreamMsgDistMonthInfo end "); } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgInfo.java
src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgInfo.java
package org.jeewx.api.report.datacube.model; /** * 结果类--获取消息发送概况数据 * @author luweichao * * 2015年1月27日 */ public class WxDataCubeStreamMsgInfo { /**日期**/ private String ref_date; /**类型**/ private String msg_type; /**用户**/ private String msg_user; /**总数**/ private String msg_count; public String getRef_date() { return ref_date; } public void setRef_date(String ref_date) { this.ref_date = ref_date; } public String getMsg_type() { return msg_type; } public void setMsg_type(String msg_type) { this.msg_type = msg_type; } public String getMsg_user() { return msg_user; } public void setMsg_user(String msg_user) { this.msg_user = msg_user; } public String getMsg_count() { return msg_count; } public void setMsg_count(String msg_count) { this.msg_count = msg_count; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgDistWeekInfo.java
src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgDistWeekInfo.java
package org.jeewx.api.report.datacube.model; /** * 结果类--获取消息发送分布周数据 * @author luweichao * * 2015年1月27日 */ public class WxDataCubeStreamMsgDistWeekInfo extends WxDataCubeStreamMsgInfo{ private String count_interval; public String getCount_interval() { return count_interval; } public void setCount_interval(String count_interval) { this.count_interval = count_interval; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgDistInfo.java
src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgDistInfo.java
package org.jeewx.api.report.datacube.model; /** * 结果类--获取消息发送分布数据 * @author luweichao * * 2015年1月27日 */ public class WxDataCubeStreamMsgDistInfo extends WxDataCubeStreamMsgInfo{ private String count_interval; public String getCount_interval() { return count_interval; } public void setCount_interval(String count_interval) { this.count_interval = count_interval; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgHourInfo.java
src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgHourInfo.java
package org.jeewx.api.report.datacube.model; /** * 结果类--获取消息分送分时数据 * @author luweichao * * 2015年1月27日 */ public class WxDataCubeStreamMsgHourInfo extends WxDataCubeStreamMsgInfo{ /**时间**/ private String ref_hour; public String getRef_hour() { return ref_hour; } public void setRef_hour(String ref_hour) { this.ref_hour = ref_hour; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgWeekInfo.java
src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgWeekInfo.java
package org.jeewx.api.report.datacube.model; /** * 结果类--获取消息发送周数据 * @author luweichao * * 2015年1月27日 */ public class WxDataCubeStreamMsgWeekInfo extends WxDataCubeStreamMsgInfo{ }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgDistMonthInfo.java
src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgDistMonthInfo.java
package org.jeewx.api.report.datacube.model; /** * 结果类--获取消息发送分布月数据 * @author luweichao * * 2015年1月27日 */ public class WxDataCubeStreamMsgDistMonthInfo extends WxDataCubeStreamMsgInfo{ private String count_interval; public String getCount_interval() { return count_interval; } public void setCount_interval(String count_interval) { this.count_interval = count_interval; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgMonthInfo.java
src/main/java/org/jeewx/api/report/datacube/model/WxDataCubeStreamMsgMonthInfo.java
package org.jeewx.api.report.datacube.model; /** * 结果类--获取消息发送月数据 * @author luweichao * * 2015年1月27日 */ public class WxDataCubeStreamMsgMonthInfo extends WxDataCubeStreamMsgInfo{ }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datastatistics/Test.java
src/main/java/org/jeewx/api/report/datastatistics/Test.java
package org.jeewx.api.report.datastatistics; import java.io.UnsupportedEncodingException; import java.util.List; import org.jeewx.api.core.common.JSONHelper; import org.jeewx.api.core.exception.WexinReqException; import org.jeewx.api.report.datastatistics.graphicanalysis.JwGraphicAnalysisAPI; import org.jeewx.api.report.datastatistics.graphicanalysis.model.GraphicAnalysisRtnInfo; import org.jeewx.api.report.datastatistics.useranalysis.JwUserAnalysisAPI; import org.jeewx.api.report.datastatistics.useranalysis.model.UserAnalysisRtnInfo; import org.jeewx.api.wxbase.wxtoken.JwTokenAPI; public class Test { private static String appid = "wx00737224cb9dbc7d"; private static String appscret = "b9479ebdb58d1c6b6efd4171ebe718b5"; public static void main(String[] args) throws WexinReqException, UnsupportedEncodingException { Test t = new Test(); //测试 获取用户增减数据 // t.getUserSummary(); //测试 获取累计用户数据 // t.getUserCumulate(); //测试 获取图文群发每日数据 // t.getArticleSummary(); //获取图文群发总数据 t.getArticleTotal(); //获取图文统计数据 // t.getUserRead(); //获取图文统计分时数据 // t.getUserReadHour(); //获取图文分享转发数据 // t.getUserShare(); //获取图文分享转发分时数据 // t.getUserShareHour(); } public String getAccessToken() throws WexinReqException{ return JwTokenAPI.getAccessToken(appid, appscret); } //测试 获取用户增减数据 @SuppressWarnings("static-access") public void getUserSummary() throws WexinReqException{ JwUserAnalysisAPI jua = new JwUserAnalysisAPI(); List<UserAnalysisRtnInfo> userAnalysisList = jua.getUserSummary(getAccessToken(), "2015-01-27", "2015-01-30"); for (UserAnalysisRtnInfo userAnalysisRtnInfo : userAnalysisList) { System.out.println(JSONHelper.bean2json(userAnalysisRtnInfo)); } } //测试 获取累计用户数据 @SuppressWarnings("static-access") public void getUserCumulate() throws WexinReqException{ JwUserAnalysisAPI jua = new JwUserAnalysisAPI(); List<UserAnalysisRtnInfo> userAnalysisRtnInfoList = jua.getUserCumulate(getAccessToken(), "2015-01-24", "2015-01-30"); for (UserAnalysisRtnInfo userAnalysisRtnInfo : userAnalysisRtnInfoList) { System.out.println(JSONHelper.bean2json(userAnalysisRtnInfo)); } } //获取图文群发每日数据 @SuppressWarnings("static-access") public void getArticleSummary() throws WexinReqException, UnsupportedEncodingException{ JwGraphicAnalysisAPI jga = new JwGraphicAnalysisAPI(); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = jga.getArticleSummary(getAccessToken(), "2015-03-02", "2015-03-02"); for (GraphicAnalysisRtnInfo graphicAnalysisRtnInfo : graphicAnalysisRtnInfoList) { System.out.println(JSONHelper.bean2json(graphicAnalysisRtnInfo)); } } //获取图文群发总数据 @SuppressWarnings("static-access") public void getArticleTotal() throws WexinReqException, UnsupportedEncodingException{ JwGraphicAnalysisAPI jga = new JwGraphicAnalysisAPI(); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = jga.getArticleTotal(getAccessToken(), "2015-03-03", "2015-03-03"); for (GraphicAnalysisRtnInfo graphicAnalysisRtnInfo : graphicAnalysisRtnInfoList) { System.out.println(JSONHelper.bean2json(graphicAnalysisRtnInfo)); } } //获取图文统计数据 @SuppressWarnings("static-access") public void getUserRead() throws WexinReqException{ JwGraphicAnalysisAPI jga = new JwGraphicAnalysisAPI(); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = jga.getUserRead(getAccessToken(), "2015-01-29", "2015-01-30"); for (GraphicAnalysisRtnInfo graphicAnalysisRtnInfo : graphicAnalysisRtnInfoList) { System.out.println(JSONHelper.bean2json(graphicAnalysisRtnInfo)); } } //获取图文统计分时数据 @SuppressWarnings("static-access") public void getUserReadHour() throws WexinReqException{ JwGraphicAnalysisAPI jga = new JwGraphicAnalysisAPI(); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = jga.getUserReadHour(getAccessToken(), "2015-01-30", "2015-01-30"); for (GraphicAnalysisRtnInfo graphicAnalysisRtnInfo : graphicAnalysisRtnInfoList) { System.out.println(JSONHelper.bean2json(graphicAnalysisRtnInfo)); } } //获取图文分享转发数据 @SuppressWarnings("static-access") public void getUserShare() throws WexinReqException{ JwGraphicAnalysisAPI jga = new JwGraphicAnalysisAPI(); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = jga.getUserShare(getAccessToken(), "2015-01-24", "2015-01-30"); for (GraphicAnalysisRtnInfo graphicAnalysisRtnInfo : graphicAnalysisRtnInfoList) { System.out.println(JSONHelper.bean2json(graphicAnalysisRtnInfo)); } } //获取图文分享转发分时数据 @SuppressWarnings("static-access") public void getUserShareHour() throws WexinReqException{ JwGraphicAnalysisAPI jga = new JwGraphicAnalysisAPI(); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = jga.getUserShareHour(getAccessToken(), "2015-01-30", "2015-01-30"); for (GraphicAnalysisRtnInfo graphicAnalysisRtnInfo : graphicAnalysisRtnInfoList) { System.out.println(JSONHelper.bean2json(graphicAnalysisRtnInfo)); } } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datastatistics/interfacesummary/JwInterfaceSummary.java
src/main/java/org/jeewx/api/report/datastatistics/interfacesummary/JwInterfaceSummary.java
package org.jeewx.api.report.datastatistics.interfacesummary; import com.alibaba.fastjson.JSONObject; import org.jeewx.api.core.common.WxstoreUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JwInterfaceSummary { private static Logger logger = LoggerFactory.getLogger(JwInterfaceSummary.class); /** * 获取接口分析数据 */ private static final String getinterfacesummary = "https://api.weixin.qq.com/datacube/getinterfacesummary?access_token=ACCESS_TOKEN"; /** * 获取接口分析数据(最大时间跨度:30) * @param accessToken 调用接口凭证 * @param beginDate 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错 * @param endDate 获取数据的结束日期,end_date允许设置的最大值为昨日 * @return * 参数 说明 *<br> ref_date 数据的日期 *<br> ref_hour 数据的小时 *<br> callback_count 通过服务器配置地址获得消息后,被动回复用户消息的次数 *<br> fail_count 上述动作的失败次数 *<br> total_time_cost 总耗时,除以callback_count即为平均耗时 *<br> max_time_cost 最大耗时 */ public static JSONObject getinterfacesummary(String accessToken, String beginDate, String endDate){ if(accessToken==null){ logger.error("传入的accessToken为空"); return null; } JSONObject param = new JSONObject(); param.put("access_token", accessToken); param.put("begin_date", beginDate); param.put("end_date", endDate); logger.info("--接口分析数据请求参数--"+param.toString()); JSONObject json = WxstoreUtils.httpRequest(getinterfacesummary, "POST", param.toString()); logger.info("--接口分析数据结果返回--"+json.toString()); return json; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datastatistics/graphicanalysis/JwGraphicAnalysisAPI.java
src/main/java/org/jeewx/api/report/datastatistics/graphicanalysis/JwGraphicAnalysisAPI.java
package org.jeewx.api.report.datastatistics.graphicanalysis; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.jeewx.api.core.exception.WexinReqException; import org.jeewx.api.core.req.WeiXinReqService; import org.jeewx.api.core.req.model.dataCube.*; import org.jeewx.api.report.datastatistics.graphicanalysis.model.GraphicAnalysisRtnInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.UnsupportedEncodingException; import java.sql.Date; import java.util.ArrayList; import java.util.List; /** * @ClassName: JwGraphicAnalysisAPI * @Description: 图文分析数据接口 * @author zhaoxl */ public class JwGraphicAnalysisAPI { private static Logger logger = LoggerFactory.getLogger(JwGraphicAnalysisAPI.class); private static Long getDays(String Date1,String Date2){ return Date.valueOf(Date1).getTime() /86400000L - Date.valueOf(Date2).getTime() / 86400000L; } /** * @throws UnsupportedEncodingException * @Title: getArticleSummary * @Description: 获取图文群发每日数据 * @param @param accesstoken * @param @param begin_date * @param @param end_date * @param @return * @param @throws WexinReqException 设定文件 * @return List<GraphicAnalysisRtnInfo> 返回类型 * @throws */ public static List<GraphicAnalysisRtnInfo> getArticleSummary(String accesstoken,String begin_date,String end_date) throws WexinReqException, UnsupportedEncodingException{ if(accesstoken != null){ if(getDays(end_date,begin_date) >= 1){ logger.error("传入的日期间隔大于1天"); return null; }else{ WxDataCubeStreamArticleSummaryParam articleSummary = new WxDataCubeStreamArticleSummaryParam(); articleSummary.setAccess_token(accesstoken); articleSummary.setBegin_date(begin_date); articleSummary.setEnd_date(end_date); JSONObject result = WeiXinReqService.getInstance().doWeinxinReqJson( articleSummary); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = new ArrayList<GraphicAnalysisRtnInfo>(); Object error = result.get("errcode"); JSONArray array = null; GraphicAnalysisRtnInfo graphicAnalysisRtnInfo = null; array = (JSONArray) result.get("list"); for (Object object : array) { graphicAnalysisRtnInfo = (GraphicAnalysisRtnInfo) JSONObject .toJavaObject((JSONObject) object, GraphicAnalysisRtnInfo.class); graphicAnalysisRtnInfoList.add(graphicAnalysisRtnInfo); } return graphicAnalysisRtnInfoList; } } return null; } /** * @throws UnsupportedEncodingException * @Title: getArticleTotal * @Description: 获取图文群发总数据 最大时间跨度 1天 * @param @param accesstoken * @param @param begin_date * @param @param end_date * @param @return * @param @throws WexinReqException 设定文件 * @return List<GraphicAnalysisRtnInfo> 返回类型 * @throws */ public static List<GraphicAnalysisRtnInfo> getArticleTotal(String accesstoken,String begin_date,String end_date) throws WexinReqException, UnsupportedEncodingException{ if(accesstoken != null){ if(getDays(end_date,begin_date) >= 1){ logger.error("传入的日期间隔大于1天"); return null; }else{ WxDataCubeStreamArticleTotalParam articleTotal = new WxDataCubeStreamArticleTotalParam(); articleTotal.setAccess_token(accesstoken); articleTotal.setBegin_date(begin_date); articleTotal.setEnd_date(end_date); JSONObject result = WeiXinReqService.getInstance().doWeinxinReqJson(articleTotal); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = new ArrayList<GraphicAnalysisRtnInfo>(); Object error = result.get("errcode"); JSONArray array = null; GraphicAnalysisRtnInfo graphicAnalysisRtnInfo = null; array = (JSONArray) result.get("list"); //修复JSONObject不能解析details内容的BUG for (Object object : array) { graphicAnalysisRtnInfo = JSONObject.parseObject(object.toString(), GraphicAnalysisRtnInfo.class); // graphicAnalysisRtnInfo = (GraphicAnalysisRtnInfo) JSONObject // .toBean((JSONObject) object, // GraphicAnalysisRtnInfo.class); graphicAnalysisRtnInfoList.add(graphicAnalysisRtnInfo); } return graphicAnalysisRtnInfoList; } } return null; } /** * @throws UnsupportedEncodingException * @Title: getUserRead * @Description: 获取图文统计数据 最大时间跨度 3 * @param @param accesstoken * @param @param begin_date * @param @param end_date * @param @return * @param @throws WexinReqException 设定文件 * @return List<GraphicAnalysisRtnInfo> 返回类型 * @throws */ public static List<GraphicAnalysisRtnInfo> getUserRead(String accesstoken,String begin_date,String end_date) throws WexinReqException{ if(accesstoken != null){ if(getDays(end_date,begin_date) >= 3){ logger.error("传入的日期间隔大于3天"); return null; }else{ WxDataCubeStreamUserReadParam userRead = new WxDataCubeStreamUserReadParam(); userRead.setAccess_token(accesstoken); userRead.setBegin_date(begin_date); userRead.setEnd_date(end_date); JSONObject result = WeiXinReqService.getInstance().doWeinxinReqJson(userRead); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = new ArrayList<GraphicAnalysisRtnInfo>(); Object error = result.get("errcode"); JSONArray array = null; GraphicAnalysisRtnInfo graphicAnalysisRtnInfo = null; array = (JSONArray) result.get("list"); for (Object object : array) { graphicAnalysisRtnInfo = ((JSONObject) object).toJavaObject(GraphicAnalysisRtnInfo.class); graphicAnalysisRtnInfoList.add(graphicAnalysisRtnInfo); } return graphicAnalysisRtnInfoList; } } return null; } /** * @Title: getUserReadHour * @Description: 获取图文统计分时数据 最大时间跨度1 * @param @param accesstoken * @param @param begin_date * @param @param end_date * @param @return * @param @throws WexinReqException 设定文件 * @return List<GraphicAnalysisRtnInfo> 返回类型 * @throws */ public static List<GraphicAnalysisRtnInfo> getUserReadHour(String accesstoken,String begin_date,String end_date) throws WexinReqException{ if(accesstoken != null){ if(getDays(end_date,begin_date) >= 1){ logger.error("传入的日期间隔大于1天"); return null; }else{ WxDataCubeStreamUserReadHourParam userReadHour = new WxDataCubeStreamUserReadHourParam(); userReadHour.setAccess_token(accesstoken); userReadHour.setBegin_date(begin_date); userReadHour.setEnd_date(end_date); JSONObject result = WeiXinReqService.getInstance().doWeinxinReqJson(userReadHour); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = new ArrayList<GraphicAnalysisRtnInfo>(); Object error = result.get("errcode"); JSONArray array = null; GraphicAnalysisRtnInfo graphicAnalysisRtnInfo = null; array = (JSONArray) result.get("list"); for (Object object : array) { graphicAnalysisRtnInfo = ((JSONObject) object).toJavaObject(GraphicAnalysisRtnInfo.class); graphicAnalysisRtnInfoList.add(graphicAnalysisRtnInfo); } return graphicAnalysisRtnInfoList; } } return null; } /** * @Title: getUserShare * @Description: 获取图文分享转发数据 最大时间跨度 7 * @param @param accesstoken * @param @param begin_date * @param @param end_date * @param @return * @param @throws WexinReqException 设定文件 * @return List<GraphicAnalysisRtnInfo> 返回类型 * @throws */ public static List<GraphicAnalysisRtnInfo> getUserShare(String accesstoken,String begin_date,String end_date) throws WexinReqException{ if(accesstoken != null){ if(getDays(end_date,begin_date) >= 7){ logger.error("传入的日期间隔大于7天"); return null; }else{ WxDataCubeStreamUserShareParam userShare = new WxDataCubeStreamUserShareParam(); userShare.setAccess_token(accesstoken); userShare.setBegin_date(begin_date); userShare.setEnd_date(end_date); JSONObject result = WeiXinReqService.getInstance().doWeinxinReqJson(userShare); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = new ArrayList<GraphicAnalysisRtnInfo>(); Object error = result.get("errcode"); JSONArray array = null; GraphicAnalysisRtnInfo graphicAnalysisRtnInfo = null; array = (JSONArray) result.get("list"); for (Object object : array) { graphicAnalysisRtnInfo = ((JSONObject) object).toJavaObject(GraphicAnalysisRtnInfo.class); graphicAnalysisRtnInfoList.add(graphicAnalysisRtnInfo); } return graphicAnalysisRtnInfoList; } } return null; } public static List<GraphicAnalysisRtnInfo> getUserShareHour(String accesstoken,String begin_date,String end_date) throws WexinReqException{ if(accesstoken != null){ if(getDays(end_date,begin_date) >= 1){ logger.error("传入的日期间隔大于1天"); return null; }else{ WxDataCubeStreamUserShareHourParam userShareHour = new WxDataCubeStreamUserShareHourParam(); userShareHour.setAccess_token(accesstoken); userShareHour.setBegin_date(begin_date); userShareHour.setEnd_date(end_date); JSONObject result = WeiXinReqService.getInstance().doWeinxinReqJson(userShareHour); List<GraphicAnalysisRtnInfo> graphicAnalysisRtnInfoList = new ArrayList<GraphicAnalysisRtnInfo>(); Object error = result.get("errcode"); JSONArray array = null; GraphicAnalysisRtnInfo graphicAnalysisRtnInfo = null; array = (JSONArray) result.get("list"); for (Object object : array) { graphicAnalysisRtnInfo = ((JSONObject) object).toJavaObject(GraphicAnalysisRtnInfo.class); graphicAnalysisRtnInfoList.add(graphicAnalysisRtnInfo); } return graphicAnalysisRtnInfoList; } } return null; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datastatistics/graphicanalysis/model/GraphicAnalysisRtnInfo.java
src/main/java/org/jeewx/api/report/datastatistics/graphicanalysis/model/GraphicAnalysisRtnInfo.java
package org.jeewx.api.report.datastatistics.graphicanalysis.model; import java.util.List; /** * @ClassName: GraphicAnalysisRtnInfo * @Description: 图文分析数据接口返回值 * @author zhaoxl * @date 2015年1月29日 下午10:44:11 */ public class GraphicAnalysisRtnInfo { /** * 数据的日期,需在begin_date和end_date之间 */ private String ref_date; /** * 数据的小时<br/> * 包括从000到2300,分别代表的是<br/> * [000,100)到[2300,2400)<br/> * 即每日的第1小时和最后1小时 */ private String ref_hour; /** * @统计的日期,在getarticletotal接口中,<br/> * ref_date指的是文章群发出日期, 而stat_date是数据统计日期 */ private String stat_date; /** * 这里的msgid实际上是由msgid(图文消息id)和index(消息次序索引)组成, <br/> * 例如12003_3, 其中12003是msgid,即一次群发的id消息的; <br/> * 3为index,假设该次群发的图文消息共5个文章(因为可能为多图文), 3表示5个中的第3个 */ private String msgid; /** * 图文消息的标题 */ private String title; /** * 图文页(点击群发图文卡片进入的页面)的阅读人数 */ private Integer int_page_read_user; /** * 图文页的阅读次数 */ private Integer int_page_read_count; /** * 原文页(点击图文页“阅读原文”进入的页面)的阅读人数,无原文页时此处数据为0 */ private Integer ori_page_read_user; /** * 原文页的阅读次数 */ private Integer ori_page_read_count; /** * 分享的场景 * 1代表好友转发 * 2代表朋友圈 * 3代表腾讯微博 * 255代表其他 */ private Integer share_scene; /** * 分享的人数 */ private Integer share_user; /** * 分享的次数 */ private Integer share_count; /** * 收藏的人数 */ private Integer add_to_fav_user; /** * 收藏的次数 */ private Integer add_to_fav_count; /** * 送达人数,一般约等于总粉丝数<br/> * (需排除黑名单或其他异常情况下无法收到消息的粉丝) */ private Integer target_user; /** * 用户来源 */ private Integer user_source; /** * */ private Integer total_online_time; private List<GraphicAnalysisRtnInfo> details; public List<GraphicAnalysisRtnInfo> getDetails() { return details; } public void setDetails(List<GraphicAnalysisRtnInfo> details) { this.details = details; } public Integer getTotal_online_time() { return total_online_time; } public void setTotal_online_time(Integer total_online_time) { this.total_online_time = total_online_time; } public Integer getUser_source() { return user_source; } public void setUser_source(Integer user_source) { this.user_source = user_source; } public String getRef_date() { return ref_date; } public void setRef_date(String ref_date) { this.ref_date = ref_date; } public String getRef_hour() { return ref_hour; } public void setRef_hour(String ref_hour) { this.ref_hour = ref_hour; } public String getStat_date() { return stat_date; } public void setStat_date(String stat_date) { this.stat_date = stat_date; } public String getMsgid() { return msgid; } public void setMsgid(String msgid) { this.msgid = msgid; } public String getTitle() { return title; } public void setTitle(String title){ this.title = title; } public Integer getInt_page_read_user() { return int_page_read_user; } public void setInt_page_read_user(Integer int_page_read_user) { this.int_page_read_user = int_page_read_user; } public Integer getInt_page_read_count() { return int_page_read_count; } public void setInt_page_read_count(Integer int_page_read_count) { this.int_page_read_count = int_page_read_count; } public Integer getOri_page_read_user() { return ori_page_read_user; } public void setOri_page_read_user(Integer ori_page_read_user) { this.ori_page_read_user = ori_page_read_user; } public Integer getOri_page_read_count() { return ori_page_read_count; } public void setOri_page_read_count(Integer ori_page_read_count) { this.ori_page_read_count = ori_page_read_count; } public Integer getShare_scene() { return share_scene; } public void setShare_scene(Integer share_scene) { this.share_scene = share_scene; } public Integer getShare_user() { return share_user; } public void setShare_user(Integer share_user) { this.share_user = share_user; } public Integer getShare_count() { return share_count; } public void setShare_count(Integer share_count) { this.share_count = share_count; } public Integer getAdd_to_fav_user() { return add_to_fav_user; } public void setAdd_to_fav_user(Integer add_to_fav_user) { this.add_to_fav_user = add_to_fav_user; } public Integer getAdd_to_fav_count() { return add_to_fav_count; } public void setAdd_to_fav_count(Integer add_to_fav_count) { this.add_to_fav_count = add_to_fav_count; } public Integer getTarget_user() { return target_user; } public void setTarget_user(Integer target_user) { this.target_user = target_user; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datastatistics/useranalysis/JwUserAnalysisAPI.java
src/main/java/org/jeewx/api/report/datastatistics/useranalysis/JwUserAnalysisAPI.java
package org.jeewx.api.report.datastatistics.useranalysis; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.jeewx.api.core.exception.WexinReqException; import org.jeewx.api.core.req.WeiXinReqService; import org.jeewx.api.core.req.model.dataCube.WxDataCubeStreamUserCumulateParam; import org.jeewx.api.core.req.model.dataCube.WxDataCubeStreamUserSummaryParam; import org.jeewx.api.report.datastatistics.useranalysis.model.UserAnalysisRtnInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.Date; import java.util.ArrayList; import java.util.List; /** * @ClassName: JwUserAnalysisAPI * @Description: 用户分析数据接口 * @author zhaoxl */ public class JwUserAnalysisAPI { private static Logger logger = LoggerFactory.getLogger(JwUserAnalysisAPI.class); private static Long getDays(String Date1,String Date2){ return Date.valueOf(Date1).getTime() /86400000L - Date.valueOf(Date2).getTime() / 86400000L; } /** * @throws WexinReqException * @Title: getUserSummary * @Description: 获取用户增减数据,传入的日期最大间隔为7天 * @param @param accesstoken * @param @return 设定文件 * @return UserAnalysisRtnInfo 返回类型 * @throws */ public static List<UserAnalysisRtnInfo> getUserSummary(String accesstoken,String begin_date,String end_date) throws WexinReqException{ if(accesstoken != null){ if(getDays(end_date,begin_date) >= 7){ logger.error("传入的日期间隔大于7天"); return null; }else{ WxDataCubeStreamUserSummaryParam userAnalysis = new WxDataCubeStreamUserSummaryParam(); userAnalysis.setAccess_token(accesstoken); userAnalysis.setBegin_date(begin_date); userAnalysis.setEnd_date(end_date); JSONObject result = WeiXinReqService.getInstance().doWeinxinReqJson( userAnalysis); List<UserAnalysisRtnInfo> userAnalysisRtnInfoList = new ArrayList<UserAnalysisRtnInfo>(); Object error = result.get("errcode"); JSONArray array = null; UserAnalysisRtnInfo userAnalysisRtnInfo = null; array = (JSONArray) result.get("list"); for (Object object : array) { userAnalysisRtnInfo = ((JSONObject) object).toJavaObject(UserAnalysisRtnInfo.class); userAnalysisRtnInfoList.add(userAnalysisRtnInfo); } return userAnalysisRtnInfoList; } } return null; } /** * 获取累计用户数据 * @param accesstoken * @param begin_date * @param end_date * @return * @throws WexinReqException */ public static List<UserAnalysisRtnInfo> getUserCumulate(String accesstoken,String begin_date,String end_date) throws WexinReqException{ if(accesstoken != null){ if(getDays(end_date,begin_date) >= 7){ logger.error("传入的日期间隔大于7天"); return null; }else{ WxDataCubeStreamUserCumulateParam userCumulate = new WxDataCubeStreamUserCumulateParam(); userCumulate.setAccess_token(accesstoken); userCumulate.setBegin_date(begin_date); userCumulate.setEnd_date(end_date); JSONObject result = WeiXinReqService.getInstance().doWeinxinReqJson(userCumulate); List<UserAnalysisRtnInfo> userAnalysisRtnInfoList = new ArrayList<UserAnalysisRtnInfo>(); Object error = result.get("errcode"); JSONArray array = null; UserAnalysisRtnInfo userAnalysisRtnInfo = null; array = (JSONArray) result.get("list"); for (Object object : array) { userAnalysisRtnInfo = ((JSONObject) object).toJavaObject(UserAnalysisRtnInfo.class); userAnalysisRtnInfoList.add(userAnalysisRtnInfo); } return userAnalysisRtnInfoList; } } return null; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/report/datastatistics/useranalysis/model/UserAnalysisRtnInfo.java
src/main/java/org/jeewx/api/report/datastatistics/useranalysis/model/UserAnalysisRtnInfo.java
package org.jeewx.api.report.datastatistics.useranalysis.model; /** * @ClassName: UserAnalysisRtnInfo * @Description: 用户分析数据接口返回值 * @author zhaoxl * @date 2015年1月29日 下午10:44:11 */ public class UserAnalysisRtnInfo { /** * 数据的日期 */ private String ref_date; /** * 用户的渠道,数值代表的含义如下:<br/> * <li>0代表其他</li> * <li>30代表扫二维码</li> * <li>17代表名片分享</li> * <li>35代表搜号码(即微信添加朋友页的搜索)</li> * <li>39代表查询微信公众帐号 </li> * <li>43代表图文页右上角菜单</li> */ private Integer user_source; /** * 新增的用户数量 */ private Integer new_user; /** * 取消关注的用户数量,new_user减去cancel_user即为净增用户数量 */ private Integer cancel_user; /** * 总用户量 */ private Integer cumulate_user; public String getRef_date() { return ref_date; } public void setRef_date(String ref_date) { this.ref_date = ref_date; } public Integer getUser_source() { return user_source; } public void setUser_source(Integer user_source) { this.user_source = user_source; } public Integer getNew_user() { return new_user; } public void setNew_user(Integer new_user) { this.new_user = new_user; } public Integer getCancel_user() { return cancel_user; } public void setCancel_user(Integer cancel_user) { this.cancel_user = cancel_user; } public Integer getCumulate_user() { return cumulate_user; } public void setCumulate_user(Integer cumulate_user) { this.cumulate_user = cumulate_user; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/util/WeiXinReqUtil.java
src/main/java/org/jeewx/api/core/util/WeiXinReqUtil.java
package org.jeewx.api.core.util; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; import org.jeewx.api.core.handler.WeiXinReqHandler; import org.jeewx.api.core.req.WeiXinReqService; import org.jeewx.api.core.req.model.WeixinReqConfig; import org.jeewx.api.core.req.model.WeixinReqParam; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.InputStream; import java.util.*; import java.util.Map.Entry; /** * 获取微信接口的信息 * @author liguo * */ public class WeiXinReqUtil { private static Logger logger = LoggerFactory.getLogger(WeiXinReqUtil.class); /** * 缓存请求配置 */ private static Map<String,WeixinReqConfig> REQ_MAPPING = new HashMap<String, WeixinReqConfig>(); /** * 缓存处理请求handler */ private static Map<String,WeiXinReqHandler> MAPPING_HANDLER = new HashMap<String, WeiXinReqHandler>(); /** * 文件类型content_type */ private static Properties file_content_type = null; /** * 通过名称获取对象 * @param className * @return */ public static Object getObjectByClassName(String className){ Class obj = null; try { obj = Class.forName(className); return obj.newInstance(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return obj; } /** * 初始化映射请求 * @param configName * @throws JDOMException * @throws IOException */ public static void initReqConfig(String configName) throws JDOMException, IOException{ InputStream is = WeiXinReqService.class.getClassLoader().getResourceAsStream(configName); SAXBuilder xmlBuilder = new SAXBuilder(); Document doc = xmlBuilder.build(is); Element objRoot = doc.getRootElement(); List<Element> lstMapping = objRoot.getChildren("req"); WeixinReqConfig objConfig = null; for(Element mapping :lstMapping){ String key = mapping.getAttribute("key").getValue(); String method = mapping.getAttribute("method").getValue(); String url = mapping.getAttribute("url").getValue(); String mappingHandler ="org.jeewx.api.core.handler.impl.WeixinReqDefaultHandler"; String datatype =WeiXinConstant.PARAM_DATA_TYPE; if(mapping.getAttribute("mappingHandler") != null){ mappingHandler = mapping.getAttribute("mappingHandler").getValue(); } if(mapping.getAttribute("datatype") != null){ datatype = mapping.getAttribute("datatype").getValue(); } objConfig = new WeixinReqConfig(); objConfig.setKey(key); objConfig.setMappingHandler(mappingHandler); objConfig.setMethod(method); objConfig.setUrl(url); objConfig.setDatatype(datatype); WeiXinReqUtil.registerMapping(key, objConfig); } } /** * 注册映射服务处理 * @param key * @param weixinReqConfig */ public static void registerMapping(String key,WeixinReqConfig weixinReqConfig){ WeiXinReqUtil.REQ_MAPPING.put(key, weixinReqConfig); } /** * 获取配置信息 * @param key * @return */ public static WeixinReqConfig getWeixinReqConfig(String key){ return WeiXinReqUtil.REQ_MAPPING.get(key); } /** * 注册映射服务处理 * @param key * @param weixinReqConfig */ public static WeiXinReqHandler getMappingHander(String className){ WeiXinReqHandler handler = WeiXinReqUtil.MAPPING_HANDLER.get(className); if(handler==null){ handler = (WeiXinReqHandler) getObjectByClassName(className); WeiXinReqUtil.MAPPING_HANDLER.put(className, handler); } return handler; } /** * 获取对象的map参数信息 * * @param weixinReqParam * @return */ public static Map getWeixinReqParam(WeixinReqParam weixinReqParam) { Map params = null; try{ String json = JSON.toJSONString(weixinReqParam); params = JSONObject.parseObject(json).toJavaObject(Map.class); }catch(Exception e){ logger.error("处理参数解析出错", e); params = new HashMap(); params.put("access_token", weixinReqParam.getAccess_token()); } return params; } /** * 获取参数的json信息 * * @param weixinReqParam * @return */ public static String getWeixinParamJson(WeixinReqParam weixinReqParam) { String json = JSON.toJSONString(weixinReqParam); return json; } /** * 获取文件对应的 http流类型 * * @param fileSuffix * @return */ public static String getFileContentType(String fileSuffix) { if (file_content_type == null) { file_content_type = new Properties(); InputStream in = WeiXinReqService.class.getClassLoader().getResourceAsStream("fie-content-type.properties"); try { file_content_type.load(in); in.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); file_content_type = new Properties(); } } return (String) file_content_type.get(fileSuffix); } /** * 获取文件对应的 http流类型 * * @param fileSuffix * @return */ public static String getFileSuffix(String contentType) { if (file_content_type == null) { file_content_type = new Properties(); InputStream in = WeiXinReqService.class.getClassLoader().getResourceAsStream("fie-content-type.properties"); try { file_content_type.load(in); in.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } String fileSuffix = ""; Set type = file_content_type.entrySet(); Iterator it = type.iterator(); while (it.hasNext()) { Map.Entry entity = (Entry) it.next(); if (entity.getValue().equals(contentType)) { fileSuffix = (String) entity.getKey(); break; } } return fileSuffix; } public static void main(String[] args) throws JDOMException, IOException{ String realPath = WeiXinReqUtil.class .getClassLoader().getResource("").getFile(); System.out.println(realPath); WeiXinReqUtil.initReqConfig("weixin-reqcongfig.xml"); /*Map<String,ActionConfig> mapActionConfig = MvcUtils.initStrutsConfig(); Set<String> actionSet = mapActionConfig.keySet(); for(Iterator it = actionSet.iterator();it.hasNext();){ System.out.println(it.next().toString()); }*/ } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/util/HttpRequestProxy.java
src/main/java/org/jeewx/api/core/util/HttpRequestProxy.java
package org.jeewx.api.core.util; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class HttpRequestProxy { /** * 连接超时 */ private static int connectTimeOut = 5000; /** * 读取数据超时 */ private static int readTimeOut = 10000; /** * 请求编码 */ public static String requestEncoding = "UTF-8"; private static Logger logger = LoggerFactory.getLogger(HttpRequestProxy.class); /** * <pre> * 发送带参数的GET的HTTP请求 * </pre> * * @param reqUrl * HTTP请求URL * @param parameters * 参数映射表 * @return HTTP响应的字符串 */ public static String doGet(String reqUrl, Map parameters, String recvEncoding) { HttpURLConnection url_con = null; String responseContent = null; try { url_con = doHttpGetConnection(reqUrl,parameters); InputStream in = url_con.getInputStream(); BufferedReader rd = new BufferedReader(new InputStreamReader(in, recvEncoding)); String tempLine = rd.readLine(); StringBuffer temp = new StringBuffer(); String crlf = System.getProperty("line.separator"); while (tempLine != null) { temp.append(tempLine); temp.append(crlf); tempLine = rd.readLine(); } responseContent = temp.toString(); rd.close(); in.close(); } catch (IOException e) { logger.error("网络故障", e); } finally { if (url_con != null) { url_con.disconnect(); } } return responseContent; } private static HttpURLConnection doHttpGetConnection(String reqUrl, Map parameters) throws IOException { HttpURLConnection url_con = null; String params = getMapParamsToStr(parameters,HttpRequestProxy.requestEncoding); URL url = new URL(reqUrl); url_con = (HttpURLConnection) url.openConnection(); url_con.setRequestMethod("GET"); //--update-begin---author:scott-------date:20170417--------for:设置网络超时时间------------------------- //设置网络超时 url_con.setConnectTimeout(6000); url_con.setReadTimeout(6000); //--update-begin---author:scott-------date:20170417--------for:设置网络超时时间------------------------- System.setProperty("sun.net.client.defaultConnectTimeout", String.valueOf(HttpRequestProxy.connectTimeOut));// (单位:毫秒)jdk1.4换成这个,连接超时 System.setProperty("sun.net.client.defaultReadTimeout", String.valueOf(HttpRequestProxy.readTimeOut)); // (单位:毫秒)jdk1.4换成这个,读操作超时 url_con.setDoOutput(true); byte[] b = params.toString().getBytes(); url_con.getOutputStream().write(b, 0, b.length); url_con.getOutputStream().flush(); url_con.getOutputStream().close(); return url_con; } /** * <pre> * 发送不带参数的GET的HTTP请求 * </pre> * * @param reqUrl * HTTP请求URL * @return HTTP响应的字符串 */ public static String doGet(String reqUrl, String recvEncoding) { HttpURLConnection url_con = null; String responseContent = null; try { StringBuffer params = new StringBuffer(); String queryUrl = reqUrl; int paramIndex = reqUrl.indexOf("?"); if (paramIndex > 0) { queryUrl = reqUrl.substring(0, paramIndex); String parameters = reqUrl.substring(paramIndex + 1, reqUrl.length()); String[] paramArray = parameters.split("&"); for (int i = 0; i < paramArray.length; i++) { String string = paramArray[i]; int index = string.indexOf("="); if (index > 0) { String parameter = string.substring(0, index); String value = string.substring(index + 1, string.length()); params.append(parameter); params.append("="); params.append(URLEncoder.encode(value, HttpRequestProxy.requestEncoding)); params.append("&"); } } params = params.deleteCharAt(params.length() - 1); } URL url = new URL(queryUrl); url_con = (HttpURLConnection) url.openConnection(); url_con.setRequestMethod("GET"); //--update-begin---author:scott-------date:20170417--------for:设置网络超时时间------------------------- //设置网络超时 url_con.setConnectTimeout(6000); url_con.setReadTimeout(6000); //--update-begin---author:scott-------date:20170417--------for:设置网络超时时间------------------------- System.setProperty("sun.net.client.defaultConnectTimeout", String.valueOf(HttpRequestProxy.connectTimeOut));// (单位:毫秒)jdk1.4换成这个,连接超时 System.setProperty("sun.net.client.defaultReadTimeout", String.valueOf(HttpRequestProxy.readTimeOut)); // (单位:毫秒)jdk1.4换成这个,读操作超时 url_con.setDoOutput(true); byte[] b = params.toString().getBytes(); url_con.getOutputStream().write(b, 0, b.length); url_con.getOutputStream().flush(); url_con.getOutputStream().close(); InputStream in = url_con.getInputStream(); BufferedReader rd = new BufferedReader(new InputStreamReader(in, recvEncoding)); String tempLine = rd.readLine(); StringBuffer temp = new StringBuffer(); String crlf = System.getProperty("line.separator"); while (tempLine != null) { temp.append(tempLine); temp.append(crlf); tempLine = rd.readLine(); } responseContent = temp.toString(); rd.close(); in.close(); } catch (IOException e) { logger.error("网络故障", e); } finally { if (url_con != null) { url_con.disconnect(); } } return responseContent; } /** * <pre> * 发送带参数的POST的HTTP请求 * </pre> * * @param reqUrl * HTTP请求URL * @param parameters * 参数映射表 * @return HTTP响应的字符串 */ public static String doPost(String reqUrl, Map parameters, String recvEncoding) { HttpURLConnection url_con = null; String responseContent = null; try { String params = getMapParamsToStr(parameters,HttpRequestProxy.requestEncoding); URL url = new URL(reqUrl); url_con = (HttpURLConnection) url.openConnection(); //--update-begin---author:scott-------date:20170417--------for:设置网络超时时间------------------------- //设置网络超时 url_con.setConnectTimeout(6000); url_con.setReadTimeout(6000); //--update-begin---author:scott-------date:20170417--------for:设置网络超时时间------------------------- url_con.setRequestMethod("POST"); System.setProperty("sun.net.client.defaultConnectTimeout", String.valueOf(HttpRequestProxy.connectTimeOut));// (单位:毫秒)jdk1.4换成这个,连接超时 System.setProperty("sun.net.client.defaultReadTimeout", String.valueOf(HttpRequestProxy.readTimeOut)); // (单位:毫秒)jdk1.4换成这个,读操作超时 url_con.setDoOutput(true); byte[] b = params.toString().getBytes(); url_con.getOutputStream().write(b, 0, b.length); url_con.getOutputStream().flush(); url_con.getOutputStream().close(); InputStream in = url_con.getInputStream(); BufferedReader rd = new BufferedReader(new InputStreamReader(in, recvEncoding)); String tempLine = rd.readLine(); StringBuffer tempStr = new StringBuffer(); String crlf = System.getProperty("line.separator"); while (tempLine != null) { tempStr.append(tempLine); tempStr.append(crlf); tempLine = rd.readLine(); } responseContent = tempStr.toString(); rd.close(); in.close(); } catch (IOException e) { logger.error("网络故障", e); } finally { if (url_con != null) { url_con.disconnect(); } } return responseContent; } /** * <pre> * 发送带参数的POST的HTTP请求 * </pre> * * @param reqUrl * HTTP请求URL * @param parameters * 参数映射表 * @return HTTP响应的字符串 */ public static String doJsonPost(String reqUrl, Map parameters, String jsonData) { HttpURLConnection url_con = null; String responseContent = null; try { String params = getMapParamsToStr(parameters,HttpRequestProxy.requestEncoding); URL url = new URL(reqUrl+"&"+params); url_con = (HttpURLConnection) url.openConnection(); //--update-begin---author:scott-------date:20170417--------for:设置网络超时时间------------------------- //设置网络超时 url_con.setConnectTimeout(6000); url_con.setReadTimeout(6000); //--update-begin---author:scott-------date:20170417--------for:设置网络超时时间------------------------- url_con.setRequestMethod("POST"); System.setProperty("sun.net.client.defaultConnectTimeout", String.valueOf(HttpRequestProxy.connectTimeOut));// (单位:毫秒)jdk1.4换成这个,连接超时 System.setProperty("sun.net.client.defaultReadTimeout", String.valueOf(HttpRequestProxy.readTimeOut)); // (单位:毫秒)jdk1.4换成这个,读操作超时 url_con.setDoOutput(true); url_con.setRequestProperty("Accept", "application/json;charset=UTF-8"); // 设置接收数据的格式 url_con.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); // 设置发送数据的格式 byte[] b = jsonData.toString().getBytes("UTF-8"); url_con.getOutputStream().write(b, 0, b.length); url_con.getOutputStream().flush(); url_con.getOutputStream().close(); InputStream in = url_con.getInputStream(); BufferedReader rd = new BufferedReader(new InputStreamReader(in, HttpRequestProxy.requestEncoding)); String tempLine = rd.readLine(); StringBuffer tempStr = new StringBuffer(); String crlf = System.getProperty("line.separator"); while (tempLine != null) { tempStr.append(tempLine); tempStr.append(crlf); tempLine = rd.readLine(); } responseContent = tempStr.toString(); rd.close(); in.close(); } catch (IOException e) { logger.error("网络故障", e); } finally { if (url_con != null) { url_con.disconnect(); } } return responseContent; } /** * * @param reqUrl * @param parameters * @param recvEncoding * @param fileIn * 文件流 * @return */ public static String uploadMedia(String reqUrl, Map parameters, String recvEncoding, InputStream fileIn, String fileName, String contentType) { HttpURLConnection url_con = null; String responseContent = null; try { // 设置边界 String BOUNDARY = "----------" + System.currentTimeMillis(); String params = getMapParamsToStr(parameters,HttpRequestProxy.requestEncoding); URL urlObj = new URL(reqUrl + "&" + params.toString()); // 连接 url_con = (HttpURLConnection) urlObj.openConnection(); /** * 设置关键值 */ url_con.setRequestMethod("POST"); // 以Post方式提交表单,默认get方式 url_con.setDoInput(true); url_con.setDoOutput(true); url_con.setUseCaches(false); // post方式不能使用缓存 // 设置请求头信息 url_con.setRequestProperty("Connection", "Keep-Alive"); url_con.setRequestProperty("Charset",recvEncoding); // 设置边界 url_con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY); // 请求正文信息 // 第一部分: StringBuilder sb = new StringBuilder(); sb.append("--"); // 必须多两道线 sb.append(BOUNDARY); sb.append("\r\n"); sb.append("Content-Disposition: form-data;name=\"file\";filename=\"" + fileName + "\"\r\n"); sb.append("Content-Type:application/octet-stream\r\n\r\n"); byte[] head = sb.toString().getBytes(recvEncoding); // 获得输出流 OutputStream out = new DataOutputStream(url_con.getOutputStream()); // 输出表头 out.write(head); // 文件正文部分 // 把文件已流文件的方式 推入到url中 DataInputStream in = new DataInputStream(fileIn); int bytes = 0; byte[] bufferOut = new byte[1024]; while ((bytes = in.read(bufferOut)) != -1) { out.write(bufferOut, 0, bytes); } in.close(); // 结尾部分 byte[] foot = ("\r\n--" + BOUNDARY + "--\r\n").getBytes(recvEncoding);// 定义最后数据分隔线 out.write(foot); out.flush(); out.close(); InputStream iddn = url_con.getInputStream(); BufferedReader rd = new BufferedReader(new InputStreamReader(iddn, recvEncoding)); String tempLine = rd.readLine(); StringBuffer tempStr = new StringBuffer(); String crlf = System.getProperty("line.separator"); while (tempLine != null) { tempStr.append(tempLine); tempStr.append(crlf); tempLine = rd.readLine(); } responseContent = tempStr.toString(); rd.close(); } catch (IOException e) { logger.error("网络故障", e); } finally { if (url_con != null) { url_con.disconnect(); } } return responseContent; } /** * 将参数转换成string * @param paramMap * @param requestEncoding * @return * @throws UnsupportedEncodingException */ private static String getMapParamsToStr(Map paramMap,String requestEncoding) throws IOException{ StringBuffer params = new StringBuffer(); // 设置边界 for (Iterator iter = paramMap.entrySet().iterator(); iter .hasNext();) { Entry element = (Entry) iter.next(); params.append(element.getKey().toString()); params.append("="); params.append(URLEncoder.encode(element.getValue().toString(), requestEncoding)); params.append("&"); } if (params.length() > 0) { params = params.deleteCharAt(params.length() - 1); } return params.toString(); } /** * <pre> * 发送带参数的GET的HTTP请求 * </pre> * * @param reqUrl * HTTP请求URL * @param parameters * 参数映射表 * @return HTTP响应的字符串 */ public static String downMadGet(String reqUrl, Map parameters, String recvEncoding,String filePath,String media_id) { HttpURLConnection url_con = null; String responseContent = null; try { url_con = doHttpGetConnection(reqUrl,parameters); String fileContentType = url_con.getHeaderField("Content-Type"); InputStream in = url_con.getInputStream(); if("text/plain".equals(fileContentType)){ BufferedReader rd = new BufferedReader(new InputStreamReader(in, recvEncoding)); responseContent = rd.readLine(); rd.close(); }else{ String fileSuffix = WeiXinReqUtil.getFileSuffix(fileContentType); BufferedInputStream bis = new BufferedInputStream(in); String fileName = media_id+"."+fileSuffix; String filePathName = filePath+File.separator+fileName; byte[] buf = new byte[8096]; OutputStream fileOut = new FileOutputStream(new File(filePathName)); int size = 0; while ((size = bis.read(buf)) != -1) { fileOut.write(buf, 0, size); } fileOut.flush(); fileOut.close(); bis.close(); responseContent = "{filepath:'"+filePath+"',fileName:'"+fileName+"'}"; } System.out.println(fileContentType); in.close(); } catch (IOException e) { logger.error("网络故障", e); } finally { if (url_con != null) { url_con.disconnect(); } } return responseContent; } /** * @return 连接超时(毫秒) * @see com.hengpeng.common.web.HttpRequestProxy#connectTimeOut */ public static int getConnectTimeOut() { return HttpRequestProxy.connectTimeOut; } /** * @return 读取数据超时(毫秒) * @see com.hengpeng.common.web.HttpRequestProxy#readTimeOut */ public static int getReadTimeOut() { return HttpRequestProxy.readTimeOut; } /** * @return 请求编码 * @see com.hengpeng.common.web.HttpRequestProxy#requestEncoding */ public static String getRequestEncoding() { return requestEncoding; } /** * @param connectTimeOut * 连接超时(毫秒) * @see com.hengpeng.common.web.HttpRequestProxy#connectTimeOut */ public static void setConnectTimeOut(int connectTimeOut) { HttpRequestProxy.connectTimeOut = connectTimeOut; } /** * @param readTimeOut * 读取数据超时(毫秒) * @see com.hengpeng.common.web.HttpRequestProxy#readTimeOut */ public static void setReadTimeOut(int readTimeOut) { HttpRequestProxy.readTimeOut = readTimeOut; } /** * @param requestEncoding * 请求编码 * @see com.hengpeng.common.web.HttpRequestProxy#requestEncoding */ public static void setRequestEncoding(String requestEncoding) { HttpRequestProxy.requestEncoding = requestEncoding; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/util/FileUtils.java
src/main/java/org/jeewx/api/core/util/FileUtils.java
package org.jeewx.api.core.util; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; /** * 文件操作代码 * * @author cn.outofmemory * @date 2013-1-7 */ public class FileUtils { /** * 将文本文件中的内容读入到buffer中 * @param buffer buffer * @param filePath 文件路径 * @throws IOException 异常 * @author cn.outofmemory * @date 2013-1-7 */ public static void readToBuffer(StringBuffer buffer, String filePath) throws IOException { InputStream is = new FileInputStream(filePath); String line; // 用来保存每行读取的内容 BufferedReader reader = new BufferedReader(new InputStreamReader(is)); line = reader.readLine(); // 读取第一行 while (line != null) { // 如果 line 为空说明读完了 buffer.append(line); // 将读到的内容添加到 buffer 中 buffer.append("\n"); // 添加换行符 line = reader.readLine(); // 读取下一行 } reader.close(); is.close(); } /** * 读取文本文件内容 * @param filePath 文件所在路径 * @return 文本内容 * @throws IOException 异常 * @author cn.outofmemory * @date 2013-1-7 */ public static String readFile(String filePath) throws IOException { StringBuffer sb = new StringBuffer(); FileUtils.readToBuffer(sb, filePath); return sb.toString(); } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/util/WeiXinConstant.java
src/main/java/org/jeewx/api/core/util/WeiXinConstant.java
package org.jeewx.api.core.util; /** * 获取微信接口的信息 * @author liguo * */ public class WeiXinConstant { /** * JSON数据格式类型 */ public static String JSON_DATA_TYPE = "JSON"; /** * keg--value参数类型 */ public static String PARAM_DATA_TYPE = "PARAM"; /** * post请求类型 */ public static String REQUEST_POST = "POST"; /** * get请求类型 */ public static String REQUEST_GET = "GET"; /** * 返回的错误代码信息 */ public static String RETURN_ERROR_INFO_CODE = "errcode"; /** * 返回的错误信息 */ public static String RETURN_ERROR_INFO_MSG = "errmsg"; }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/util/DateUtils.java
src/main/java/org/jeewx/api/core/util/DateUtils.java
package org.jeewx.api.core.util; import java.beans.PropertyEditorSupport; import java.sql.Timestamp; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; /** * * 类描述:时间操作定义类 * * @author: jeecg * @date: 日期:2012-12-8 时间:下午12:15:03 * @version 1.0 */ public class DateUtils extends PropertyEditorSupport { // 各种时间格式 public static final SimpleDateFormat date_sdf = new SimpleDateFormat( "yyyy-MM-dd"); // 各种时间格式 public static final SimpleDateFormat yyyyMMdd = new SimpleDateFormat( "yyyyMMdd"); // 各种时间格式 public static final SimpleDateFormat date_sdf_wz = new SimpleDateFormat( "yyyy年MM月dd日"); public static final SimpleDateFormat time_sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm"); public static final SimpleDateFormat yyyymmddhhmmss = new SimpleDateFormat( "yyyyMMddHHmmss"); public static final SimpleDateFormat short_time_sdf = new SimpleDateFormat( "HH:mm"); public static final SimpleDateFormat datetimeFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); // 以毫秒表示的时间 private static final long DAY_IN_MILLIS = 24 * 3600 * 1000; private static final long HOUR_IN_MILLIS = 3600 * 1000; private static final long MINUTE_IN_MILLIS = 60 * 1000; private static final long SECOND_IN_MILLIS = 1000; // 指定模式的时间格式 private static SimpleDateFormat getSDFormat(String pattern) { return new SimpleDateFormat(pattern); } /** * 两个时间比较日期大小(明确到天) */ public static boolean wxHuoDongDateVS(Date startDate,Date endDate){ String startDate_str = DateUtils.date2Str(startDate , DateUtils.date_sdf); String endDate_str = DateUtils.date2Str(endDate , DateUtils.date_sdf); int v = compare_date(endDate_str,startDate_str); if(v==1){ return true; }else if(v==0){ return true; }else{ return false; } } public static int compare_date(String DATE1, String DATE2) { DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); try { Date dt1 = df.parse(DATE1); Date dt2 = df.parse(DATE2); if (dt1.getTime() > dt2.getTime()) { //System.out.println("dt1 大于 dt2前"); return 1; } else if (dt1.getTime() < dt2.getTime()) { //System.out.println("dt1 小于 dt2后"); return -1; } else { return 0; } } catch (Exception exception) { exception.printStackTrace(); } return 0; } /** * 当前日历,这里用中国时间表示 * * @return 以当地时区表示的系统当前日历 */ public static Calendar getCalendar() { return Calendar.getInstance(); } /** * 指定毫秒数表示的日历 * * @param millis * 毫秒数 * @return 指定毫秒数表示的日历 */ public static Calendar getCalendar(long millis) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date(millis)); return cal; } /** * 时间转字符串 * @return */ public static String date2SStr() { Date date=getDate(); if (null == date) { return null; } return yyyyMMdd.format(date); } // //////////////////////////////////////////////////////////////////////////// // getDate // 各种方式获取的Date // //////////////////////////////////////////////////////////////////////////// /** * 当前日期 * * @return 系统当前时间 */ public static Date getDate() { return new Date(); } /** * 当前日期 * * @return 系统当前时间 */ public static Date getDateTime() { return Calendar.getInstance().getTime(); } public static void main(String[] args) { // System.out.println(getDateTime()); System.out.println(DateUtils.getAddDate(new Date(),-10)); } /** * 指定毫秒数表示的日期 * * @param millis * 毫秒数 * @return 指定毫秒数表示的日期 */ public static Date getDate(long millis) { return new Date(millis); } /** * 时间戳转换为字符串 * * @param time * @return */ public static String timestamptoStr(Timestamp time) { Date date = null; if (null != time) { date = new Date(time.getTime()); } return date2Str(date_sdf); } /** * 字符串转换时间戳 * * @param str * @return */ public static Timestamp str2Timestamp(String str) { Date date = str2Date(str, date_sdf); return new Timestamp(date.getTime()); } /** * 字符串转换成日期 * @param str * @param sdf * @return */ public static Date str2Date(String str, SimpleDateFormat sdf) { if (null == str || "".equals(str)) { return null; } Date date = null; try { date = sdf.parse(str); return date; } catch (ParseException e) { e.printStackTrace(); } return null; } /** * 日期转换为字符串 * * @param date * 日期 * @param format * 日期格式 * @return 字符串 */ public static String date2Str(SimpleDateFormat date_sdf) { Date date=getDate(); if (null == date) { return null; } return date_sdf.format(date); } /** * 格式化时间 * @param data * @param format * @return */ public static String dataformat(String data,String format) { SimpleDateFormat sformat = new SimpleDateFormat(format); Date date=null; try { date=sformat.parse(data); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return sformat.format(date); } /** * 日期转换为字符串 * * @param date * 日期 * @param format * 日期格式 * @return 字符串 */ public static String date2Str(Date date, SimpleDateFormat date_sdf) { if (null == date) { return null; } return date_sdf.format(date); } /** * 日期转换为字符串 * * @param date * 日期 * @param format * 日期格式 * @return 字符串 */ public static String getDate(String format) { Date date=new Date(); if (null == date) { return null; } SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); } /** * 指定毫秒数的时间戳 * * @param millis * 毫秒数 * @return 指定毫秒数的时间戳 */ public static Timestamp getTimestamp(long millis) { return new Timestamp(millis); } /** * 以字符形式表示的时间戳 * * @param time * 毫秒数 * @return 以字符形式表示的时间戳 */ public static Timestamp getTimestamp(String time) { return new Timestamp(Long.parseLong(time)); } /** * 系统当前的时间戳 * * @return 系统当前的时间戳 */ public static Timestamp getTimestamp() { return new Timestamp(new Date().getTime()); } /** * 指定日期的时间戳 * * @param date * 指定日期 * @return 指定日期的时间戳 */ public static Timestamp getTimestamp(Date date) { return new Timestamp(date.getTime()); } /** * 指定日历的时间戳 * * @param cal * 指定日历 * @return 指定日历的时间戳 */ public static Timestamp getCalendarTimestamp(Calendar cal) { return new Timestamp(cal.getTime().getTime()); } public static Timestamp gettimestamp() { Date dt = new Date(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String nowTime = df.format(dt); java.sql.Timestamp buydate = java.sql.Timestamp.valueOf(nowTime); return buydate; } // //////////////////////////////////////////////////////////////////////////// // getMillis // 各种方式获取的Millis // //////////////////////////////////////////////////////////////////////////// /** * 系统时间的毫秒数 * * @return 系统时间的毫秒数 */ public static long getMillis() { return new Date().getTime(); } /** * 指定日历的毫秒数 * * @param cal * 指定日历 * @return 指定日历的毫秒数 */ public static long getMillis(Calendar cal) { return cal.getTime().getTime(); } /** * 指定日期的毫秒数 * * @param date * 指定日期 * @return 指定日期的毫秒数 */ public static long getMillis(Date date) { return date.getTime(); } /** * 指定时间戳的毫秒数 * * @param ts * 指定时间戳 * @return 指定时间戳的毫秒数 */ public static long getMillis(Timestamp ts) { return ts.getTime(); } // //////////////////////////////////////////////////////////////////////////// // formatDate // 将日期按照一定的格式转化为字符串 // //////////////////////////////////////////////////////////////////////////// /** * 默认方式表示的系统当前日期,具体格式:年-月-日 * * @return 默认日期按“年-月-日“格式显示 */ public static String formatDate() { return date_sdf.format(getCalendar().getTime()); } /** * 获取时间字符串 */ public static String getDataString(SimpleDateFormat formatstr) { return formatstr.format(getCalendar().getTime()); } /** * 指定日期的默认显示,具体格式:年-月-日 * * @param cal * 指定的日期 * @return 指定日期按“年-月-日“格式显示 */ public static String formatDate(Calendar cal) { return date_sdf.format(cal.getTime()); } /** * 指定日期的默认显示,具体格式:年-月-日 * * @param date * 指定的日期 * @return 指定日期按“年-月-日“格式显示 */ public static String formatDate(Date date) { return date_sdf.format(date); } /** * 指定毫秒数表示日期的默认显示,具体格式:年-月-日 * * @param millis * 指定的毫秒数 * @return 指定毫秒数表示日期按“年-月-日“格式显示 */ public static String formatDate(long millis) { return date_sdf.format(new Date(millis)); } /** * 默认日期按指定格式显示 * * @param pattern * 指定的格式 * @return 默认日期按指定格式显示 */ public static String formatDate(String pattern) { return getSDFormat(pattern).format(getCalendar().getTime()); } /** * 指定日期按指定格式显示 * * @param cal * 指定的日期 * @param pattern * 指定的格式 * @return 指定日期按指定格式显示 */ public static String formatDate(Calendar cal, String pattern) { return getSDFormat(pattern).format(cal.getTime()); } /** * 指定日期按指定格式显示 * * @param date * 指定的日期 * @param pattern * 指定的格式 * @return 指定日期按指定格式显示 */ public static String formatDate(Date date, String pattern) { return getSDFormat(pattern).format(date); } // //////////////////////////////////////////////////////////////////////////// // formatTime // 将日期按照一定的格式转化为字符串 // //////////////////////////////////////////////////////////////////////////// /** * 默认方式表示的系统当前日期,具体格式:年-月-日 时:分 * * @return 默认日期按“年-月-日 时:分“格式显示 */ public static String formatTime() { return time_sdf.format(getCalendar().getTime()); } /** * 指定毫秒数表示日期的默认显示,具体格式:年-月-日 时:分 * * @param millis * 指定的毫秒数 * @return 指定毫秒数表示日期按“年-月-日 时:分“格式显示 */ public static String formatTime(long millis) { return time_sdf.format(new Date(millis)); } /** * 指定日期的默认显示,具体格式:年-月-日 时:分 * * @param cal * 指定的日期 * @return 指定日期按“年-月-日 时:分“格式显示 */ public static String formatTime(Calendar cal) { return time_sdf.format(cal.getTime()); } /** * 指定日期的默认显示,具体格式:年-月-日 时:分 * * @param date * 指定的日期 * @return 指定日期按“年-月-日 时:分“格式显示 */ public static String formatTime(Date date) { return time_sdf.format(date); } // //////////////////////////////////////////////////////////////////////////// // formatShortTime // 将日期按照一定的格式转化为字符串 // //////////////////////////////////////////////////////////////////////////// /** * 默认方式表示的系统当前日期,具体格式:时:分 * * @return 默认日期按“时:分“格式显示 */ public static String formatShortTime() { return short_time_sdf.format(getCalendar().getTime()); } /** * 指定毫秒数表示日期的默认显示,具体格式:时:分 * * @param millis * 指定的毫秒数 * @return 指定毫秒数表示日期按“时:分“格式显示 */ public static String formatShortTime(long millis) { return short_time_sdf.format(new Date(millis)); } /** * 指定日期的默认显示,具体格式:时:分 * * @param cal * 指定的日期 * @return 指定日期按“时:分“格式显示 */ public static String formatShortTime(Calendar cal) { return short_time_sdf.format(cal.getTime()); } /** * 指定日期的默认显示,具体格式:时:分 * * @param date * 指定的日期 * @return 指定日期按“时:分“格式显示 */ public static String formatShortTime(Date date) { return short_time_sdf.format(date); } // //////////////////////////////////////////////////////////////////////////// // parseDate // parseCalendar // parseTimestamp // 将字符串按照一定的格式转化为日期或时间 // //////////////////////////////////////////////////////////////////////////// /** * 根据指定的格式将字符串转换成Date 如输入:2003-11-19 11:20:20将按照这个转成时间 * * @param src * 将要转换的原始字符窜 * @param pattern * 转换的匹配格式 * @return 如果转换成功则返回转换后的日期 * @throws ParseException * @throws AIDateFormatException */ public static Date parseDate(String src, String pattern) throws ParseException { if(src==null||src.length()<=0){ return null; } return getSDFormat(pattern).parse(src); } /** * 根据指定的格式将字符串转换成Date 如输入:2003-11-19 11:20:20将按照这个转成时间 * * @param src * 将要转换的原始字符窜 * @param pattern * 转换的匹配格式 * @return 如果转换成功则返回转换后的日期 * @throws ParseException * @throws AIDateFormatException */ public static Calendar parseCalendar(String src, String pattern) throws ParseException { Date date = parseDate(src, pattern); Calendar cal = Calendar.getInstance(); cal.setTime(date); return cal; } public static String formatAddDate(String src, String pattern, int amount) throws ParseException { Calendar cal; cal = parseCalendar(src, pattern); cal.add(Calendar.DATE, amount); return formatDate(cal); } /** * 方法描述: 几天后的时间 * 作 者: yiming.zhang * 日 期: 2015年5月4日-下午10:32:45 * @param beginDate * @param offsetDay 正表示几天后,负表示几天前 * @return * 返回类型: Date */ public static Date getAddDate(Date beginDate, int offsetDay) { Calendar beginDateCal = Calendar.getInstance(); beginDateCal.setTime(beginDate); beginDateCal.add(Calendar.DATE, offsetDay); return new Timestamp(beginDateCal.getTime().getTime()); } /** * @param offsetDay * @return 当前时间 + offsetDay */ public static Timestamp getCurrentTimestampExpiredDay(int offsetDay) { Calendar now = Calendar.getInstance(); now.add(Calendar.DATE, offsetDay); return new Timestamp(now.getTime().getTime()); } /** * 根据指定的格式将字符串转换成Date 如输入:2003-11-19 11:20:20将按照这个转成时间 * * @param src * 将要转换的原始字符窜 * @param pattern * 转换的匹配格式 * @return 如果转换成功则返回转换后的时间戳 * @throws ParseException * @throws AIDateFormatException */ public static Timestamp parseTimestamp(String src, String pattern) throws ParseException { Date date = parseDate(src, pattern); return new Timestamp(date.getTime()); } // //////////////////////////////////////////////////////////////////////////// // dateDiff // 计算两个日期之间的差值 // //////////////////////////////////////////////////////////////////////////// /** * 计算两个时间之间的差值,根据标志的不同而不同 * * @param flag * 计算标志,表示按照年/月/日/时/分/秒等计算 * @param calSrc * 减数 * @param calDes * 被减数 * @return 两个日期之间的差值 */ public static int dateDiff(char flag, Calendar calSrc, Calendar calDes) { long millisDiff = getMillis(calSrc) - getMillis(calDes); if (flag == 'y') { return (calSrc.get(calSrc.YEAR) - calDes.get(calDes.YEAR)); } if (flag == 'd') { return (int) (millisDiff / DAY_IN_MILLIS); } if (flag == 'h') { return (int) (millisDiff / HOUR_IN_MILLIS); } if (flag == 'm') { return (int) (millisDiff / MINUTE_IN_MILLIS); } if (flag == 's') { return (int) (millisDiff / SECOND_IN_MILLIS); } return 0; } /** * String类型 转换为Date, * 如果参数长度为10 转换格式”yyyy-MM-dd“ *如果参数长度为19 转换格式”yyyy-MM-dd HH:mm:ss“ * * @param text * String类型的时间值 */ public static int getYear(){ GregorianCalendar calendar=new GregorianCalendar(); calendar.setTime(getDate()); return calendar.get(Calendar.YEAR); } /** * 获取一天的最大时间 * @param date * @param days * @return * @throws ParseException */ public static Date getDayMaxTime(Date date) throws ParseException{ Calendar ca = Calendar.getInstance(); ca.setTime(date); ca.set(Calendar.HOUR_OF_DAY, 23); ca.set(Calendar.MINUTE, 59); ca.set(Calendar.SECOND, 59); ca.set(Calendar.MILLISECOND, ca.getActualMaximum(Calendar.MILLISECOND)); return ca.getTime(); } /** * 获取一天的最小时间 * @param date * @param days * @return * @throws ParseException */ public static Date getDayMinTime(Date date) throws ParseException{ Calendar ca = Calendar.getInstance(); ca.setTime(date); ca.set(Calendar.HOUR_OF_DAY, 00); ca.set(Calendar.MINUTE, 00); ca.set(Calendar.SECOND, 00); ca.set(Calendar.MILLISECOND, ca.getActualMinimum(Calendar.MILLISECOND)); return ca.getTime(); } /** * 时间转换为字符串 * * @param time * @return */ public static String datetoStr(Date d, String pattern) { if (d == null) { return null; } SimpleDateFormat sdFormat = getSDFormat(pattern); return sdFormat.format(d); } /** * 比较时间是否与系统时间相等 * @param date * @return */ public static boolean compareDateVsCurrentDate(Date date){ if(date==null){return false;} Date nowdate = new Date(); String nowdateStr = DateUtils.date2Str(nowdate, date_sdf); String vsdate = DateUtils.date2Str(date, date_sdf); if(nowdateStr.equals(vsdate)){ return true; }else{ return false; } } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/WeiXinReqService.java
src/main/java/org/jeewx/api/core/req/WeiXinReqService.java
package org.jeewx.api.core.req; import com.alibaba.fastjson.JSONObject; import org.jdom.JDOMException; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.exception.WexinReqException; import org.jeewx.api.core.handler.WeiXinReqHandler; import org.jeewx.api.core.req.model.DownloadMedia; import org.jeewx.api.core.req.model.WeixinReqConfig; import org.jeewx.api.core.req.model.WeixinReqParam; import org.jeewx.api.core.util.WeiXinConstant; import org.jeewx.api.core.util.WeiXinReqUtil; import java.io.IOException; /** * 获取微信接口的信息 * * @author liguo * */ public class WeiXinReqService { private static WeiXinReqService weiXinReqUtil = null; private WeiXinReqService() { String realPath = WeiXinReqService.class.getClassLoader().getResource("").getFile(); try { WeiXinReqUtil.initReqConfig("weixin-reqcongfig.xml"); } catch (JDOMException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } /** * 获取公共的调用处理 * @return */ public static WeiXinReqService getInstance() { if (weiXinReqUtil == null) { // 同步块,线程安全的创建实例 synchronized (WeiXinReqService.class) { // 再次检查实例是否存在,如果不存在才真正的创建实例 if (weiXinReqUtil == null) { weiXinReqUtil = new WeiXinReqService(); } } } return weiXinReqUtil; } /** * 传入请求的参数,获取对应额接口返回信息 * @param weixinReqParam * @return * @throws WexinReqException */ public String doWeinxinReq(WeixinReqParam weixinReqParam) throws WexinReqException { String strReturnInfo = ""; if (weixinReqParam.getClass().isAnnotationPresent(ReqType.class)) { ReqType reqType = weixinReqParam.getClass().getAnnotation(ReqType.class); WeixinReqConfig objConfig = WeiXinReqUtil.getWeixinReqConfig(reqType.value()); WeiXinReqHandler handler = WeiXinReqUtil.getMappingHander(objConfig.getMappingHandler()); strReturnInfo = handler.doRequest(weixinReqParam); } return strReturnInfo; } /** * 返回json对象 * @param weixinReqParam * @return * @throws WexinReqException */ public JSONObject doWeinxinReqJson(WeixinReqParam weixinReqParam) throws WexinReqException{ String strResult = this.doWeinxinReq(weixinReqParam); JSONObject result = JSONObject.parseObject(strResult); Object error = result.get(WeiXinConstant.RETURN_ERROR_INFO_CODE); if(error !=null && Integer.parseInt(error.toString())!=0){ throw new WexinReqException(result.toString()); } return result; } public static void main(String[] args) { String ddd = ""; try { // GroupGet g = new GroupGet(); /* * GroupUpdate g = new GroupUpdate(); Group gg = new Group(); * gg.setId("111"); gg.setName("test修改"); g.setGroup(gg);*/ DownloadMedia g = new DownloadMedia(); g.setFilePath("H:/temp"); g.setMedia_id("nH-tzebPcZY41Hlao3mjPHpUHHJSIbfP8hbGJy73LUj5BfvVDV9b84uIpZ8Yjlzw"); g.setAccess_token("bbkXUUyC6F85R_vh7FOokDZn54P4jY6RVg8rvtzd0D10nIgd7Ksg7bBc8mncX6SZ1mMEI7v1q1OBtWoWG8--iR6ohe3kXbx5jUTHGAjGPAU"); ddd = WeiXinReqService.getInstance().doWeinxinReq(g); // test.getKfaccountList("NG0cpHAPJix5bULT26Hvk9pX5ZOqleIObl9HNKUfPA2PIxJzf-X4U-YOGP4vo-rdwvCy3GCn7v9GNTXNWVM27qEQz-Xs3fgAnj0kdhL07gI"); // test.getServieIp("QsLy729ukRchgw4O3bQvO2UwD0vn2zQ1I0TjZa2kx-dGX9TEFuVCGd7K9AsBhdfynUAaEWVILeDNS7OQXTKZdX1YxbnNqyVBfDmW9I63WWc"); // test.getUploadMedia("QsLy729ukRchgw4O3bQvO2UwD0vn2zQ1I0TjZa2kx-dGX9TEFuVCGd7K9AsBhdfynUAaEWVILeDNS7OQXTKZdX1YxbnNqyVBfDmW9I63WWc"); // ddd = // test.getDownMedia("QsLy729ukRchgw4O3bQvO2UwD0vn2zQ1I0TjZa2kx-dGX9TEFuVCGd7K9AsBhdfynUAaEWVILeDNS7OQXTKZdX1YxbnNqyVBfDmW9I63WWc"); System.out.println(ddd); } catch (WexinReqException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/ServiceIP.java
src/main/java/org/jeewx/api/core/req/model/ServiceIP.java
package org.jeewx.api.core.req.model; import org.jeewx.api.core.annotation.ReqType; /** * 如果公众号基于安全等考虑,需要获知微信服务器的IP地址列表, * 以便进行相关限制,可以通过该接口获得微信服务器IP地址列表 * @author sfli.sir * */ @ReqType("getcallbackip") public class ServiceIP extends WeixinReqParam { }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/UploadMedia.java
src/main/java/org/jeewx/api/core/req/model/UploadMedia.java
package org.jeewx.api.core.req.model; import org.jeewx.api.core.annotation.ReqType; /** * 公众号可调用本接口来上传图片、语音、视频等文件到微信服务器, * 上传后服务器会返回对应的media_id,公众号此后可根据该media_id来获取多媒体 * @author sfli.sir * */ @ReqType("mediaUpload") public class UploadMedia extends WeixinReqParam { /** * 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) */ private String type; /** * 上传的文件路径,带文件名称 */ private String filePathName; public String getType() { return type; } public void setType(String type) { this.type = type; } public String getFilePathName() { return filePathName; } public void setFilePathName(String filePathName) { this.filePathName = filePathName; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/AccessToken.java
src/main/java/org/jeewx/api/core/req/model/AccessToken.java
package org.jeewx.api.core.req.model; import org.jeewx.api.core.annotation.ReqType; @ReqType("access_token") public class AccessToken extends WeixinReqParam{ /** * 获取access_token填写client_credential */ private String grant_type="client_credential"; /** * 第三方用户唯一凭证 */ private String appid; /** * 第三方用户唯一凭证密钥,即appsecret */ private String secret; public String getGrant_type() { return grant_type; } public void setGrant_type(String grant_type) { this.grant_type = grant_type; } public String getAppid() { return appid; } public void setAppid(String appid) { this.appid = appid; } public String getSecret() { return secret; } public void setSecret(String secret) { this.secret = secret; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/WeixinReqConfig.java
src/main/java/org/jeewx/api/core/req/model/WeixinReqConfig.java
package org.jeewx.api.core.req.model; /** * 配置信息 * @author sfli.sir * */ public class WeixinReqConfig { private String key; private String url; private String method; private String mappingHandler; private String datatype; public String getDatatype() { return datatype; } public void setDatatype(String datatype) { this.datatype = datatype; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getMethod() { return method; } public void setMethod(String method) { this.method = method; } public String getMappingHandler() { return mappingHandler; } public void setMappingHandler(String mappingHandler) { this.mappingHandler = mappingHandler; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/DownloadMedia.java
src/main/java/org/jeewx/api/core/req/model/DownloadMedia.java
package org.jeewx.api.core.req.model; import org.jeewx.api.core.annotation.ReqType; /** * 下载多媒体文件 * * @author sfli.sir * */ @ReqType("mediaget") public class DownloadMedia extends WeixinReqParam { /** * 媒体信息id */ private String media_id; /** * 下载存储的文件目录 */ private String filePath; public String getMedia_id() { return media_id; } public void setMedia_id(String media_id) { this.media_id = media_id; } public String getFilePath() { return filePath; } public void setFilePath(String filePath) { this.filePath = filePath; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/WeixinReqParam.java
src/main/java/org/jeewx/api/core/req/model/WeixinReqParam.java
package org.jeewx.api.core.req.model; /** * 微信请求父类 * @author sfli.sir * */ public class WeixinReqParam { /** * 微信获取信息令牌 */ private String access_token; public String getAccess_token() { return access_token; } public void setAccess_token(String access_token) { this.access_token = access_token; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/interfacesummary/InterfaceSummaryParam.java
src/main/java/org/jeewx/api/core/req/model/interfacesummary/InterfaceSummaryParam.java
package org.jeewx.api.core.req.model.interfacesummary; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 参数类--获取接口分析数据 * @author qimiao * * 2015年1月27日 */ @ReqType("getinterfacesummary") public class InterfaceSummaryParam extends WeixinReqParam { // 开始时间 private String begin_date = null; // 结束时间 private String end_date = null; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/interfacesummary/InterfaceSummaryHourParam.java
src/main/java/org/jeewx/api/core/req/model/interfacesummary/InterfaceSummaryHourParam.java
package org.jeewx.api.core.req.model.interfacesummary; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 参数类--获取接口分析分时数据 * @author qimiao * * 2015年1月27日 */ @ReqType("getinterfacesummaryhour") public class InterfaceSummaryHourParam extends WeixinReqParam { // 开始时间 private String begin_date = null; // 结束时间 private String end_date = null; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/UserRemarkUpdate.java
src/main/java/org/jeewx/api/core/req/model/user/UserRemarkUpdate.java
package org.jeewx.api.core.req.model.user; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("userRemarkUpdate") public class UserRemarkUpdate extends WeixinReqParam { private String openid; private String remark; public String getOpenid() { return openid; } public void setOpenid(String openid) { this.openid = openid; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/GroupGet.java
src/main/java/org/jeewx/api/core/req/model/user/GroupGet.java
package org.jeewx.api.core.req.model.user; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("groupsGet") public class GroupGet extends WeixinReqParam { }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/GroupCreate.java
src/main/java/org/jeewx/api/core/req/model/user/GroupCreate.java
package org.jeewx.api.core.req.model.user; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("groupCreate") public class GroupCreate extends WeixinReqParam { private Group group; public Group getGroup() { return group; } public void setGroup(Group group) { this.group = group; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/GroupGetId.java
src/main/java/org/jeewx/api/core/req/model/user/GroupGetId.java
package org.jeewx.api.core.req.model.user; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("groupsGetid") public class GroupGetId extends WeixinReqParam { private String openid; public String getOpenid() { return openid; } public void setOpenid(String openid) { this.openid = openid; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/GroupMembersUpdate.java
src/main/java/org/jeewx/api/core/req/model/user/GroupMembersUpdate.java
package org.jeewx.api.core.req.model.user; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * * * @author sfli.sir * */ @ReqType("groupMembersUpdate") public class GroupMembersUpdate extends WeixinReqParam { private String openid; private String to_groupid; public String getOpenid() { return openid; } public void setOpenid(String openid) { this.openid = openid; } public String getTo_groupid() { return to_groupid; } public void setTo_groupid(String to_groupid) { this.to_groupid = to_groupid; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/GroupDelete.java
src/main/java/org/jeewx/api/core/req/model/user/GroupDelete.java
package org.jeewx.api.core.req.model.user; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 分组删除 * * @author sfli.sir * */ @ReqType("groupDelete") public class GroupDelete extends WeixinReqParam { private Group group; public Group getGroup() { return group; } public void setGroup(Group group) { this.group = group; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/Group.java
src/main/java/org/jeewx/api/core/req/model/user/Group.java
package org.jeewx.api.core.req.model.user; /** * 取多媒体文件 * * @author sfli.sir * */ public class Group { private String name; private String id; private String count; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCount() { return count; } public void setCount(String count) { this.count = count; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/BatchGroupMembersUpdate.java
src/main/java/org/jeewx/api/core/req/model/user/BatchGroupMembersUpdate.java
package org.jeewx.api.core.req.model.user; import java.util.List; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * * 批量更新用户 * @author sfli.sir * */ @ReqType("batchGroupMembersUpdate") public class BatchGroupMembersUpdate extends WeixinReqParam { private List<String> openid_list; private String to_groupid; public List<String> getOpenid_list() { return openid_list; } public void setOpenid_list(List<String> openid_list) { this.openid_list = openid_list; } public String getTo_groupid() { return to_groupid; } public void setTo_groupid(String to_groupid) { this.to_groupid = to_groupid; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/UserBaseInfoGet.java
src/main/java/org/jeewx/api/core/req/model/user/UserBaseInfoGet.java
package org.jeewx.api.core.req.model.user; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * * 正常情况下,微信会返回下述JSON数据包给公众号 * { "subscribe": 1, "openid": "o6_bmjrPTlm6_2sgVt7hMZOPfL2M", "nickname": "Band", "sex": 1, "language": "zh_CN", "city": "广州", "province": "广东", "country": "中国", "headimgurl": "http://wx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/0", "subscribe_time": 1382694957, "unionid": " o6_bmasdasdsad6_2sgVt7hMZOPfL" } * */ @ReqType("getUserBaseInfo") public class UserBaseInfoGet extends WeixinReqParam { private String openid; /** * 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语 */ private String lang; public String getOpenid() { return openid; } public void setOpenid(String openid) { this.openid = openid; } public String getLang() { return lang; } public void setLang(String lang) { this.lang = lang; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/UserInfoListGet.java
src/main/java/org/jeewx/api/core/req/model/user/UserInfoListGet.java
package org.jeewx.api.core.req.model.user; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * * 正常情况下,微信会返回下述JSON数据包给公众号 * {"total":2,"count":2,"data":{"openid":["","OPENID1","OPENID2"]},"next_openid":"NEXT_OPENID"} * */ @ReqType("getUserInfoList") public class UserInfoListGet extends WeixinReqParam { private String next_openid; public String getNext_openid() { return next_openid; } public void setNext_openid(String next_openid) { this.next_openid = next_openid; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/user/GroupUpdate.java
src/main/java/org/jeewx/api/core/req/model/user/GroupUpdate.java
package org.jeewx.api.core.req.model.user; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("groupUpdate") public class GroupUpdate extends WeixinReqParam { private Group group; public Group getGroup() { return group; } public void setGroup(Group group) { this.group = group; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/account/QrcodeActionInfo.java
src/main/java/org/jeewx/api/core/req/model/account/QrcodeActionInfo.java
package org.jeewx.api.core.req.model.account; /** * * * @author sfli.sir * */ public class QrcodeActionInfo { private QrcodeScene scene; public QrcodeScene getScene() { return scene; } public void setScene(QrcodeScene scene) { this.scene = scene; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/account/QrcodeScene.java
src/main/java/org/jeewx/api/core/req/model/account/QrcodeScene.java
package org.jeewx.api.core.req.model.account; /** * * * @author sfli.sir * */ public class QrcodeScene { private String scene_str; public String getScene_str() { return scene_str; } public void setScene_str(String scene_str) { this.scene_str = scene_str; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/account/QrcodeCreate.java
src/main/java/org/jeewx/api/core/req/model/account/QrcodeCreate.java
package org.jeewx.api.core.req.model.account; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * * @author sfli.sir * */ @ReqType("qrcodeCreate") public class QrcodeCreate extends WeixinReqParam { private String expire_seconds; /** * 二维码类型,QR_SCENE为临时,QR_LIMIT_SCENE为永久,QR_LIMIT_STR_SCENE为永久的字符串参数值 */ private String action_name="QR_SCENE"; private QrcodeActionInfo action_info; public String getExpire_seconds() { return expire_seconds; } public void setExpire_seconds(String expire_seconds) { this.expire_seconds = expire_seconds; } public String getAction_name() { return action_name; } public void setAction_name(String action_name) { this.action_name = action_name; } public QrcodeActionInfo getAction_info() { return action_info; } public void setAction_info(QrcodeActionInfo action_info) { this.action_info = action_info; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/account/ShortUrlCreate.java
src/main/java/org/jeewx/api/core/req/model/account/ShortUrlCreate.java
package org.jeewx.api.core.req.model.account; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * * @author sfli.sir * */ @ReqType("shorturlCreate") public class ShortUrlCreate extends WeixinReqParam { private String action = "long2short"; private String long_url; public String getAction() { return action; } public void setAction(String action) { this.action = action; } public String getLong_url() { return long_url; } public void setLong_url(String long_url) { this.long_url = long_url; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/KfaccountUpdate.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/KfaccountUpdate.java
package org.jeewx.api.core.req.model.kfaccount; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("kfaccountUpdate") public class KfaccountUpdate extends WeixinReqParam { private String kf_account; private String nickname; private String password; public String getKf_account() { return kf_account; } public void setKf_account(String kf_account) { this.kf_account = kf_account; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/KfaccountAdd.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/KfaccountAdd.java
package org.jeewx.api.core.req.model.kfaccount; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("kfaccountAdd") public class KfaccountAdd extends WeixinReqParam { private String kf_account; private String nickname; private String password; public String getKf_account() { return kf_account; } public void setKf_account(String kf_account) { this.kf_account = kf_account; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgNews.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgNews.java
package org.jeewx.api.core.req.model.kfaccount; import java.util.List; /** * 取多媒体文件 * * @author sfli.sir * */ public class MsgNews { private List<MsgArticles> articles; public List<MsgArticles> getArticles() { return articles; } public void setArticles(List<MsgArticles> articles) { this.articles = articles; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/KfaccountList.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/KfaccountList.java
package org.jeewx.api.core.req.model.kfaccount; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 客服账号信息获取,返回信息json字符串 * * 参数 是否必须 说明 access_token 是 调用接口凭证 kf_account 是 完整客服账号,格式为:账号前缀@公众号微信号 kf_nick 是 客服昵称 kf_id 是 客服工号 nickname 是 客服昵称,最长6个汉字或12个英文字符 password 否 客服账号登录密码,格式为密码明文的32位加密MD5值。该密码仅用于在公众平台官网的多客服功能中使用,若不使用多客服功能,则不必设置密码 media 是 该参数仅在设置客服头像时出现,是form-data中媒体文件标识,有filename、filelength、content-type等信息 * * @author sfli.sir * */ @ReqType("getkflist") public class KfaccountList extends WeixinReqParam { }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/KfaccountDel.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/KfaccountDel.java
package org.jeewx.api.core.req.model.kfaccount; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("kfaccountDel") public class KfaccountDel extends WeixinReqParam { private String kf_account; private String nickname; private String password; public String getKf_account() { return kf_account; } public void setKf_account(String kf_account) { this.kf_account = kf_account; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgMusic.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgMusic.java
package org.jeewx.api.core.req.model.kfaccount; /** * 取多媒体文件 * * @author sfli.sir * */ public class MsgMusic { private String title; private String description; private String musicurl; private String hqmusicurl; private String thumb_media_id; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getMusicurl() { return musicurl; } public void setMusicurl(String musicurl) { this.musicurl = musicurl; } public String getHqmusicurl() { return hqmusicurl; } public void setHqmusicurl(String hqmusicurl) { this.hqmusicurl = hqmusicurl; } public String getThumb_media_id() { return thumb_media_id; } public void setThumb_media_id(String thumb_media_id) { this.thumb_media_id = thumb_media_id; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/Customservice.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/Customservice.java
package org.jeewx.api.core.req.model.kfaccount; /** * 取多媒体文件 * * @author sfli.sir * */ public class Customservice { private String kfaccount; public String getKfaccount() { return kfaccount; } public void setKfaccount(String kfaccount) { this.kfaccount = kfaccount; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgText.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgText.java
package org.jeewx.api.core.req.model.kfaccount; /** * 取多媒体文件 * * @author sfli.sir * */ public class MsgText { private String content; public String getContent() { return content; } public void setContent(String content) { this.content = content; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgVideo.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgVideo.java
package org.jeewx.api.core.req.model.kfaccount; /** * 取多媒体文件 * * @author sfli.sir * */ public class MsgVideo { private String media_id; private String thumb_media_id; private String title; private String description; public String getMedia_id() { return media_id; } public void setMedia_id(String media_id) { this.media_id = media_id; } public String getThumb_media_id() { return thumb_media_id; } public void setThumb_media_id(String thumb_media_id) { this.thumb_media_id = thumb_media_id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/KfcustomSend.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/KfcustomSend.java
package org.jeewx.api.core.req.model.kfaccount; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 发送客服消息 * * @author sfli.sir * */ @ReqType("customsend") public class KfcustomSend extends WeixinReqParam { private String touser; /** * news,music,text,image,voice,video */ private String msgtype; private Customservice customservice; private MsgText text; private MsgImage image; private MsgVoice voice; private MsgVideo video; private MsgNews news; private MsgMusic music; public String getTouser() { return touser; } public void setTouser(String touser) { this.touser = touser; } public String getMsgtype() { return msgtype; } public void setMsgtype(String msgtype) { this.msgtype = msgtype; } public Customservice getCustomservice() { return customservice; } public void setCustomservice(Customservice customservice) { this.customservice = customservice; } public MsgText getText() { return text; } public void setText(MsgText text) { this.text = text; } public MsgImage getImage() { return image; } public void setImage(MsgImage image) { this.image = image; } public MsgVoice getVoice() { return voice; } public void setVoice(MsgVoice voice) { this.voice = voice; } public MsgVideo getVideo() { return video; } public void setVideo(MsgVideo video) { this.video = video; } public MsgNews getNews() { return news; } public void setNews(MsgNews news) { this.news = news; } public MsgMusic getMusic() { return music; } public void setMusic(MsgMusic music) { this.music = music; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgArticles.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgArticles.java
package org.jeewx.api.core.req.model.kfaccount; /** * 取多媒体文件 * * @author sfli.sir * */ public class MsgArticles { private String title; private String description; private String url; private String picurl; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getPicurl() { return picurl; } public void setPicurl(String picurl) { this.picurl = picurl; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/KfOnlineAccountList.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/KfOnlineAccountList.java
package org.jeewx.api.core.req.model.kfaccount; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 客服账号信息获取,返回信息json字符串 * * 参数 是否必须 说明 access_token 是 调用接口凭证 kf_account 是 完整客服账号,格式为:账号前缀@公众号微信号 kf_nick 是 客服昵称 kf_id 是 客服工号 nickname 是 客服昵称,最长6个汉字或12个英文字符 password 否 客服账号登录密码,格式为密码明文的32位加密MD5值。该密码仅用于在公众平台官网的多客服功能中使用,若不使用多客服功能,则不必设置密码 media 是 该参数仅在设置客服头像时出现,是form-data中媒体文件标识,有filename、filelength、content-type等信息 * * @author sfli.sir * */ @ReqType("getonlinekflist") public class KfOnlineAccountList extends WeixinReqParam { }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/KfaccountUploadheadimg.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/KfaccountUploadheadimg.java
package org.jeewx.api.core.req.model.kfaccount; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 公众号可调用本接口来上传图片、语音、视频等文件到微信服务器, * 上传后服务器会返回对应的media_id,公众号此后可根据该media_id来获取多媒体 * @author sfli.sir * */ @ReqType("kfaccountUploadheadimg") public class KfaccountUploadheadimg extends WeixinReqParam { /** * 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) */ private String type; private String filePathName; private String kf_account; public String getKf_account() { return kf_account; } public void setKf_account(String kf_account) { this.kf_account = kf_account; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getFilePathName() { return filePathName; } public void setFilePathName(String filePathName) { this.filePathName = filePathName; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgVoice.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgVoice.java
package org.jeewx.api.core.req.model.kfaccount; /** * 取多媒体文件 * * @author sfli.sir * */ public class MsgVoice { private String media_id; public String getMedia_id() { return media_id; } public void setMedia_id(String media_id) { this.media_id = media_id; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgImage.java
src/main/java/org/jeewx/api/core/req/model/kfaccount/MsgImage.java
package org.jeewx.api.core.req.model.kfaccount; /** * 取多媒体文件 * * @author sfli.sir * */ public class MsgImage { private String media_id; public String getMedia_id() { return media_id; } public void setMedia_id(String media_id) { this.media_id = media_id; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/message/IndustryTemplateAdd.java
src/main/java/org/jeewx/api/core/req/model/message/IndustryTemplateAdd.java
package org.jeewx.api.core.req.model.message; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("industryTemplateAdd") public class IndustryTemplateAdd extends WeixinReqParam { private String template_id_short; public String getTemplate_id_short() { return template_id_short; } public void setTemplate_id_short(String template_id_short) { this.template_id_short = template_id_short; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/message/TemplateMessage.java
src/main/java/org/jeewx/api/core/req/model/message/TemplateMessage.java
package org.jeewx.api.core.req.model.message; /** * 取多媒体文件 * * @author sfli.sir * */ public class TemplateMessage { private TemplateData first; private TemplateData keynote1; private TemplateData keynote2; private TemplateData keynote3; private TemplateData remark; public TemplateData getFirst() { return first; } public void setFirst(TemplateData first) { this.first = first; } public TemplateData getKeynote1() { return keynote1; } public void setKeynote1(TemplateData keynote1) { this.keynote1 = keynote1; } public TemplateData getKeynote2() { return keynote2; } public void setKeynote2(TemplateData keynote2) { this.keynote2 = keynote2; } public TemplateData getKeynote3() { return keynote3; } public void setKeynote3(TemplateData keynote3) { this.keynote3 = keynote3; } public TemplateData getRemark() { return remark; } public void setRemark(TemplateData remark) { this.remark = remark; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/message/TemplateMessageSendResult.java
src/main/java/org/jeewx/api/core/req/model/message/TemplateMessageSendResult.java
package org.jeewx.api.core.req.model.message; import java.util.Map; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ public class TemplateMessageSendResult { private String touser; private String template_id; private String url; private Map<String,TemplateData> data; public String getTouser() { return touser; } public void setTouser(String touser) { this.touser = touser; } public String getTemplate_id() { return template_id; } public void setTemplate_id(String template_id) { this.template_id = template_id; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public Map<String, TemplateData> getData() { return data; } public void setData(Map<String, TemplateData> data) { this.data = data; } @Override public String toString() { return "TemplateMessageSendResult [touser=" + touser + ", template_id=" + template_id + ", url=" + url + ", data=" + data + "]"; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/message/IndustryTemplateSet.java
src/main/java/org/jeewx/api/core/req/model/message/IndustryTemplateSet.java
package org.jeewx.api.core.req.model.message; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("industryTemplateSet") public class IndustryTemplateSet extends WeixinReqParam { private String industry_id1; private String industry_id2; public String getIndustry_id1() { return industry_id1; } public void setIndustry_id1(String industry_id1) { this.industry_id1 = industry_id1; } public String getIndustry_id2() { return industry_id2; } public void setIndustry_id2(String industry_id2) { this.industry_id2 = industry_id2; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/message/TemplateData.java
src/main/java/org/jeewx/api/core/req/model/message/TemplateData.java
package org.jeewx.api.core.req.model.message; /** * 取多媒体文件 * * @author sfli.sir * */ public class TemplateData { private String value; private String color; public TemplateData(){ } public TemplateData(String value, String color) { this.value = value; this.color = color; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/message/IndustryTemplateMessageSend.java
src/main/java/org/jeewx/api/core/req/model/message/IndustryTemplateMessageSend.java
package org.jeewx.api.core.req.model.message; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("industryTemplateMessageSend") public class IndustryTemplateMessageSend extends WeixinReqParam { private String touser; private String template_id; private String url; private String topcolor; private TemplateMessage data; public String getTouser() { return touser; } public void setTouser(String touser) { this.touser = touser; } public String getTemplate_id() { return template_id; } public void setTemplate_id(String template_id) { this.template_id = template_id; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getTopcolor() { return topcolor; } public void setTopcolor(String topcolor) { this.topcolor = topcolor; } public TemplateMessage getData() { return data; } public void setData(TemplateMessage data) { this.data = data; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/message/AutoReplyRuleGet.java
src/main/java/org/jeewx/api/core/req/model/message/AutoReplyRuleGet.java
package org.jeewx.api.core.req.model.message; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; @ReqType("autoReplyRuleGet") public class AutoReplyRuleGet extends WeixinReqParam { }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserShareHourParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserShareHourParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * @ClassName: WxDataCubeStreamUserShareHourParam * @Description: 获取图文分享转发分时数据,最大时间跨度 1 * @author zhaoxl * @date 2015年1月29日 下午10:40:07 */ @ReqType("getUserShareHour") public class WxDataCubeStreamUserShareHourParam extends WeixinReqParam{ /** * 获取数据的起始日期<br/> * begin_date和end_date的差值需小于“最大时间跨度”<br/> * (比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),<br/> * 否则会报错 */ private String begin_date; /** * 获取数据的结束日期<br/> * end_date允许设置的最大值为昨日 */ private String end_date; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserShareParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserShareParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * @ClassName: WxDataCubeStreamUserShareParam * @Description: 获取图文统计数据,最大时间跨度 7 * @author zhaoxl * @date 2015年1月29日 下午10:40:07 */ @ReqType("getUserShare") public class WxDataCubeStreamUserShareParam extends WeixinReqParam{ /** * 获取数据的起始日期<br/> * begin_date和end_date的差值需小于“最大时间跨度”<br/> * (比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),<br/> * 否则会报错 */ private String begin_date; /** * 获取数据的结束日期<br/> * end_date允许设置的最大值为昨日 */ private String end_date; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserReadParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserReadParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * @ClassName: WxDataCubeStreamUserReadParam * @Description: 获取图文统计数据,最大时间跨度 3 * @author zhaoxl * @date 2015年1月29日 下午10:40:07 */ @ReqType("getUserRead") public class WxDataCubeStreamUserReadParam extends WeixinReqParam{ /** * 获取数据的起始日期<br/> * begin_date和end_date的差值需小于“最大时间跨度”<br/> * (比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),<br/> * 否则会报错 */ private String begin_date; /** * 获取数据的结束日期<br/> * end_date允许设置的最大值为昨日 */ private String end_date; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserCumulateParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserCumulateParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * @ClassName: WxDataCubeStreamUserCumulateParam * @Description: 获取用户累计数据 * @author zhaoxl * @date 2015年1月29日 下午10:40:07 */ @ReqType("getUserCumulate") public class WxDataCubeStreamUserCumulateParam extends WeixinReqParam{ /** * 获取数据的起始日期<br/> * begin_date和end_date的差值需小于“最大时间跨度”<br/> * (比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),<br/> * 否则会报错 */ private String begin_date; /** * 获取数据的结束日期<br/> * end_date允许设置的最大值为昨日 */ private String end_date; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserReadHourParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserReadHourParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * @ClassName: WxDataCubeStreamUserReadHourParam * @Description: 获取图文统计分时数据,最大时间跨度 1 * @author zhaoxl * @date 2015年1月29日 下午10:40:07 */ @ReqType("getUserReadHour") public class WxDataCubeStreamUserReadHourParam extends WeixinReqParam{ /** * 获取数据的起始日期<br/> * begin_date和end_date的差值需小于“最大时间跨度”<br/> * (比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),<br/> * 否则会报错 */ private String begin_date; /** * 获取数据的结束日期<br/> * end_date允许设置的最大值为昨日 */ private String end_date; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamArticleSummaryParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamArticleSummaryParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * @ClassName: WxDataCubeStreamArticleSummaryParam * @Description: 图文分析数据接口,最大时间跨度 1 * @author zhaoxl * @date 2015年1月29日 下午10:40:07 */ @ReqType("getArticleSummary") public class WxDataCubeStreamArticleSummaryParam extends WeixinReqParam{ /** * 获取数据的起始日期<br/> * begin_date和end_date的差值需小于“最大时间跨度”<br/> * (比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),<br/> * 否则会报错 */ private String begin_date; /** * 获取数据的结束日期<br/> * end_date允许设置的最大值为昨日 */ private String end_date; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgDistWeekParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgDistWeekParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 参数类--获取消息发送分布周数据 * @author luweichao * * 2015年1月27日 */ @ReqType("getupstreammsgdistweek") public class WxDataCubeStreamMsgDistWeekParam extends WeixinReqParam { // 开始时间 private String begin_date = null; // 结束时间 private String end_date = null; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamArticleTotalParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamArticleTotalParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * @ClassName: WxDataCubeStreamArticleTotalParam * @Description: 获取图文群发送总数 最大时间跨度 1 * @author zhaoxl * @date 2015年1月29日 下午10:40:07 */ @ReqType("getArticleTotal") public class WxDataCubeStreamArticleTotalParam extends WeixinReqParam{ /** * 获取数据的起始日期<br/> * begin_date和end_date的差值需小于“最大时间跨度”<br/> * (比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),<br/> * 否则会报错 */ private String begin_date; /** * 获取数据的结束日期<br/> * end_date允许设置的最大值为昨日 */ private String end_date; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgMonthParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgMonthParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 参数类--获取消息发送周数据 * @author luweichao * * 2015年1月27日 */ @ReqType("getupstreammsgmonth") public class WxDataCubeStreamMsgMonthParam extends WeixinReqParam { // 开始时间 private String begin_date = null; // 结束时间 private String end_date = null; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgDistParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgDistParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 参数类--获取消息发送分布数据 * @author luweichao * * 2015年1月27日 */ @ReqType("getupstreammsgdist") public class WxDataCubeStreamMsgDistParam extends WeixinReqParam { // 开始时间 private String begin_date = null; // 结束时间 private String end_date = null; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 参数类--获取消息发送概况数据 * @author luweichao * * 2015年1月27日 */ @ReqType("getupstreammsg") public class WxDataCubeStreamMsgParam extends WeixinReqParam { // 开始时间 private String begin_date = null; // 结束时间 private String end_date = null; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgDistMonthParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgDistMonthParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 参数类--获取消息发送分布月数据 * @author luweichao * * 2015年1月27日 */ @ReqType("getupstreammsgdistmonth") public class WxDataCubeStreamMsgDistMonthParam extends WeixinReqParam { // 开始时间 private String begin_date = null; // 结束时间 private String end_date = null; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgWeekParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgWeekParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 参数类--获取消息发送周数据 * @author luweichao * * 2015年1月27日 */ @ReqType("getupstreammsgweek") public class WxDataCubeStreamMsgWeekParam extends WeixinReqParam { // 开始时间 private String begin_date = null; // 结束时间 private String end_date = null; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserSummaryParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamUserSummaryParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * @ClassName: WxDataCubeStreamUserSummaryParam * @Description: 获取用户增减数据 * @author zhaoxl * @date 2015年1月29日 下午10:40:07 */ @ReqType("getUserSummary") public class WxDataCubeStreamUserSummaryParam extends WeixinReqParam{ /** * 获取数据的起始日期<br/> * begin_date和end_date的差值需小于“最大时间跨度”<br/> * (比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),<br/> * 否则会报错 */ private String begin_date; /** * 获取数据的结束日期<br/> * end_date允许设置的最大值为昨日 */ private String end_date; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgHourParam.java
src/main/java/org/jeewx/api/core/req/model/dataCube/WxDataCubeStreamMsgHourParam.java
package org.jeewx.api.core.req.model.dataCube; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 参数类--获取消息分送分时数据 * @author luweichao * * 2015年1月27日 */ @ReqType("getupstreammsghour") public class WxDataCubeStreamMsgHourParam extends WeixinReqParam { // 开始时间 private String begin_date = null; // 结束时间 private String end_date = null; public String getBegin_date() { return begin_date; } public void setBegin_date(String begin_date) { this.begin_date = begin_date; } public String getEnd_date() { return end_date; } public void setEnd_date(String end_date) { this.end_date = end_date; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/menu/WeixinMenuMatchrule.java
src/main/java/org/jeewx/api/core/req/model/menu/WeixinMenuMatchrule.java
package org.jeewx.api.core.req.model.menu; import java.util.List; public class WeixinMenuMatchrule { private String group_id; @Deprecated private String sex; @Deprecated private String country; @Deprecated private String province; @Deprecated private String city; @Deprecated private String client_platform_type; @Deprecated private String language; public String getGroup_id() { return group_id; } public void setGroup_id(String group_id) { this.group_id = group_id; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getProvince() { return province; } public void setProvince(String province) { this.province = province; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getClient_platform_type() { return client_platform_type; } public void setClient_platform_type(String client_platform_type) { this.client_platform_type = client_platform_type; } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/menu/MenuCreate.java
src/main/java/org/jeewx/api/core/req/model/menu/MenuCreate.java
package org.jeewx.api.core.req.model.menu; import java.util.List; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("menuCreate") public class MenuCreate extends WeixinReqParam { /** * button 的json信息 * * { "type":"click", "name":"今日歌曲", "key":"V1001_TODAY_MUSIC" }, { "name":"菜单", "sub_button":[ { "type":"view", "name":"搜索", "url":"http://www.soso.com/" }, { "type":"view", "name":"视频", "url":"http://v.qq.com/" } */ private List<WeixinButton> button; public List<WeixinButton> getButton() { return button; } public void setButton(List<WeixinButton> button) { this.button = button; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/menu/PersonalizedMenu.java
src/main/java/org/jeewx/api/core/req/model/menu/PersonalizedMenu.java
package org.jeewx.api.core.req.model.menu; import java.util.List; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; public class PersonalizedMenu { private List<WeixinButton> button; private WeixinMenuMatchrule matchrule; public List<WeixinButton> getButton() { return button; } public void setButton(List<WeixinButton> button) { this.button = button; } public WeixinMenuMatchrule getMatchrule() { return matchrule; } public void setMatchrule(WeixinMenuMatchrule matchrule) { this.matchrule = matchrule; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/menu/MenuGet.java
src/main/java/org/jeewx/api/core/req/model/menu/MenuGet.java
package org.jeewx.api.core.req.model.menu; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("menuGet") public class MenuGet extends WeixinReqParam { }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/menu/MenuDelete.java
src/main/java/org/jeewx/api/core/req/model/menu/MenuDelete.java
package org.jeewx.api.core.req.model.menu; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 取多媒体文件 * * @author sfli.sir * */ @ReqType("menuDelete") public class MenuDelete extends WeixinReqParam { }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/menu/MenuConfigureGet.java
src/main/java/org/jeewx/api/core/req/model/menu/MenuConfigureGet.java
package org.jeewx.api.core.req.model.menu; import org.jeewx.api.core.annotation.ReqType; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 获取自定义菜单配置 * @author luobaoli * */ @ReqType("menuConfigureGet") public class MenuConfigureGet extends WeixinReqParam { }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/menu/WeixinButton.java
src/main/java/org/jeewx/api/core/req/model/menu/WeixinButton.java
package org.jeewx.api.core.req.model.menu; import java.util.List; public class WeixinButton { private String type; private String name; private String key; private String url; private String appid; private String pagepath; private List<WeixinButton> sub_button; public String getType() { return type; } public void setType(String type) { this.type = type; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public List<WeixinButton> getSub_button() { return sub_button; } public void setSub_button(List<WeixinButton> sub_button) { this.sub_button = sub_button; } public String getAppid() { return appid; } public void setAppid(String appid) { this.appid = appid; } public String getPagepath() { return pagepath; } public void setPagepath(String pagepath) { this.pagepath = pagepath; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/menu/config/CustomWeixinButtonConfig.java
src/main/java/org/jeewx/api/core/req/model/menu/config/CustomWeixinButtonConfig.java
package org.jeewx.api.core.req.model.menu.config; import java.util.List; /** * 获取自定义菜单配置接口 * @author superuser * */ public class CustomWeixinButtonConfig { /** 菜单是否开启,0代表未开启,1代表开启 */ private String is_menu_open; /** 菜单信息 */ private List<WeixinButtonExtend> selfmenu_info; public String getIs_menu_open() { return is_menu_open; } public void setIs_menu_open(String is_menu_open) { this.is_menu_open = is_menu_open; } public List<WeixinButtonExtend> getSelfmenu_info() { return selfmenu_info; } public void setSelfmenu_info(List<WeixinButtonExtend> selfmenu_info) { this.selfmenu_info = selfmenu_info; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/req/model/menu/config/WeixinButtonExtend.java
src/main/java/org/jeewx/api/core/req/model/menu/config/WeixinButtonExtend.java
package org.jeewx.api.core.req.model.menu.config; import java.util.List; import org.jeewx.api.wxsendmsg.model.WxArticleConfig; public class WeixinButtonExtend{ private String type; private String name; private String key; private String url; private String value; private List<WeixinButtonExtend> sub_button; private List<WxArticleConfig> news_info; public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public List<WeixinButtonExtend> getSub_button() { return sub_button; } public void setSub_button(List<WeixinButtonExtend> sub_button) { this.sub_button = sub_button; } public List<WxArticleConfig> getNews_info() { return news_info; } public void setNews_info(List<WxArticleConfig> news_info) { this.news_info = news_info; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/exception/WexinReqException.java
src/main/java/org/jeewx/api/core/exception/WexinReqException.java
package org.jeewx.api.core.exception; /** * 常规异常信息 * @author sfli.sir * */ public class WexinReqException extends Exception { private static final long serialVersionUID = 1L; public WexinReqException(String message){ super(message); } public WexinReqException(Throwable cause) { super(cause); } public WexinReqException(String message,Throwable cause) { super(message,cause); } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/test/JsonTest.java
src/main/java/org/jeewx/api/core/test/JsonTest.java
package org.jeewx.api.core.test; import com.alibaba.fastjson.JSON; import org.jeewx.api.core.req.model.kfaccount.KfcustomSend; import org.jeewx.api.core.req.model.kfaccount.MsgArticles; import org.jeewx.api.core.req.model.kfaccount.MsgNews; import java.util.ArrayList; import java.util.List; public class JsonTest { public static void main(String[] args){ KfcustomSend s = new KfcustomSend(); s.setAccess_token("toke----"); s.setMsgtype("news"); s.setTouser("touser----"); MsgNews n = new MsgNews(); List<MsgArticles> lst = new ArrayList<MsgArticles>(); MsgArticles aa = new MsgArticles(); aa.setDescription("111-----"); aa.setPicurl("url-----111"); aa.setUrl("uuuu----11"); aa.setTitle("tttt----1111"); lst.add(aa); aa = new MsgArticles(); aa.setDescription("2222-----"); aa.setPicurl("url-----222"); aa.setUrl("uuuu----2222"); aa.setTitle("tttt----222"); lst.add(aa); n.setArticles(lst); s.setNews(n); String json = JSON.toJSONString(s); System.out.println(json); } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/test/ReqTest.java
src/main/java/org/jeewx/api/core/test/ReqTest.java
package org.jeewx.api.core.test; import org.jeewx.api.core.exception.WexinReqException; import org.jeewx.api.core.req.WeiXinReqService; import org.jeewx.api.core.req.model.AccessToken; import org.jeewx.api.core.req.model.DownloadMedia; import org.jeewx.api.core.req.model.ServiceIP; import org.jeewx.api.core.req.model.UploadMedia; import org.jeewx.api.core.req.model.kfaccount.KfaccountList; public class ReqTest { /** * 测试获取token * @return * @throws WexinReqException */ public String getToken() throws WexinReqException{ String appId = "wx00737224cb9dbc7d"; String appSecret = "b9479ebdb58d1c6b6efd4171ebe718b5"; AccessToken token = new AccessToken(); token.setAppid(appId); token.setSecret(appSecret); String strtoken = WeiXinReqService.getInstance().doWeinxinReq(token); System.out.println(strtoken); return strtoken; } /** * 测试获取服务器ip * @return * @throws WexinReqException */ public String getServieIp(String token) throws WexinReqException{ ServiceIP ip = new ServiceIP(); ip.setAccess_token(token); String strip = WeiXinReqService.getInstance().doWeinxinReq(ip); System.out.println(strip); return strip; } /** * 测试上传文件 * @return * @throws WexinReqException */ public String getUploadMedia(String token) throws WexinReqException{ UploadMedia media = new UploadMedia(); media.setAccess_token(token); media.setType("image"); media.setFilePathName("C:/Users/sfli.sir/Desktop/temp/0020380102.jpg"); String tokenFFF = WeiXinReqService.getInstance().doWeinxinReq(media); System.out.println(tokenFFF); return tokenFFF; } /** * 测试上传文件 * @return * @throws WexinReqException */ public String getDownMedia(String token) throws WexinReqException{ DownloadMedia media = new DownloadMedia(); media.setAccess_token(token); media.setMedia_id("fV1ivFheJ-YsMIV8luw04Anu_kw1tfUmYY6ALV7gZi17Uo1n3RSlCiTgIlQRibLF"); media.setFilePath("G:/temp"); String tokenFFF = WeiXinReqService.getInstance().doWeinxinReq(media); return tokenFFF; } /** * 测试获取token * @return * @throws WexinReqException */ public String getKfaccountList(String access_token) throws WexinReqException{ KfaccountList kf = new KfaccountList(); kf.setAccess_token(access_token); String strtoken = WeiXinReqService.getInstance().doWeinxinReq(kf); System.out.println(strtoken); return strtoken; } /** * * * ReqTest test = new ReqTest(); String ddd; try { //test.getToken(); // GroupGet g = new GroupGet(); /* * GroupUpdate g = new GroupUpdate(); Group gg = new Group(); * gg.setId("111"); gg.setName("test修改"); g.setGroup(gg); QrcodeCreate g = new QrcodeCreate(); g.setAction_name("二维测试信息细信息"); QrcodeActionInfo a = new QrcodeActionInfo(); QrcodeScene s = new QrcodeScene(); s.setScene_str("8298389"); a.setScene(s); g.setAction_info(a); g.setAction_name("QR_LIMIT_SCENE"); //UserInfoListGet g = new UserInfoListGet(); //UploadMedia g = new UploadMedia(); DownloadMedia g = new DownloadMedia(); g.setFilePath("H:/temp"); g.setMedia_id("nH-tzebPcZY41Hlao3mjPHpUHHJSIbfP8hbGJy73LUj5BfvVDV9b84uIpZ8Yjlzw"); g.setAccess_token("bbkXUUyC6F85R_vh7FOokDZn54P4jY6RVg8rvtzd0D10nIgd7Ksg7bBc8mncX6SZ1mMEI7v1q1OBtWoWG8--iR6ohe3kXbx5jUTHGAjGPAU"); ddd = WeiXinReqUtil.getInstance().doWeinxinReq(g); // test.getKfaccountList("NG0cpHAPJix5bULT26Hvk9pX5ZOqleIObl9HNKUfPA2PIxJzf-X4U-YOGP4vo-rdwvCy3GCn7v9GNTXNWVM27qEQz-Xs3fgAnj0kdhL07gI"); // test.getServieIp("QsLy729ukRchgw4O3bQvO2UwD0vn2zQ1I0TjZa2kx-dGX9TEFuVCGd7K9AsBhdfynUAaEWVILeDNS7OQXTKZdX1YxbnNqyVBfDmW9I63WWc"); // test.getUploadMedia("QsLy729ukRchgw4O3bQvO2UwD0vn2zQ1I0TjZa2kx-dGX9TEFuVCGd7K9AsBhdfynUAaEWVILeDNS7OQXTKZdX1YxbnNqyVBfDmW9I63WWc"); // ddd = // test.getDownMedia("QsLy729ukRchgw4O3bQvO2UwD0vn2zQ1I0TjZa2kx-dGX9TEFuVCGd7K9AsBhdfynUAaEWVILeDNS7OQXTKZdX1YxbnNqyVBfDmW9I63WWc"); System.out.println(ddd); } catch (WexinReqException e) { // TODO Auto-generated catch block e.printStackTrace(); } // {"groups":[{"id":0,"name":"未分组","count":77},{"id":1,"name":"黑名单","count":0}, // {"id":2,"name":"星标组","count":0},{"id":100,"name":"测试2","count":0},{"id":101,"name":"最新测试分组","count":0}, // {"id":102,"name":"北京用户","count":0},{"id":103,"name":"一级","count":0},{"id":104,"name":"二级","count":0}, // {"id":105,"name":"三级","count":0},{"id":106,"name":"星标组","count":0},{"id":107,"name":"星标组","count":0}, // {"id":108,"name":"星标组","count":0},{"id":109,"name":"111","count":0},{"id":110,"name":"群发分组","count":0}, // {"id":111,"name":"12222","count":0}]} /* {"action_name": "QR_LIMIT_SCENE","action_info":{"scene":{"scene_id":"8298389"}}} {"action_name": "QR_LIMIT_SCENE","action_info": {"scene": {"scene_id": 123}}} {"action_name": "QR_LIMIT_STR_SCENE", "action_info": {"scene": {"scene_str": "123"}}} /* * String appId = "wx00737224cb9dbc7d"; String appSecret = * "b9479ebdb58d1c6b6efd4171ebe718b5"; AccessToken token = new * AccessToken(); token.setAppid(appId); token.setSecret(appSecret); // String tokendd = WeiXinReqUtil.getInstance().doWeinxinReq(token); // {"access_token":"NG0cpHAPJix5bULT26Hvk4P-Jx3UpvCR76tl4VjQjpbA4tGVV4NndiY0d93CYP1A1v603jhuv8MJ8wNEsrtgT-VqjVPQdoyT7UJ5A8VJ5uI","expires_in":7200} /* * UploadMedia media = new UploadMedia(); media.setAccess_token( * "QsLy729ukRchgw4O3bQvO2UwD0vn2zQ1I0TjZa2kx-dGX9TEFuVCGd7K9AsBhdfynUAaEWVILeDNS7OQXTKZdX1YxbnNqyVBfDmW9I63WWc" * ); media.setType("image"); media.setFilePathName( * "C:/Users/sfli.sir/Desktop/temp/2457331_160355071353_2.jpg"); String * tokenFFF = WeiXinReqUtil.getInstance().doWeinxinReq(media); // {"type":"image","media_id":"V5c551Gj3EZyOhhWsm4Y9vxkOeCqafkNuAdeqC1Wh_EE-UaYNCqKBLUkY2tZcRrt","created_at":1422023676} // System.out.println(tokenFFF); // String tokenId = getAuthToke(appId,appSecret); // System.out.println(tokenId); ?access_token=ACCESS_TOKEN&type=TYPE // {"access_token":"y252TCQhkBrLCbOMtQv6siDGMY3BIQCniQCvmjfF9aF26ZypiLwLYkahrdLFxIWOzyAnz8LG8NIz1xp-NjsnSxXJJhQutMbo5gdPO1yAn54","expires_in":7200} // "{\"access_token\":\"sROWom9XJtu0bgvpPJ2teIh1N-WyV3qzbiz20NgksMGbumDHTiBdnsfdhWOoRebKlnsqWXWuaXUueetHnDEaUSKGppzZFXjORvmCknN3kYA\",\"expires_in\":7200}"; // String userInfo = // getAppUser("y252TCQhkBrLCbOMtQv6siDGMY3BIQCniQCvmjfF9aF26ZypiLwLYkahrdLFxIWOzyAnz8LG8NIz1xp-NjsnSxXJJhQutMbo5gdPO1yAn54",""); // System.out.println(userInfo); // {"type":"image","media_id":"ONgomnHZXnbOhDGNmndYkhDeTO-FRqpcWFjhARDsAxkOuBd-bMQtY6PQRJxAVf6v","created_at":1421920436} // {"type":"image","media_id":"4zwjEiPBrg_-diDfu8xOnJ-Id-zOinvcyOLZF7jc7-A4FitVNiraTPzkOyA7nkf3","created_at":1421920468} /* * InputStream fileIn; try { fileIn = new FileInputStream(new * File("C:/Users/liguo/Desktop/0818/111.jpg")); String userInfo = * uploadMedia( * "y252TCQhkBrLCbOMtQv6siDGMY3BIQCniQCvmjfF9aF26ZypiLwLYkahrdLFxIWOzyAnz8LG8NIz1xp-NjsnSxXJJhQutMbo5gdPO1yAn54" * , "image",fileIn,"test.jpg","image/jpg"); * System.out.println(userInfo); } catch (FileNotFoundException e) { * e.printStackTrace(); } /* * AccessToken token = new AccessToken(); token.setAccess_token("dddd"); * token.setAppid("pppp"); token.setSecret("ddddccccccc"); * token.setGrant_type("aflsjdfls"); Map m = getWeixinReqParam(token); * StringBuffer params = new StringBuffer(); for (Iterator iter = * m.entrySet().iterator(); iter .hasNext();) { Entry element = (Entry) * iter.next(); params.append(element.getKey().toString()); * params.append("="); try { * params.append(URLEncoder.encode(element.getValue().toString(), * HttpRequestProxy.requestEncoding)); } catch * (UnsupportedEncodingException e) { // TODO Auto-generated catch block * e.printStackTrace(); } params.append("&"); } * System.out.println(params.toString()); * */ }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/common/HttpPostUtil.java
src/main/java/org/jeewx/api/core/common/HttpPostUtil.java
package org.jeewx.api.core.common; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.SocketTimeoutException; import java.net.URL; import java.net.URLEncoder; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import javax.imageio.ImageIO; import javax.imageio.ImageReader; import javax.imageio.stream.ImageInputStream; public class HttpPostUtil { URL url; HttpURLConnection conn; String boundary = "--------httppost123"; Map<String, String> textParams = new HashMap<String, String>(); Map<String, File> fileparams = new HashMap<String, File>(); DataOutputStream ds; public HttpPostUtil(String url) throws Exception { this.url = new URL(url); } //重新设置要请求的服务器地址,即上传文件的地址。 public void setUrl(String url) throws Exception { this.url = new URL(url); } //增加一个普通字符串数据到form表单数据中 public void addTextParameter(String name, String value) { textParams.put(name, value); } //增加一个文件到form表单数据中 public void addFileParameter(String name, File value) { fileparams.put(name, value); } // 清空所有已添加的form表单数据 public void clearAllParameters() { textParams.clear(); fileparams.clear(); } // 发送数据到服务器,返回一个字节包含服务器的返回结果的数组 public byte[] send() throws Exception { initConnection(); try { conn.connect(); } catch (SocketTimeoutException e) { // something throw new RuntimeException(); } ds = new DataOutputStream(conn.getOutputStream()); writeFileParams(); writeStringParams(); paramsEnd(); InputStream in = conn.getInputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream(); int b; while ((b = in.read()) != -1) { out.write(b); } conn.disconnect(); return out.toByteArray(); } //文件上传的connection的一些必须设置 private void initConnection() throws Exception { conn = (HttpURLConnection) this.url.openConnection(); conn.setDoOutput(true); conn.setUseCaches(false); conn.setConnectTimeout(10000); //连接超时为10秒 conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); } //普通字符串数据 private void writeStringParams() throws Exception { Set<String> keySet = textParams.keySet(); for (Iterator<String> it = keySet.iterator(); it.hasNext();) { String name = it.next(); String value = textParams.get(name); ds.writeBytes("--" + boundary + "\r\n"); ds.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"\r\n"); ds.writeBytes("\r\n"); ds.writeBytes(encode(value) + "\r\n"); } } //文件数据 private void writeFileParams() throws Exception { Set<String> keySet = fileparams.keySet(); for (Iterator<String> it = keySet.iterator(); it.hasNext();) { //update-begin-author:taoYan date:20180601 for:文件加入http请求,当文件非本地资源的时候需要作特殊处理-- String name = it.next(); File value = fileparams.get(name); String valuename = value.getName(); if(value.exists()){ ds.writeBytes("--" + boundary + "\r\n"); ds.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"; filename=\"" + encode(valuename) + "\"\r\n"); ds.writeBytes("Content-Type: " + getContentType(value) + "\r\n"); ds.writeBytes("\r\n"); ds.write(getBytes(value)); }else{ String myFilePath = value.getPath(); if(myFilePath!=null && myFilePath.startsWith("http")){ byte[] netFileBytes = getURIFileBytes(myFilePath); String lowerValueName = valuename.toLowerCase(); if(lowerValueName.endsWith(IMG_BMP)||lowerValueName.endsWith(IMG_GIF)||lowerValueName.endsWith(IMG_JPG)||lowerValueName.endsWith(IMG_PNG)){ valuename = encode(valuename); }else{ valuename = System.currentTimeMillis()+getPicType(netFileBytes); } ds.writeBytes("--" + boundary + "\r\n"); ds.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"; filename=\"" + valuename + "\"\r\n"); ds.writeBytes("Content-Type: " + getContentType(value) + "\r\n"); ds.writeBytes("\r\n"); ds.write(netFileBytes); } } //update-end-author:taoYan date:20180601 for:文件加入http请求,当文件非本地资源的时候需要作特殊处理-- ds.writeBytes("\r\n"); } } /** * 通过文件的网络地址转化成流再读到字节数组中去 */ private byte[] getURIFileBytes(String url) throws IOException{ url = url.replace("http:"+File.separator,"http://").replace("\\","/"); URL oracle = new URL(url); InputStream inStream = oracle.openStream(); ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int len = 0; while ((len = inStream.read(buffer)) != -1) { outStream.write(buffer, 0, len); } inStream.close(); return outStream.toByteArray(); } //获取文件的上传类型,图片格式为image/png,image/jpg等。非图片为application/octet-stream private String getContentType(File f) throws Exception { // return "application/octet-stream"; // 此行不再细分是否为图片,全部作为application/octet-stream 类型 ImageInputStream imagein = ImageIO.createImageInputStream(f); if (imagein == null) { return "application/octet-stream"; } Iterator<ImageReader> it = ImageIO.getImageReaders(imagein); if (!it.hasNext()) { imagein.close(); return "application/octet-stream"; } imagein.close(); return "image/" + it.next().getFormatName().toLowerCase();//将FormatName返回的值转换成小写,默认为大写 } //把文件转换成字节数组 private byte[] getBytes(File f) throws Exception { FileInputStream in = new FileInputStream(f); ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] b = new byte[1024]; int n; while ((n = in.read(b)) != -1) { out.write(b, 0, n); } in.close(); return out.toByteArray(); } //添加结尾数据 private void paramsEnd() throws Exception { ds.writeBytes("--" + boundary + "--" + "\r\n"); ds.writeBytes("\r\n"); } // 对包含中文的字符串进行转码,此为UTF-8。服务器那边要进行一次解码 private String encode(String value) throws Exception{ return URLEncoder.encode(value, "UTF-8"); } //update-begin-author:taoYan date:20180601 for:增加图片类型常量-- public static final String IMG_JPG = ".jpg"; public static final String IMG_PNG = ".png"; public static final String IMG_GIF = ".gif"; public static final String IMG_BMP = ".bmp"; /** * 根据文件流判断图片类型 * @param byte * @return jpg/png/gif/bmp */ public String getPicType(byte[] src) { StringBuilder stringBuilder = new StringBuilder(); if (src == null || src.length <= 0) { return null; } for (int i = 0; i < 4; i++) { int v = src[i] & 0xFF; String hv = Integer.toHexString(v); if (hv.length() < 2) { stringBuilder.append(0); } stringBuilder.append(hv); } String type = stringBuilder.toString().toUpperCase(); if (type.contains("FFD8FF")) { return IMG_JPG; } else if (type.contains("89504E47")) { return IMG_PNG; } else if (type.contains("47494638")) { return IMG_GIF; } else if (type.contains("424D")) { return IMG_BMP; }else{ return ""; } } //update-end-author:taoYan date:20180601 for:根据文件流判断图片类型-- public static void main(String[] args) throws Exception { HttpPostUtil u = new HttpPostUtil("https://api.weixin.qq.com/cgi-bin/media/uploadimg?access_token=i3um002Np_n-mgNVbPP9JEIfft7_hRq3eHE86slxI7Uh_5q0K5rFfLRnhD20HTCcFt92ulWnndpGlyiNgXi6UiWQqKxPCBsfYKmiY6Ws-isUVLaAFAXYO"); u.addFileParameter("img", new File("C:/Users/zhangdaihao/Desktop/2.png")); byte[] b = u.send(); String result = new String(b); System.out.println(result); } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/org/jeewx/api/core/common/WxstoreUtils.java
src/main/java/org/jeewx/api/core/common/WxstoreUtils.java
package org.jeewx.api.core.common; import com.alibaba.fastjson.JSONObject; import org.jeewx.api.core.exception.WexinReqException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import java.io.*; import java.net.ConnectException; import java.net.HttpURLConnection; import java.net.URL; import java.security.SecureRandom; import java.util.Base64; /** * * @author xiaoqingfeng * 微信url请求公用方法 * @ */ public class WxstoreUtils { private static Logger logger = LoggerFactory.getLogger(WxstoreUtils.class); public static JSONObject httpRequest(String requestUrl, String requestMethod, String outputStr) { logger.debug("*********HTTPREQUEST START********"); logger.debug("*********requestUrl is "+ requestUrl+" END AND requestMethod IS" +requestMethod + " END AND outputStr" +outputStr +" END ********"); JSONObject jsonObject = null; StringBuffer buffer = new StringBuffer(); try { TrustManager[] tm = { new MyX509TrustManager() }; SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE"); sslContext.init(null, tm, new SecureRandom()); SSLSocketFactory ssf = sslContext.getSocketFactory(); URL url = new URL(requestUrl); HttpsURLConnection httpUrlConn = (HttpsURLConnection) url .openConnection(); httpUrlConn.setSSLSocketFactory(ssf); httpUrlConn.setDoOutput(true); httpUrlConn.setDoInput(true); httpUrlConn.setUseCaches(false); httpUrlConn.setRequestMethod(requestMethod); if ("GET".equalsIgnoreCase(requestMethod)) { httpUrlConn.connect(); } if (null != outputStr) { OutputStream outputStream = httpUrlConn.getOutputStream(); outputStream.write(outputStr.getBytes("UTF-8")); outputStream.close(); } InputStream inputStream = httpUrlConn.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader( inputStream, "utf-8"); BufferedReader bufferedReader = new BufferedReader( inputStreamReader); String str = null; while ((str = bufferedReader.readLine()) != null) { buffer.append(str); } bufferedReader.close(); inputStreamReader.close(); inputStream.close(); inputStream = null; httpUrlConn.disconnect(); jsonObject = JSONObject.parseObject(buffer.toString()); if (jsonObject.containsKey("errcode") && jsonObject.getInteger("errcode") != 0) { logger.debug("********* ERROR********{}",buffer.toString()); logger.debug("*********HTTPREQUEST END********"); throw new WexinReqException("httpRequest Method!errcode=" + jsonObject.getString("errcode") + ",errmsg = " + jsonObject.getString("errmsg")); } else { logger.debug("********* SUCCESS END********"); } } catch (ConnectException ce) { System.out.println("Weixin server connection timed out."); } catch (Exception e) { System.out.println("https request error:{}" + e.getMessage()); } return jsonObject; } public static JSONObject httpRequest2(String requestUrl, String requestMethod, byte[] outputStr) { JSONObject jsonObject = null; StringBuffer buffer = new StringBuffer(); try { TrustManager[] tm = { new MyX509TrustManager() }; SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE"); sslContext.init(null, tm, new SecureRandom()); SSLSocketFactory ssf = sslContext.getSocketFactory(); URL url = new URL(requestUrl); HttpsURLConnection httpUrlConn = (HttpsURLConnection) url .openConnection(); httpUrlConn.setSSLSocketFactory(ssf); httpUrlConn.setDoOutput(true); httpUrlConn.setDoInput(true); httpUrlConn.setUseCaches(false); httpUrlConn.setRequestMethod(requestMethod); if ("GET".equalsIgnoreCase(requestMethod)) { httpUrlConn.connect(); } if (null != outputStr) { OutputStream outputStream = httpUrlConn.getOutputStream(); outputStream.write(outputStr); outputStream.close(); } InputStream inputStream = httpUrlConn.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader( inputStream, "utf-8"); BufferedReader bufferedReader = new BufferedReader( inputStreamReader); String str = null; while ((str = bufferedReader.readLine()) != null) { buffer.append(str); } bufferedReader.close(); inputStreamReader.close(); inputStream.close(); inputStream = null; httpUrlConn.disconnect(); jsonObject = JSONObject.parseObject(buffer.toString()); } catch (ConnectException ce) { System.out.print("Weixin server connection timed out."); } catch (Exception e) { System.out.print("https request error:{}" + e.getMessage()); } return jsonObject; } public static void saveHttpImage(String requestUrl, String requestMethod, String outputStr, File target) { try { URL url = new URL(requestUrl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod(requestMethod); conn.setConnectTimeout(5000); InputStream inStream = conn.getInputStream(); byte[] data = readInputStream(inStream); FileOutputStream outStream = new FileOutputStream(target); outStream.write(data); outStream.close(); } catch (Exception e) { } } public static String encode(byte[] bstr) { Base64.Encoder encoder = Base64.getEncoder(); return encoder.encodeToString(bstr); } public static byte[] decode(String str) { Base64.Decoder decoder = Base64.getDecoder(); byte[] buf = decoder.decode(str); return buf; } public static byte[] readInputStream(InputStream inStream) throws Exception { ByteArrayOutputStream outstream = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int len = -1; while ((len = inStream.read(buffer)) != -1) { outstream.write(buffer, 0, len); } outstream.close(); inStream.close(); return outstream.toByteArray(); } /** * 上传多媒体文件到微信公众平台 * * @param requestUrl * * @param file * 文件 * @param content_type * 文件类型 * @return 返回的字符串 * @throws Exception */ public static JSONObject uploadMediaFile(String requestUrl, File file, String content_type) { JSONObject jsonObject = null; StringBuffer bufferStr = new StringBuffer(); String end = "\r\n"; String twoHyphens = "--"; // 用于拼接 String boundary = "*****"; // 用于拼接 可自定义 URL submit = null; DataOutputStream dos = null; // FileInputStream fis = null; BufferedInputStream bufin = null; BufferedReader bufferedReader = null; try { submit = new URL(requestUrl); HttpURLConnection conn = (HttpURLConnection) submit.openConnection(); // conn.setDoInput(true); conn.setDoOutput(true); conn.setUseCaches(false); conn.setConnectTimeout(10000); //连接超时为10秒 conn.setRequestMethod("POST"); conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("Content-Type","multipart/form-data;boundary=" + boundary); // 获取输出流对象,准备上传文件 dos = new DataOutputStream(conn.getOutputStream()); dos.writeBytes(twoHyphens + boundary + end); dos.writeBytes("Content-Disposition: form-data; name=\"" + file+ "\";filename=\"" + file.getName() + ";Content-Type=\""+ content_type + end); dos.writeBytes(end); // 对文件进行传输 bufin = new BufferedInputStream(new FileInputStream(file)); byte[] buffer = new byte[8192]; // 8k int count = 0; while ((count = bufin.read(buffer)) != -1) { dos.write(buffer, 0, count); } bufin.close(); // 关闭文件流 dos.writeBytes(end); dos.writeBytes(twoHyphens + boundary + twoHyphens + end); dos.flush(); // 读取URL链接返回字符串 InputStream inputStream = conn.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8"); bufferedReader = new BufferedReader(inputStreamReader); String str = null; while ((str = bufferedReader.readLine()) != null) { bufferStr.append(str); } jsonObject = JSONObject.parseObject(bufferStr.toString()); // System.out.println("-------------读取URL链接返回字符串--------------" + // bufferStr.toString()); } catch (Exception e) { //e.printStackTrace(); System.err.println("异常错误:" + e.toString()); System.err.println("连接地址是:" + requestUrl); // throw new Exception("微信服务器连接错误!" + e.toString()); } finally { try { if (dos != null) { dos.close(); } if (bufferedReader != null) { bufferedReader.close(); } } catch (Exception e2) { } } // 获取到返回Json请自行根据返回码获取相应的结果 return jsonObject; } //-- update-begin--Author:gengjiajia Date:2016-11-28 for:TASK #1583 【图文管理】重写上传永久图片接口 /** * 上传多媒体文件到微信公众平台 图文素材上传使用 * * @param requestUrl * * @param file * 文件 * @param content_type * 文件类型 * @return 返回的字符串 * @throws Exception */ public static JSONObject uploadMediaFileNews(String requestUrl, File file, String content_type) { String result = null; JSONObject jsonObject = null; URL submit = null; if (!file.exists() || !file.isFile()) { logger.info("------------文件不存在------------------------"); } else { try { submit = new URL(requestUrl); HttpURLConnection conn = (HttpURLConnection) submit.openConnection(); // conn.setDoInput(true); conn.setRequestMethod("POST"); // 以Post方式提交表单,默认get方式 conn.setDoInput(true); conn.setDoOutput(true); conn.setUseCaches(false); // post方式不能使用缓存 conn.setRequestProperty("Connection", "Keep-Alive");// 设置请求头信息 conn.setRequestProperty("Charset", "UTF-8"); String BOUNDARY = "----------" + System.currentTimeMillis();// 设置边界 conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY); // 请求正文信息 // 第一部分: StringBuilder sb = new StringBuilder(); sb.append("--"); // 必须多两道线 sb.append(BOUNDARY); sb.append("\r\n"); sb.append("Content-Disposition: form-data;name=\"media\";filename=\"" + file.getName() + "\"\r\n"); sb.append("Content-Type:application/octet-stream\r\n\r\n"); byte[] head = sb.toString().getBytes("utf-8"); // 获得输出流 OutputStream out = new DataOutputStream(conn.getOutputStream()); // 输出表头 out.write(head); // 文件正文部分 // 把文件已流文件的方式 推入到url中 DataInputStream in = new DataInputStream(new FileInputStream( file)); int bytes = 0; byte[] bufferOut = new byte[1024]; while ((bytes = in.read(bufferOut)) != -1) { out.write(bufferOut, 0, bytes); } //out.write(("--" + BOUNDARY + "\r\n").getBytes()); //out.write("Content-Disposition: form-data; name=\"description\";\r\n\r\n".getBytes()); //out.write(String.format("{\"title\":\"%s\", \"introduction\":\"%s\"}", title,introduction).getBytes()); in.close(); // 结尾部分 byte[] foot = ("\r\n--" + BOUNDARY + "--\r\n") .getBytes("utf-8");// 定义最后数据分隔线 out.write(foot); out.flush(); out.close(); StringBuffer buffer = new StringBuffer(); BufferedReader reader = null; try { // 定义BufferedReader输入流来读取URL的响应 reader = new BufferedReader(new InputStreamReader( conn.getInputStream())); String line = null; while ((line = reader.readLine()) != null) { buffer.append(line); } if (result == null) { result = buffer.toString(); } } catch (IOException e) { logger.info("发送POST请求出现异常!" + e); e.printStackTrace(); throw new IOException("数据读取异常"); } finally { if (reader != null) { reader.close(); } } jsonObject = JSONObject.parseObject(result); } catch (Exception e) { e.printStackTrace(); } } return jsonObject; } //-- update-end--Author:gengjiajia Date:2016-11-28 for:TASK #1583 【图文管理】重写上传永久图片接口 public static void main(String[] args) { String url = "https://api.weibo.com/oauth2/access_token?client_id=3016130400&client_secret=70f22fb9106282e6b5fb55a354f6da43&grant_type=authorization_code&code=9c15c07ea807274c7c413e1d9055d92d&redirect_uri=http://open.weibo.com"; JSONObject httpRequest = WxstoreUtils.httpRequest(url, "POST", null); System.err.println(httpRequest); } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false