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/com/jeecg/weibo/util/WeiboFollowersUtil.java
src/main/java/com/jeecg/weibo/util/WeiboFollowersUtil.java
package com.jeecg.weibo.util; import com.alipay.api.internal.util.StringUtils; import com.jeecg.weibo.dto.WeiboFollowersDto; import com.jeecg.weibo.exception.BusinessException; public class WeiboFollowersUtil { /* * * 获取@当前用户的最新微博的请求必填参数验证 * */ public static void getFollowersParmValidate(WeiboFollowersDto followers){ if(StringUtils.isEmpty(followers.getAccess_token())){ throw new BusinessException("access_token不能为空"); } if(StringUtils.isEmpty(followers.getUid())&&StringUtils.isEmpty(followers.getScreen_name())){ throw new BusinessException("uid与screen_name二者不能全为空"); } } /* * * 获取@当前用户的最新微博的请求路径 */ public static String getFollowersUrl (String interUrl,WeiboFollowersDto followers){ StringBuilder requestUrl=new StringBuilder(); requestUrl.append(interUrl); if(!StringUtils.isEmpty(followers.getAccess_token())){ requestUrl.append("&access_token="+followers.getAccess_token()); } if(!StringUtils.isEmpty(followers.getUid())){ requestUrl.append("&uid="+followers.getUid()); } if(!StringUtils.isEmpty(followers.getScreen_name())){ requestUrl.append("&screen_name="+followers.getScreen_name()); } if(!StringUtils.isEmpty(followers.getCount())){ requestUrl.append("&count="+followers.getCount()); } if(!StringUtils.isEmpty(followers.getCursor())){ requestUrl.append("&cursor="+followers.getCursor()); } if(!StringUtils.isEmpty(followers.getTrim_status())){ requestUrl.append("&trim_status="+followers.getTrim_status()); } return requestUrl.toString(); } /* * * 获取用户粉丝UID列表的请求必填参数验证 * */ public static void getFollowersIdsParmValidate(WeiboFollowersDto followers){ if(StringUtils.isEmpty(followers.getAccess_token())){ throw new BusinessException("access_token不能为空"); } } /* * * 获取用户粉丝UID列表的请求路径 */ public static String getFollowersIdsUrl(String interUrl,WeiboFollowersDto followers){ StringBuilder requestUrl=new StringBuilder(); requestUrl.append(interUrl); if(!StringUtils.isEmpty(followers.getAccess_token())){ requestUrl.append("&access_token="+followers.getAccess_token()); } if(!StringUtils.isEmpty(followers.getUid())){ requestUrl.append("&uid="+followers.getUid()); } if(!StringUtils.isEmpty(followers.getScreen_name())){ requestUrl.append("&screen_name="+followers.getScreen_name()); } if(!StringUtils.isEmpty(followers.getCount())){ requestUrl.append("&count="+followers.getCount()); } if(!StringUtils.isEmpty(followers.getCursor())){ requestUrl.append("&cursor="+followers.getCursor()); } return requestUrl.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/com/jeecg/weibo/util/WeiboUsersUtil.java
src/main/java/com/jeecg/weibo/util/WeiboUsersUtil.java
package com.jeecg.weibo.util; import com.alipay.api.internal.util.StringUtils; import com.jeecg.weibo.exception.BusinessException; public class WeiboUsersUtil { /* * * 获取@当前用户的最新微博的请求必填参数验证 * */ public static void getShowParmValidate(String access_token,String uid,String screen_name){ if(StringUtils.isEmpty(access_token)){ throw new BusinessException("access_token不能为空"); } if(StringUtils.isEmpty(uid)&&StringUtils.isEmpty(screen_name)){ throw new BusinessException("uid与screen_name二者不能全为空"); } if(!StringUtils.isEmpty(uid)&&!StringUtils.isEmpty(screen_name)){ throw new BusinessException("uid与screen_name二者只能选其一"); } } /* * * 获取@当前用户的最新微博的请求路径 */ public static String getShowUrl (String interUrl,String access_token,String uid,String screen_name){ StringBuilder requestUrl=new StringBuilder(); requestUrl.append(interUrl); if(!StringUtils.isEmpty(access_token)){ requestUrl.append("&access_token="+access_token); } if(!StringUtils.isEmpty(uid)){ requestUrl.append("&uid="+uid); } if(!StringUtils.isEmpty(screen_name)){ requestUrl.append("&screen_name="+screen_name); } return requestUrl.toString(); } /* * * 批量获取用户的粉丝数、关注数、微博数的请求必填参数验证 * */ public static void getCountsParmValidate(String access_token,String uids){ if(StringUtils.isEmpty(access_token)){ throw new BusinessException("access_token不能为空"); } if(StringUtils.isEmpty(uids)){ throw new BusinessException("需要获取数据的用户uids不能为空"); }else{ String [] uidArr=uids.split(","); if(uidArr.length>100){ throw new BusinessException("需要获取数据的用户个数不能超过100"); } } } /* * * 批量获取用户的粉丝数、关注数、微博数的请求路径 */ public static String getCountsUrl (String interUrl,String access_token,String uids){ StringBuilder requestUrl=new StringBuilder(); requestUrl.append(interUrl); if(!StringUtils.isEmpty(access_token)){ requestUrl.append("&access_token="+access_token); } if(!StringUtils.isEmpty(uids)){ requestUrl.append("&uids="+uids); } return requestUrl.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/com/jeecg/weibo/util/WeiboSendUtil.java
src/main/java/com/jeecg/weibo/util/WeiboSendUtil.java
package com.jeecg.weibo.util; import java.net.URLEncoder; import com.alipay.api.internal.util.StringUtils; import com.jeecg.weibo.dto.WeiboSendDto; import com.jeecg.weibo.exception.BusinessException; public class WeiboSendUtil { /* * * 获取@当前用户的最新微博的请求必填参数验证 * */ public static void getSendParmValidate(WeiboSendDto send){ if(StringUtils.isEmpty(send.getAccess_token())){ throw new BusinessException("access_token不能为空"); } if(StringUtils.isEmpty(send.getStatus())){ throw new BusinessException("发布微博内容不能为空"); } } /* * * 获取@当前用户的最新微博的请求路径 */ @SuppressWarnings("deprecation") public static String getSendUrl (String interUrl,WeiboSendDto send){ StringBuilder requestUrl=new StringBuilder(); requestUrl.append(interUrl); if(!StringUtils.isEmpty(send.getAccess_token())){ requestUrl.append("&access_token="+send.getAccess_token()); } if(!StringUtils.isEmpty(send.getStatus())){ requestUrl.append("&status="+send.getStatus()); } if(!StringUtils.isEmpty(send.getUrl())){ String url = URLEncoder.encode(send.getUrl()); requestUrl.append("&url="+url); } return requestUrl.toString(); } public static void delParmValidate(WeiboSendDto send){ if(StringUtils.isEmpty(send.getAccess_token())){ throw new BusinessException("access_token不能为空"); } if(StringUtils.isEmpty(send.getId())){ throw new BusinessException("微博ID不能为空"); } } @SuppressWarnings("deprecation") public static String getDelUrl (String interUrl,WeiboSendDto send){ StringBuilder requestUrl=new StringBuilder(); requestUrl.append(interUrl); if(!StringUtils.isEmpty(send.getAccess_token())){ requestUrl.append("&access_token="+send.getAccess_token()); } if(!StringUtils.isEmpty(send.getId())){ requestUrl.append("&id="+send.getId()); } return requestUrl.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/com/jeecg/weibo/exception/BusinessException.java
src/main/java/com/jeecg/weibo/exception/BusinessException.java
package com.jeecg.weibo.exception; public class BusinessException extends RuntimeException { private static final long serialVersionUID = 1L; public BusinessException(String message){ super(message); } public BusinessException(Throwable cause) { super(cause); } public BusinessException(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/com/jeecg/weibo/api/WeiboStatusesApi.java
src/main/java/com/jeecg/weibo/api/WeiboStatusesApi.java
package com.jeecg.weibo.api; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.jeecg.weibo.dto.WeiBoMentionsDto; import com.jeecg.weibo.dto.WeiboUserTimelineDto; import com.jeecg.weibo.exception.BusinessException; import com.jeecg.weibo.util.HttpUtil; import com.jeecg.weibo.util.WeiboStatusesUtil; public class WeiboStatusesApi { private static final Logger logger = LoggerFactory.getLogger(WeiboStatusesApi.class); //1、获取用户发布的微博的url private static final String user_timeline_url="https://api.weibo.com/2/statuses/user_timeline.json?1=1"; //2、获取用户发布的微博的ID的url private static final String user_timeline_ids_url="https://api.weibo.com/2/statuses/user_timeline/ids.json?1=1"; //3、获取批量获取指定微博的转发数评论数的url private static final String count_url="https://api.weibo.com/2/statuses/count.json?1=1"; //4、根据ID获取单条微博信息的url private static final String show_url="https://api.weibo.com/2/statuses/show.json?1=1"; //5、获取@当前用户的最新微博的url private static final String mentions_url="https://api.weibo.com/2/statuses/mentions.json?1=1"; //6、获取@当前用户的最新微博的ID的url private static final String mentions_ids_url="https://api.weibo.com/2/statuses/mentions/ids.json?1=1"; /** * @param access_token OAuth授权必填参数 * * 获取用户发布的微博接口 */ public static JSONObject getUserTimeline(WeiboUserTimelineDto userTimeline){ JSONObject j=null; try { logger.info("请求获取用户发布的微博的参数为:"+userTimeline.toString()); //验证请求参数 WeiboStatusesUtil.getUserTimelineParmValidate(userTimeline); String requestUrl = WeiboStatusesUtil.getUserTimelineUrl(user_timeline_url, userTimeline); logger.info("请求获取用户发布的微博的路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("请求获取用户发布的微博的结果为:"+j.toString()); }else{ logger.info("请求获取用户发布的微博的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } /** * @param access_token OAuth授权必填参数 * * 获取用户发布的微博的ID的接口 * */ public static JSONObject getUserTimelineIds(WeiboUserTimelineDto userTimeline){ JSONObject j=null; try { logger.info("获取用户发布的微博的ID的参数为:"+userTimeline.toString()); //验证请求参数 WeiboStatusesUtil.getUserTimelineIdsParmValidate(userTimeline); String requestUrl = WeiboStatusesUtil.getUserTimelineUrl(user_timeline_ids_url, userTimeline); logger.info("获取用户发布的微博的ID的路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("获取用户发布的微博的ID的结果为:"+j.toString()); }else{ logger.info("获取用户发布的微博的ID的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } /** * @param access_token OAuth授权必填参数 * @param ids 需要获取数据的微博ID,多个之间用逗号分隔 * 批量获取指定微博的转发数评论数接口 */ public static JSONArray getCount(String access_token,String ids){ JSONArray j=null; try { logger.info("批量获取指定微博的转发数评论数的参数为:access_token:"+access_token+" 微博ID:"+ids); //验证请求参数 WeiboStatusesUtil.getCountParmValidate(access_token,ids); String requestUrl = WeiboStatusesUtil.getCountUrl(count_url, access_token, ids); logger.info("批量获取指定微博的转发数评论数的路径为:"+requestUrl); j = HttpUtil.httpRequestArr(requestUrl, "GET", null); if(j!=null){ logger.info("批量获取指定微博的转发数评论数的结果为:"+j.toString()); }else{ logger.info("批量获取指定微博的转发数评论数的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } /** * @param access_token OAuth授权必填参数 * @param 需要获取的微博ID * * 根据ID获取单条微博信息接口 * */ public static JSONObject getShow(String access_token,String id){ JSONObject j=null; try { logger.info("根据ID获取单条微博信息的参数为:access_token:"+access_token+" 微博ID:"+id); //验证请求参数 WeiboStatusesUtil.getShowParmValidate(access_token,id); String requestUrl = WeiboStatusesUtil.getShowUrl(show_url, access_token, id); logger.info("根据ID获取单条微博信息的路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("根据ID获取单条微博信息的结果为:"+j.toString()); }else{ logger.info("根据ID获取单条微博信息的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } /** * * @param access_token OAuth授权必填参数 * * 获取@当前用户的最新微博接口 */ public static JSONObject getMentions(WeiBoMentionsDto mentions){ JSONObject j=null; try { logger.info("获取@当前用户的最新微博的参数为:"+mentions.toString()); //验证请求参数 WeiboStatusesUtil.getMentionsParmValidate(mentions); String requestUrl = WeiboStatusesUtil.getMentionsUrl(mentions_url, mentions); logger.info("获取@当前用户的最新微博路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("获取@当前用户的最新微博的结果为:"+j.toString()); }else{ logger.info("获取@当前用户的最新微博的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } /** * * @param access_token OAuth授权必填参数 * * 获取@当前用户的最新微博的ID接口 */ public static JSONObject getMentionsIds(WeiBoMentionsDto mentions){ JSONObject j=null; try { logger.info("获取@当前用户的最新微博的ID的参数为:"+mentions.toString()); //验证请求参数 WeiboStatusesUtil.getMentionsParmValidate(mentions); String requestUrl = WeiboStatusesUtil.getMentionsUrl(mentions_ids_url, mentions); logger.info("获取@当前用户的最新微博的ID路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("获取@当前用户的最新微博的ID的结果为:"+j.toString()); }else{ logger.info("获取@当前用户的最新微博的ID的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } public static void main(String[] args) { //=========================获取用户发布的微博接口测试======start================================= /* WeiboUserTimelineDto userTimeline =new WeiboUserTimelineDto(); userTimeline.setAccess_token("2.00rj8pTCRV_yBB5addd99887yjfcyC"); //userTimeline.setUid("2273040767"); //userTimeline.setScreen_name("联通超级炫铃"); getUserTimeline(userTimeline);*/ //==========================获取用户发布的微博接口测试======end=================================== //=================获取用户发布的微博的ID的接口测试========start=================================== /* WeiboUserTimelineDto userTimeline =new WeiboUserTimelineDto(); userTimeline.setAccess_token("2.00rj8pTCRV_yBB5addd99887yjfcyC"); //userTimeline.setUid("2273040767"); userTimeline.setScreen_name("联通超级炫铃"); getUserTimelineIds(userTimeline);*/ //===================获取用户发布的微博的ID的接口测试=======end==================================== //==================批量获取指定微博的转发数评论数接口测试========start================================== /*String access_token="2.00rj8pTCRV_yBB5addd99887yjfcyC"; String ids="4042534311692339,4042534311692377"; getCount(access_token, ids);*/ //===================批量获取指定微博的转发数评论数接口测试========end=================================== //==================根据ID获取单条微博信息接口测试========start================================== /*String access_token="2.00rj8pTCRV_yBB5addd99887yjfcyC"; String id="3720211465180913"; getShow(access_token, id);*/ //===================根据ID获取单条微博信息接口测试========end=================================== //==================获取@当前用户的最新微博接口测试========start================================== /*WeiBoMentionsDto mentions=new WeiBoMentionsDto(); mentions.setAccess_token("2.00rj8pTCRV_yBB5addd99887yjfcyC"); getMentions(mentions);*/ //===================获取@当前用户的最新微博接口测试========end=================================== //==================获取@当前用户的最新微博的ID接口测试========start================================== /*WeiBoMentionsDto mentions=new WeiBoMentionsDto(); mentions.setAccess_token("2.00rj8pTCRV_yBB5addd99887yjfcyC"); getMentionsIds(mentions);*/ //===================获取@当前用户的最新微博的ID接口测试========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/com/jeecg/weibo/api/WeiboUsersApi.java
src/main/java/com/jeecg/weibo/api/WeiboUsersApi.java
package com.jeecg.weibo.api; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.jeecg.weibo.exception.BusinessException; import com.jeecg.weibo.util.HttpUtil; import com.jeecg.weibo.util.WeiboUsersUtil; public class WeiboUsersApi { private static final Logger logger = LoggerFactory.getLogger(WeiboUsersApi.class); //1、根据用户ID获取用户信息的url private static final String show_url="https://api.weibo.com/2/users/show.json?1=1"; //2、批量获取用户的粉丝数、关注数、微博数 private static final String counts_url="https://api.weibo.com/2/users/counts.json?1=1"; /** * @param access_token OAuth授权必填参数 * @param uid 需要查询的用户ID * @param screen_name 需要查询的用户昵称 * 根据用户ID获取用户信息 */ public static JSONObject getShow(String access_token,String uid,String screen_name){ JSONObject j=null; try { logger.info("根据用户ID获取用户信息的参数为:access_token:"+access_token+" 需要查询的用户ID:"+uid+" 需要查询的用户昵称:"+screen_name); //验证请求参数 WeiboUsersUtil.getShowParmValidate(access_token,uid,screen_name); String requestUrl = WeiboUsersUtil.getShowUrl(show_url, access_token, uid, screen_name); logger.info("根据用户ID获取用户信息的路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("根据用户ID获取用户信息的结果为:"+j.toString()); }else{ logger.info("根据用户ID获取用户信息的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } /** * @param access_token OAuth授权必填参数 * @param uids 需要获取数据的用户UID,多个之间用逗号分隔 * * 批量获取用户的粉丝数、关注数、微博数接口 */ public static JSONArray getCounts(String access_token,String uids){ JSONArray j=null; try { logger.info("根据用户ID获取用户信息的参数为:access_token:"+access_token+" 需要查询的用户ID:"+uids); //验证请求参数 WeiboUsersUtil.getCountsParmValidate(access_token, uids); String requestUrl = WeiboUsersUtil.getCountsUrl(counts_url, access_token, uids); logger.info("根据用户ID获取用户信息的路径为:"+requestUrl); j = HttpUtil.httpRequestArr(requestUrl, "GET", null); if(j!=null){ logger.info("根据用户ID获取用户信息的结果为:"+j.toString()); }else{ logger.info("根据用户ID获取用户信息的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } public static void main(String[] args) { //==================根据用户ID获取用户信息接口测试========start================================== /*String access_token="2.00rj8pTCRV_yBB5addd99887yjfcyC"; String uid=""; //String uid="2273040767"; String screen_name="联通超级炫铃"; //String screen_name=""; getShow(access_token, uid, screen_name);*/ //===================根据用户ID获取用户信息接口测试========end=================================== //==================根据用户ID获取用户信息接口测试========start================================== /* String access_token="2.00rj8pTCRV_yBB5addd99887yjfcyC"; String uids="4042534311692339,4042534311692377"; //String uids="2273040767"; getCounts(access_token, uids);*/ //===================根据用户ID获取用户信息接口测试========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/com/jeecg/weibo/api/WeiboSendApi.java
src/main/java/com/jeecg/weibo/api/WeiboSendApi.java
package com.jeecg.weibo.api; import com.alipay.api.internal.util.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.alibaba.fastjson.JSONObject; import com.jeecg.weibo.dto.WeiboSendDto; import com.jeecg.weibo.exception.BusinessException; import com.jeecg.weibo.util.HttpUtil; import com.jeecg.weibo.util.WeiboSendUtil; public class WeiboSendApi { private static final Logger logger = LoggerFactory.getLogger(WeiboSendApi.class); //指定一个图片URL地址抓取后上传并同时发布一条新微博 private static final String upload_url_text_url="https://api.weibo.com/2/statuses/upload_url_text.json?1=1"; //发布一条新微博 private static String update_url = "https://api.weibo.com/2/statuses/update.json?1=1"; //删除一条微博 private static String delete_url = "https://api.weibo.com/2/statuses/destroy.json?1=1"; public static JSONObject sendWeibo(WeiboSendDto send){ JSONObject j=null; try { logger.info("发布新微博的参数为:"+send.toString()); //验证请求参数 WeiboSendUtil.getSendParmValidate(send); if(StringUtils.isEmpty(send.getUrl())){ String sendUrl = WeiboSendUtil.getSendUrl(update_url, send); logger.info("发布新微博的路径为:"+sendUrl); j = HttpUtil.httpRequest(sendUrl, "POST", ""); }else{ String sendUrl = WeiboSendUtil.getSendUrl(upload_url_text_url, send); logger.info("发布新微博的路径为:"+sendUrl); j = HttpUtil.httpRequest(sendUrl, "POST", ""); } if(j!=null){ logger.info("发布新微博的结果为:"+j.toString()); }else{ logger.info("发布新微博的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } public static JSONObject delWeibo(WeiboSendDto send){ JSONObject j=null; try { logger.info("删除微博的参数为:"+send.toString()); //验证请求参数 WeiboSendUtil.delParmValidate(send); String delUrl = WeiboSendUtil.getDelUrl(delete_url, send); logger.info("删除微博的路径为:"+delUrl); j = HttpUtil.httpRequest(delUrl, "POST", ""); if(j!=null){ logger.info("删除微博的结果为:"+j.toString()); }else{ logger.info("删除微博的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false
jeecgboot/weixin4j
https://github.com/jeecgboot/weixin4j/blob/9a0a503cc99e24c77de671890fae15ee3235669f/src/main/java/com/jeecg/weibo/api/WeiboAccountApi.java
src/main/java/com/jeecg/weibo/api/WeiboAccountApi.java
package com.jeecg.weibo.api; import com.alipay.api.internal.util.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.alibaba.fastjson.JSONObject; import com.jeecg.weibo.exception.BusinessException; import com.jeecg.weibo.util.HttpUtil; public class WeiboAccountApi { private static final Logger logger = LoggerFactory.getLogger(WeiboAccountApi.class); //1、获取授权用户的UID的url private static final String get_uid_url="https://api.weibo.com/2/account/get_uid.json?1=1"; /** * @param access_token OAuth授权必填参数 * * 获取授权用户的UID */ public static JSONObject getUid(String access_token){ JSONObject j=null; try { logger.info("获取授权用户的UID的参数为:access_token:"+access_token); //验证请求参数 if(StringUtils.isEmpty(access_token)){ throw new BusinessException("access_token不能为空"); } StringBuilder uidUrl=new StringBuilder(); uidUrl.append(get_uid_url); uidUrl.append("&access_token="+access_token); String requestUrl = uidUrl.toString(); logger.info("获取授权用户的UID的路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("获取授权用户的UID的结果为:"+j.toString()); }else{ logger.info("获取授权用户的UID的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } public static void main(String[] args) { //==================根据用户ID获取用户信息接口测试========start================================== /*String access_token="2.00rj8pTCRV_yBB5addd99887yjfcyC"; //String uid=""; getUid(access_token);*/ //===================根据用户ID获取用户信息接口测试========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/com/jeecg/weibo/api/WeiboCommentsApi.java
src/main/java/com/jeecg/weibo/api/WeiboCommentsApi.java
package com.jeecg.weibo.api; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.alibaba.fastjson.JSONObject; import com.jeecg.weibo.dto.WeiBoMentionsDto; import com.jeecg.weibo.exception.BusinessException; import com.jeecg.weibo.util.HttpUtil; import com.jeecg.weibo.util.WeiboCommentsUtil; public class WeiboCommentsApi { private static final Logger logger = LoggerFactory.getLogger(WeiboCommentsApi.class); //1、我发出的评论列表的url private static final String by_me_url="https://api.weibo.com/2/comments/by_me.json?1=1"; //2、我收到的评论列表 private static final String to_me_url="https://api.weibo.com/2/comments/to_me.json?1=1"; /** * @param access_token OAuth授权必填参数 * * 1、我发出的评论列表接口 */ public static JSONObject getByme(WeiBoMentionsDto mentions){ JSONObject j=null; try { logger.info("我发出的评论列表的参数为:"+mentions.toString()); //验证请求参数 WeiboCommentsUtil.getBymeParmValidate(mentions); String requestUrl = WeiboCommentsUtil.getTomeUrl(by_me_url, mentions); logger.info("我发出的评论列表的路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("我发出的评论列表的结果为:"+j.toString()); }else{ logger.info("我发出的评论列表的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } /** * @param access_token OAuth授权必填参数 * * 2、我收到的评论列表接口 */ public static JSONObject getTome(WeiBoMentionsDto mentions){ JSONObject j=null; try { logger.info("我收到的评论列表的参数为:"+mentions.toString()); //验证请求参数 WeiboCommentsUtil.getBymeParmValidate(mentions); String requestUrl = WeiboCommentsUtil.getBymeUrl(to_me_url, mentions); logger.info("我收到的评论列表的路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("我收到的评论列表的结果为:"+j.toString()); }else{ logger.info("我收到的评论列表的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } public static void main(String[] args) { //==================我发出的评论列表接口测试========start================================== /* WeiBoMentionsDto mentions=new WeiBoMentionsDto(); mentions.setAccess_token("2.00rj8pTCRV_yBB5addd99887yjfcyC"); getByme(mentions);*/ //===================我发出的评论列表接口测试========end=================================== //==================我收到的评论列表接口测试========start================================== /*WeiBoMentionsDto mentions=new WeiBoMentionsDto(); mentions.setAccess_token("2.00rj8pTCRV_yBB5addd99887yjfcyC"); getTome(mentions);*/ //===================我收到的评论列表接口测试========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/com/jeecg/weibo/api/WeiboFriendshipsApi.java
src/main/java/com/jeecg/weibo/api/WeiboFriendshipsApi.java
package com.jeecg.weibo.api; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.alibaba.fastjson.JSONObject; import com.jeecg.weibo.dto.WeiboFollowersDto; import com.jeecg.weibo.exception.BusinessException; import com.jeecg.weibo.util.HttpUtil; import com.jeecg.weibo.util.WeiboFollowersUtil; public class WeiboFriendshipsApi { private static final Logger logger = LoggerFactory.getLogger(WeiboFriendshipsApi.class); //1、获取用户粉丝列表的url private static final String followers_url="https://api.weibo.com/2/friendships/followers.json?1=1"; //2、获取用户粉丝UID列表 private static final String followers_url_ids="https://api.weibo.com/2/friendships/followers/ids.json?1=1"; /** * @param access_token OAuth授权必填参数 * @param uid 需要查询的用户ID * @param screen_name 需要查询的用户昵称 * 获取用户粉丝列表接口 */ public static JSONObject getFollowers(WeiboFollowersDto followers){ JSONObject j=null; try { logger.info("获取用户粉丝列表的参数为:"+followers.toString()); //验证请求参数 WeiboFollowersUtil.getFollowersParmValidate(followers); String requestUrl = WeiboFollowersUtil.getFollowersUrl(followers_url, followers); logger.info("获取用户粉丝列表的路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("获取用户粉丝列表的结果为:"+j.toString()); }else{ logger.info("获取用户粉丝列表的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } /** * @param access_token OAuth授权必填参数 * @param uid 需要查询的用户ID * @param screen_name 需要查询的用户昵称 * 获取用户粉丝UID列表接口 */ public static JSONObject getFollowersIds(WeiboFollowersDto followers){ JSONObject j=null; try { logger.info("获取用户粉丝UID列表的参数为:"+followers.toString()); //验证请求参数 WeiboFollowersUtil.getFollowersIdsParmValidate(followers); String requestUrl = WeiboFollowersUtil.getFollowersIdsUrl(followers_url_ids, followers); logger.info("获取用户粉丝UID列表的路径为:"+requestUrl); j = HttpUtil.httpRequest(requestUrl, "GET", null); if(j!=null){ logger.info("获取用户粉丝UID列表的结果为:"+j.toString()); }else{ logger.info("获取用户粉丝UID列表的结果为:null"); } }catch(BusinessException e) { logger.info(e.getMessage()); } catch (Exception e) { e.printStackTrace(); } return j; } public static void main(String[] args) { //==================获取用户粉丝列表接口测试========start================================== /* WeiboFollowersDto followers=new WeiboFollowersDto(); followers.setAccess_token("2.00rj8pTCRV_yBB5addd99887yjfcyC"); followers.setUid("2273040767"); followers.setScreen_name("联通超级炫铃"); getFollowers(followers);*/ //===================获取用户粉丝列表接口测试========end=================================== //==================取用户粉丝UID列表接口测试========start================================== /* WeiboFollowersDto followers=new WeiboFollowersDto(); followers.setAccess_token("2.00rj8pTCRV_yBB5addd99887yjfcyC"); //followers.setUid("2273040767"); //followers.setScreen_name("随意平素"); getFollowersIds(followers);*/ //===================取用户粉丝UID列表接口测试========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/ai/JwAIApi.java
src/main/java/org/jeewx/api/ai/JwAIApi.java
package org.jeewx.api.ai; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.ConnectException; import java.net.HttpURLConnection; import java.net.URL; import com.alibaba.fastjson.JSONObject; import org.jeewx.api.ai.model.Voice; import org.jeewx.api.core.util.WeiXinConstant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 微信--AI开放接口 * */ public class JwAIApi { private static Logger logger = LoggerFactory.getLogger(JwAIApi.class); /** * 提交语音 */ public static final String ADD_VOICE_URL = "https://api.weixin.qq.com/cgi-bin/media/voice/addvoicetorecofortext?"; /** * 获取语音翻译结果 */ public static final String VOICE_RESULT_URL = "https://api.weixin.qq.com/cgi-bin/media/voice/queryrecoresultfortext?"; /** * 翻译接口 */ public static final String TRANSLATE_TEXT_URL = "https://api.weixin.qq.com/cgi-bin/media/voice/translatecontent?"; /** * 微信翻译语音<br> * 参数voice请用带参构造器创建对象,若用默认构造器则需要赋值属性有: * accessToken, * format(只支持mp3,16k,单声道,最大1M), * voice_id(语音唯一标识), * file(文件地址), * lang(语言,zh_CN 或 en_US,默认中文 非必填) * @return */ public static String translateVoice(Voice voice){ JSONObject json = uploadVoice(voice); if(json!=null && json.containsKey("errcode")&&"0".equals(json.getString("errcode"))){ try { Thread.sleep(voice.getWaitMill()); } catch (InterruptedException e) { e.printStackTrace(); } return getVoiceResult(voice.getAccessToken(), voice.getVoice_id(),voice.getLang()); } return null; } /** * 微信翻译 * @param accessToken * @param lfrom 源语言,zh_CN 或 en_US * @param lto 目标语言,zh_CN 或 en_US * @param text 需要翻译的文字 * @return */ public static String translateText(String accessToken,String lfrom,String lto,String text){ String result = null; String requestUrl = TRANSLATE_TEXT_URL+"access_token="+accessToken+"&lfrom="+lfrom+"&lto="+lto; logger.info("------微信翻译地址----"+ requestUrl); logger.info("------微信翻译原文----"+ text); JSONObject obj = httpRequest(requestUrl, "POST", text); if(obj!=null && obj.containsKey("to_content")){ result = obj.getString("to_content"); } logger.info("------微信翻译结果----"+ result); return result; } /** * 提交语音 * @param voice * @return */ private static JSONObject uploadVoice(Voice voice){ JSONObject jsonobject = new JSONObject(); String result = null; File file = new File(voice.getFile()); if(!file.exists()||!file.isFile()){ jsonobject = null; logger.info("--提交语音接口,文件不存在------"); }else{ HttpURLConnection con =null; OutputStream out =null; DataInputStream in = null; String requestUrl = voice.getReqestUrl(ADD_VOICE_URL); logger.info("--提交语音接口请求:"+requestUrl); try { URL urlObj = new URL(requestUrl); con = (HttpURLConnection) urlObj.openConnection(); con.setRequestMethod("POST"); // 以Post方式提交表单,默认get方式 con.setDoInput(true); con.setDoOutput(true); con.setUseCaches(false); // post方式不能使用缓存 //设置网络超时 con.setConnectTimeout(8000); con.setReadTimeout(8000); con.setRequestProperty("Connection", "Keep-Alive");// 设置请求头信息 con.setRequestProperty("Charset", "UTF-8"); String BOUNDARY = "----------" + System.currentTimeMillis();// 设置边界 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=\"media\";filelength=\""+file.length()+"\";filename=\""+ file.getName() + "\"\r\n"); sb.append("Content-Type:application/octet-stream\r\n\r\n"); byte[] head = sb.toString().getBytes("utf-8"); // 获得输出流 out = new DataOutputStream(con.getOutputStream()); // 输出表头 out.write(head); // 文件正文部分 // 把文件已流文件的方式 推入到url中 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); } 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(con.getInputStream())); String line = null; while ((line = reader.readLine()) != null) { buffer.append(line); } if(result==null){ result = buffer.toString(); } logger.info("--提交语音接口返回:"+buffer.toString()); } catch (Exception e) { logger.info(e.getMessage()); e.printStackTrace(); }finally { if(reader!=null){ reader.close(); } } jsonobject = JSONObject.parseObject(result); } catch (Exception e) { logger.info(e.getMessage()); e.printStackTrace(); }finally{ try { if(in!=null){ in.close(); } if(out!=null){ out.close(); } if(con!=null){ con.disconnect(); } } catch (Exception e) { } } } return jsonobject; } /** * 获取语音识别结果 * @param accessToken * @param voice_id * @param lang * @return */ private static String getVoiceResult(String accessToken,String voice_id,String lang){ lang = (lang==null ||"".equals(lang))?"zh_CN":lang; String requestUrl = VOICE_RESULT_URL+"access_token="+accessToken+"&voice_id="+voice_id+"&lang="+lang; logger.info("--获取语音识别结果请求参数:"+requestUrl); JSONObject result =httpRequest(requestUrl, "POST",null); if(result!=null){ logger.info("--获取语音识别结果---"+result); }else{ logger.info("--获取语音识别结果为空---"); } Object error = result.get(WeiXinConstant.RETURN_ERROR_INFO_CODE); if(error == null){ return result.getString("result"); } return null; } private static JSONObject httpRequest(String requestUrl, String requestMethod, String outputStr) { JSONObject jsonObject = null; StringBuffer buffer = new StringBuffer(); HttpURLConnection httpUrlConn = null; try { // 创建SSLContext对象,并使用我们指定的信任管理器初始化 URL url = new URL(requestUrl); httpUrlConn = (HttpURLConnection) url.openConnection(); httpUrlConn.setDoOutput(true); httpUrlConn.setDoInput(true); httpUrlConn.setUseCaches(false); httpUrlConn.setConnectTimeout(500000); // httpUrlConn.setRequestProperty("content-type", "application/json"); // 设置请求方式(GET/POST) 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(); logger.info(buffer.toString()); //jsonObject = JSONObject.parseObject(buffer.toString()); jsonObject = JSONObject.parseObject(buffer.toString()); } catch (ConnectException ce) { ce.printStackTrace(); logger .info("Weixin server connection timed out."); } catch (Exception e) { e.printStackTrace(); logger.info("https request error:{}" + e.getMessage()); }finally{ try { httpUrlConn.disconnect(); }catch (Exception e) { e.printStackTrace(); logger.info("http close error:{}"+ e.getMessage()); } } return jsonObject; } public static void main(String[] args) { String file = "D:\\taoyan\\temp\\wavecn\\abc.mp3"; String accessToken = "7_VtDvFo4inD4pjPQdwftlMq9Bvj6mIw36gNRQPQFoencaE5oFu_7edpYdXojRvJPI9Nak1cCm5PgG5bLfoazkms81K-ri69QNr_a5AMGqH-sN3cmXQQRbb6ZBk7bGklo2j4OVH4oSBG3O8vvdIKJlCGADFE"; String voice_id = "ceshi1230981fr4"; String lang = "zh_CN"; Voice voice = new Voice(accessToken, "mp3",voice_id, lang, file); String voiceContent = translateVoice(voice); System.out.println(voiceContent); String lfrom = "zh_CN",lto = "en_US"; String text = "我是中国人啊"; translateText(accessToken, lfrom, lto, text); } }
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/ai/model/Voice.java
src/main/java/org/jeewx/api/ai/model/Voice.java
package org.jeewx.api.ai.model; public class Voice { /** * 口调用凭证 */ private String accessToken; /** * 文件格式 (只支持mp3,16k,单声道,最大1M) */ private String format; /** * 语音唯一标识 */ private String voice_id; /** * 语言,zh_CN 或 en_US,默认中文 非必填 */ private String lang; /** * 文件地址 */ private String file; /** * 发送语音后线程等待毫秒数 默认4秒 注意:上传语音后10s内调语音识别接口 */ private long waitMill = 4000; public long getWaitMill() { return waitMill; } public void setWaitMill(long waitMill) { this.waitMill = waitMill; } public String getFile() { return file; } public void setFile(String file) { this.file = file; } public String getAccessToken() { return accessToken; } public void setAccessToken(String accessToken) { this.accessToken = accessToken; } public String getFormat() { return format; } public void setFormat(String format) { this.format = format; } public String getVoice_id() { return voice_id; } public void setVoice_id(String voice_id) { this.voice_id = voice_id; } public String getLang() { return lang; } public void setLang(String lang) { this.lang = lang; } public Voice() { } /** * 构造器 除lang外每个参数必须赋值 * @param accessToken * @param format 格式(只支持mp3,16k,单声道,最大1M) * @param voice_id 唯一标识 * @param lang 语言zh_CN 或 en_US * @param file 文件地址 */ public Voice(String accessToken, String format, String voice_id, String lang,String file) { //TODO 扩展以流的形式构造而非文件地址 this.accessToken = accessToken; this.format = format; this.voice_id = voice_id; this.file = file; this.lang = lang; } public String getReqestUrl(String metaUrl){ return metaUrl+"access_token="+accessToken+"&format="+format+"&voice_id="+voice_id+"&lang="+((lang==null ||"".equals(lang))?"zh_CN":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/wxstore/Test.java
src/main/java/org/jeewx/api/wxstore/Test.java
package org.jeewx.api.wxstore; import java.util.ArrayList; import java.util.List; import org.jeewx.api.wxstore.deliveryMoney.JwDeliveryMoneyAPI; import org.jeewx.api.wxstore.deliveryMoney.model.DeliveryMoney; import org.jeewx.api.wxstore.deliveryMoney.model.DeliveryMoneyCustomInfo; import org.jeewx.api.wxstore.deliveryMoney.model.DeliveryMoneyNormalInfo; import org.jeewx.api.wxstore.deliveryMoney.model.DeliveryMoneyRtnInfo; import org.jeewx.api.wxstore.deliveryMoney.model.DeliveryMoneyTopFreeInfo; import org.jeewx.api.wxstore.group.JwGroupManangerAPI; import org.jeewx.api.wxstore.group.model.Group; import org.jeewx.api.wxstore.group.model.GroupDetailInfo; import org.jeewx.api.wxstore.group.model.GroupProduct; import org.jeewx.api.wxstore.group.model.GroupProductInfo; import org.jeewx.api.wxstore.group.model.GroupRtnInfo; import org.jeewx.api.wxstore.order.JwOrderManagerAPI; import org.jeewx.api.wxstore.order.model.OrderPara; import org.jeewx.api.wxstore.product.JwProductAPI; import org.jeewx.api.wxstore.product.model.AttrExt; import org.jeewx.api.wxstore.product.model.AttrInfo; import org.jeewx.api.wxstore.product.model.AttrInfoDetail; import org.jeewx.api.wxstore.product.model.CommodityRtnInfo; import org.jeewx.api.wxstore.product.model.DeliveryInfo; import org.jeewx.api.wxstore.product.model.DeliveryInfoExpress; import org.jeewx.api.wxstore.product.model.Product; import org.jeewx.api.wxstore.shelf.JwShelfAPI; import org.jeewx.api.wxstore.shelf.model.EidCInfo; import org.jeewx.api.wxstore.shelf.model.EidEInfo; import org.jeewx.api.wxstore.shelf.model.GroupCInfo; import org.jeewx.api.wxstore.shelf.model.GroupEInfo; import org.jeewx.api.wxstore.shelf.model.GroupEInfos; import org.jeewx.api.wxstore.shelf.model.Shelf; import org.jeewx.api.wxstore.stock.JwStockAPI; import org.jeewx.api.wxstore.stock.model.StockInfo; public class Test { private static String appid = "wxb512901288a94943"; private static String appscret = "6f94b81b49cf9f89fafe305dcaf2c632"; String filePath = "C:/Users/wangbingwang/Desktop/wxpic/"; String fileName = "gongju1.jpg"; String newAccessToken = ""; /** * @param args */ public static void main(String[] args) { Test t = new Test(); // 货架测试 //t.hjDelShelf(); t.getAllShelf(); //t.hjUpdateShelf(); //t.getByShelfId(); //t.hjAddTest1(); //t.hjAddTest2(); // 订单测试 //t.ddGetidTest(); //t.ddgetBystatusTest(); // 库存测试 //t.fzSubStockTest(); //t.fzAddStockTest(); // 分组测试 //t.fzAddTest(); //t.fzgetByidTest(); //t.fzUpdagePropertisTest(); //t.fzUpdageProductTest(); //t.fzDelTest(); //t.fzgetAllTest(); // 商品测试 //t.spAddTest(); // 邮费模板 //t.yfAddTest(); //t.yfUpdateTest(); //t.getMbTest(); //t.getAllTest(); } public void hjDelShelf() { JwShelfAPI wss = new JwShelfAPI(); wss.doDelShelfManager(newAccessToken,2); } // 修改货架信息 public void hjUpdateShelf() { JwShelfAPI wss = new JwShelfAPI(); JwProductAPI wcs = new JwProductAPI(); Shelf shelf = new Shelf(); EidEInfo e = new EidEInfo(); e.setEid(5); e.setImg_background(wcs.uploadImg(newAccessToken,filePath, fileName)); GroupEInfos group_infos = new GroupEInfos(); List<GroupEInfo> groups = new ArrayList<GroupEInfo>(); GroupEInfo a = new GroupEInfo(); a.setGroup_id(43); groups.add(a); GroupEInfo b = new GroupEInfo(); a.setGroup_id(44); groups.add(b); group_infos.setGroups(groups); e.setGroup_infos(group_infos); shelf.setShelf_data(e); shelf.setShelf_banner(wcs.uploadImg(newAccessToken,filePath, fileName)); shelf.setShelf_name("测试货架"); shelf.setShelf_id(2); wss.doUpdateExpress(newAccessToken,shelf); } // 获取所有货架信息 public void getAllShelf() { JwShelfAPI wss = new JwShelfAPI(); wss.getAllShelf(newAccessToken); } // 根据货架ID获取货架信息 public void getByShelfId() { JwShelfAPI wss = new JwShelfAPI(); wss.getByShelfId(newAccessToken,4); } // 增加货架 public void hjAddTest1() { JwShelfAPI wss = new JwShelfAPI(); JwProductAPI wcs = new JwProductAPI(); Shelf shelf = new Shelf(); EidEInfo e = new EidEInfo(); e.setEid(5); e.setImg_background(wcs.uploadImg(newAccessToken,filePath, fileName)); GroupEInfos group_infos = new GroupEInfos(); List<GroupEInfo> groups = new ArrayList<GroupEInfo>(); GroupEInfo a = new GroupEInfo(); a.setGroup_id(43); groups.add(a); GroupEInfo b = new GroupEInfo(); a.setGroup_id(44); groups.add(b); group_infos.setGroups(groups); e.setGroup_infos(group_infos); shelf.setShelf_data(e); shelf.setShelf_banner(wcs.uploadImg(newAccessToken,filePath, fileName)); shelf.setShelf_name("测试货架"); wss.doAddExpress(newAccessToken,shelf); } // 增加货架 public void hjAddTest2() { JwShelfAPI wss = new JwShelfAPI(); JwProductAPI wcs = new JwProductAPI(); Shelf shelf = new Shelf(); EidCInfo e = new EidCInfo(); e.setEid(3); GroupCInfo group_info = new GroupCInfo(); group_info.setGroup_id(205038469); group_info.setImg(wcs.uploadImg(newAccessToken,filePath, fileName)); e.setGroup_info(group_info); shelf.setShelf_data(e); shelf.setShelf_banner(wcs.uploadImg(newAccessToken,filePath, fileName)); shelf.setShelf_name("测试货架"); wss.doAddExpress(newAccessToken,shelf); } // 根据订单ID获取订单详情 public void ddGetidTest() { JwOrderManagerAPI woms = new JwOrderManagerAPI(); woms.getByOrderId(newAccessToken,"7197417460812533543"); } public void ddgetBystatusTest() { JwOrderManagerAPI woms = new JwOrderManagerAPI(); OrderPara orderPara = new OrderPara(); orderPara.setStatus(2); orderPara.setBegintime(1397130460); orderPara.setEndtime(1397130470); woms.getByFilter(newAccessToken,orderPara); } // 增加库存 public void fzAddStockTest() { JwStockAPI JwStockAPI = new JwStockAPI(); StockInfo stockInfo = new StockInfo(); stockInfo.setProduct_id("pqII7uOmhvayKYQyZdXEa_7qfAQM"); stockInfo.setSku_info(""); stockInfo.setQuantity(10); JwStockAPI.doAddStock(newAccessToken,stockInfo); } // 减少库存 public void fzSubStockTest() { JwStockAPI JwStockAPI = new JwStockAPI(); StockInfo stockInfo = new StockInfo(); stockInfo.setProduct_id("pqII7uOmhvayKYQyZdXEa_7qfAQM"); stockInfo.setSku_info(""); stockInfo.setQuantity(5); JwStockAPI.doSubStock(newAccessToken,stockInfo); } // 删除分组信息 public void fzDelTest() { JwGroupManangerAPI wgms = new JwGroupManangerAPI(); GroupRtnInfo gdis = wgms.doDelGroupManager(newAccessToken,205038402); } // 获取分组信息 public void fzgetAllTest() { JwGroupManangerAPI wgms = new JwGroupManangerAPI(); List<GroupDetailInfo> gdis = wgms.getAllGroup(newAccessToken); } // 修改分组商品 public void fzUpdageProductTest() { JwGroupManangerAPI wgms = new JwGroupManangerAPI(); GroupProductInfo g = new GroupProductInfo(); g.setGroup_id(205038402); List<GroupProduct> product = new ArrayList<GroupProduct>(); GroupProduct gp = new GroupProduct(); gp.setProduct_id("pqII7uOmhvayKYQyZdXEa_7qfAQM"); gp.setMod_action(0); product.add(gp); g.setProduct(product); GroupRtnInfo gdi = wgms.doUpdateGroupManagerProduct(newAccessToken,g); } // 修改分组属性 public void fzUpdagePropertisTest() { JwGroupManangerAPI wgms = new JwGroupManangerAPI(); Group g = new Group(); g.setGroup_id(205038402); g.setGroup_name("测试分组22"); GroupRtnInfo gdi = wgms.doUpdateGroupManagerProperties(newAccessToken,g); } // 根据分组ID获取分组信息 public void fzgetByidTest() { JwGroupManangerAPI wgms = new JwGroupManangerAPI(); GroupDetailInfo gdi = wgms.getByGroupId(newAccessToken,205038402); } // 增加分组 public void fzAddTest() { JwGroupManangerAPI wgms = new JwGroupManangerAPI(); Group group = new Group(); GroupDetailInfo group_detail = new GroupDetailInfo(); group_detail.setGroup_name("测试分组"); List<String> product_list = new ArrayList<String>(); product_list.add("pqII7uOqbiJvESwQls_smyB2Z60U"); product_list.add("pqII7uOmhvayKYQyZdXEa_7qfAQM"); group_detail.setProduct_list(product_list); group.setGroup_detail(group_detail); GroupRtnInfo r = wgms.doAddGroupManager(newAccessToken,group); } // 添加商品 public void spAddTest() { JwProductAPI wcs = new JwProductAPI(); Product product = new Product(); // 基础信息 AttrInfo attrInfo = new AttrInfo(); attrInfo.setName("西安商品测试"); attrInfo.setMain_img(wcs.uploadImg(newAccessToken,filePath, fileName)); List<String> imgs = new ArrayList<String>(); imgs.add(wcs.uploadImg(newAccessToken,filePath, fileName)); attrInfo.setImg(imgs); // 商品详情列表 List<AttrInfoDetail> details = new ArrayList<AttrInfoDetail>(); AttrInfoDetail detail1 = new AttrInfoDetail(); detail1.setText("苹果"); detail1.setImg(wcs.uploadImg(newAccessToken,filePath, fileName)); details.add(detail1); AttrInfoDetail detail2 = new AttrInfoDetail(); detail2.setText("橘子"); detail2.setImg(wcs.uploadImg(newAccessToken,filePath, fileName)); details.add(detail2); attrInfo.setDetail(details); attrInfo.setBuy_limit(56); List<String> categorylist = new ArrayList<String>(); categorylist.add("537074298"); attrInfo.setCategory_id(categorylist); product.setProduct_base(attrInfo); // 商品其他属性 AttrExt attrExt = new AttrExt(); product.setAttrext(attrExt); // 运费信息 DeliveryInfo deliveryInfo = new DeliveryInfo(); deliveryInfo.setDelivery_type(0); deliveryInfo.setTemplate_id(0); List<DeliveryInfoExpress> expressList = new ArrayList<DeliveryInfoExpress>(); DeliveryInfoExpress express1 = new DeliveryInfoExpress(); express1.setId(10000027); express1.setPrice(800); expressList.add(express1); DeliveryInfoExpress express2 = new DeliveryInfoExpress(); express2.setId(10000028); express2.setPrice(900); expressList.add(express2); deliveryInfo.setExpress(expressList); product.setDelivery_info(deliveryInfo); CommodityRtnInfo object = wcs.doAddCommodity(newAccessToken,product); } // 获取指定ID的邮费模板 public void getAllTest() { JwDeliveryMoneyAPI wps = new JwDeliveryMoneyAPI(); List<DeliveryMoney> p = wps.getAllExpress(newAccessToken); //System.out.println(p.getTemplate_id()); } // 获取指定ID的邮费模板 public void getMbTest() { JwDeliveryMoneyAPI wps = new JwDeliveryMoneyAPI(); DeliveryMoney p = wps.getByIdExpress(newAccessToken,205036446); System.out.println(p.getTemplate_id()); } // 邮费模板管理接口修改 public void yfUpdateTest() { JwDeliveryMoneyAPI wps = new JwDeliveryMoneyAPI(); DeliveryMoney p = new DeliveryMoney(); p.setTemplate_id(205035813); p.setAssumer(0); p.setName("Test2222"); p.setValuation(0); List<DeliveryMoneyTopFreeInfo> topFee = new ArrayList<DeliveryMoneyTopFreeInfo>(); DeliveryMoneyTopFreeInfo ptf = new DeliveryMoneyTopFreeInfo(); ptf.setType(10000029); DeliveryMoneyNormalInfo pni = new DeliveryMoneyNormalInfo(); pni.setAddFees(3); pni.setAddStandards(1); pni.setStartFees(8); pni.setStartStandards(2); ptf.setNormal(pni); List<DeliveryMoneyCustomInfo> pci = new ArrayList<DeliveryMoneyCustomInfo>(); DeliveryMoneyCustomInfo pc = new DeliveryMoneyCustomInfo(); pc.setAddFees(11); pc.setAddStandards(2); pc.setStartFees(8); pc.setStartStandards(1); pc.setDestCountry("中国"); pc.setDestProvince("广东省"); pc.setDestCity("广州市"); pci.add(pc); ptf.setCustom(pci); topFee.add(ptf); p.setTopFee(topFee); DeliveryMoneyRtnInfo rtn = wps.doUpdateExpress(newAccessToken,p); System.out.println(rtn.getErrmsg()); } // 邮费模板管理接口增加 public void yfAddTest() { JwDeliveryMoneyAPI wps = new JwDeliveryMoneyAPI(); DeliveryMoney p = new DeliveryMoney(); p.setAssumer(0); p.setName("testexpress"); p.setValuation(0); List<DeliveryMoneyTopFreeInfo> topFee = new ArrayList<DeliveryMoneyTopFreeInfo>(); DeliveryMoneyTopFreeInfo ptf = new DeliveryMoneyTopFreeInfo(); ptf.setType(10000027); DeliveryMoneyNormalInfo pni = new DeliveryMoneyNormalInfo(); pni.setAddFees(3); pni.setAddStandards(1); pni.setStartFees(8); pni.setStartStandards(2); ptf.setNormal(pni); List<DeliveryMoneyCustomInfo> pci = new ArrayList<DeliveryMoneyCustomInfo>(); DeliveryMoneyCustomInfo pc = new DeliveryMoneyCustomInfo(); pc.setAddFees(11); pc.setAddStandards(2); pc.setStartFees(8); pc.setStartStandards(1); pc.setDestCountry("中国"); pc.setDestProvince("广东省"); pc.setDestCity("广州市"); pci.add(pc); ptf.setCustom(pci); topFee.add(ptf); p.setTopFee(topFee); DeliveryMoneyRtnInfo rtn = wps.doAddExpress(newAccessToken, p); } }
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/wxstore/shelf/JwShelfAPI.java
src/main/java/org/jeewx/api/wxstore/shelf/JwShelfAPI.java
package org.jeewx.api.wxstore.shelf; 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.wxstore.shelf.model.Shelf; import org.jeewx.api.wxstore.shelf.model.ShelfRInfo; import org.jeewx.api.wxstore.shelf.model.ShelfRtnInfo; import java.util.List; /** * 微信小店 - 货架 * @author zhangdaihao * */ public class JwShelfAPI { // 增加货架 private static String create_shelf_url = "https://api.weixin.qq.com/merchant/shelf/add?access_token=ACCESS_TOKEN"; // 根据货架ID获取货架信息 private static String getid_shelf_url = "https://api.weixin.qq.com/merchant/shelf/getbyid?access_token=ACCESS_TOKEN"; // 获取所有货架 private static String getall_shelf_url = "https://api.weixin.qq.com/merchant/shelf/getall?access_token=ACCESS_TOKEN"; // 修改货架 private static String update_shelf_url = "https://api.weixin.qq.com/merchant/shelf/mod?access_token=ACCESS_TOKEN"; // 删除货架 private static String del_shelf_url = "https://api.weixin.qq.com/merchant/shelf/del?access_token=ACCESS_TOKEN"; /** * 增加货架 * @param postage * @return */ public static ShelfRtnInfo doAddExpress(String newAccessToken, Shelf shelf) { if (newAccessToken != null) { String requestUrl = create_shelf_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(shelf)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); ShelfRtnInfo shelfRtnInfo = (ShelfRtnInfo)JSONObject.toJavaObject(result, ShelfRtnInfo.class); return shelfRtnInfo; } return null; } /** * 修改货架 * @param postage * @return */ public static ShelfRtnInfo doUpdateExpress(String newAccessToken, Shelf shelf) { if (newAccessToken != null) { String requestUrl = update_shelf_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(shelf)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); ShelfRtnInfo shelfRtnInfo = (ShelfRtnInfo)JSONObject.toJavaObject(result, ShelfRtnInfo.class); return shelfRtnInfo; } return null; } /** * 删除货架 * @param shelf_id * @return */ public static ShelfRtnInfo doDelShelfManager(String newAccessToken, Integer shelf_id) { if (newAccessToken != null) { String requestUrl = del_shelf_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"shelf_id\": "+shelf_id+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); ShelfRtnInfo shelfRtnInfo = (ShelfRtnInfo)JSONObject.toJavaObject(result, ShelfRtnInfo.class); return shelfRtnInfo; } return null; } /** * 根据货架ID获取货架信息 * @param shelf_id * @return */ public static ShelfRInfo getByShelfId(String newAccessToken, Integer shelf_id) { if (newAccessToken != null) { String requestUrl = getid_shelf_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"shelf_id\": "+shelf_id+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); // 正常返回 ShelfRInfo shelfRInfo = null; shelfRInfo = (ShelfRInfo)JSONObject.toJavaObject(result, ShelfRInfo.class); return shelfRInfo; } return null; } /** * 获取所有货架信息 * @return */ public static List<ShelfRInfo> getAllShelf(String newAccessToken) { if (newAccessToken != null) { String requestUrl = getall_shelf_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", null); // 正常返回 List<ShelfRInfo> shelfRInfos = null; JSONArray info = result.getJSONArray("shelves"); shelfRInfos = JSONHelper.toList(info, ShelfRInfo.class); return shelfRInfos; } 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/wxstore/shelf/model/EidCInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/EidCInfo.java
package org.jeewx.api.wxstore.shelf.model; public class EidCInfo { // 分组信息 private GroupCInfo group_info; // 控件3的ID private Integer eid; public GroupCInfo getGroup_info() { return group_info; } public void setGroup_info(GroupCInfo group_info) { this.group_info = group_info; } public Integer getEid() { return eid; } public void setEid(Integer eid) { this.eid = eid; } }
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/wxstore/shelf/model/GroupInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/GroupInfo.java
package org.jeewx.api.wxstore.shelf.model; public class GroupInfo { // 该控件展示商品个数 private FilterInfo filter; // 分组ID private Integer group_id; public FilterInfo getFilter() { return filter; } public void setFilter(FilterInfo filter) { this.filter = filter; } public Integer getGroup_id() { return group_id; } public void setGroup_id(Integer group_id) { this.group_id = group_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/wxstore/shelf/model/ShelfRtnInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/ShelfRtnInfo.java
package org.jeewx.api.wxstore.shelf.model; public class ShelfRtnInfo { // 错误码 private String errcode; // 错误信息 private String errmsg; // 货架ID private Integer shelf_id; public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public Integer getShelf_id() { return shelf_id; } public void setShelf_id(Integer shelf_id) { this.shelf_id = shelf_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/wxstore/shelf/model/GroupsInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/GroupsInfo.java
package org.jeewx.api.wxstore.shelf.model; public class GroupsInfo { // 分组ID private Integer group_id; public Integer getGroup_id() { return group_id; } public void setGroup_id(Integer group_id) { this.group_id = group_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/wxstore/shelf/model/GroupInfos.java
src/main/java/org/jeewx/api/wxstore/shelf/model/GroupInfos.java
package org.jeewx.api.wxstore.shelf.model; import java.util.List; public class GroupInfos { // 分组ID private List<GroupsInfo> groups; public List<GroupsInfo> getGroups() { return groups; } public void setGroups(List<GroupsInfo> groups) { this.groups = groups; } }
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/wxstore/shelf/model/GroupEInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/GroupEInfo.java
package org.jeewx.api.wxstore.shelf.model; public class GroupEInfo { // 分组ID private Integer group_id; public Integer getGroup_id() { return group_id; } public void setGroup_id(Integer group_id) { this.group_id = group_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/wxstore/shelf/model/GroupEInfos.java
src/main/java/org/jeewx/api/wxstore/shelf/model/GroupEInfos.java
package org.jeewx.api.wxstore.shelf.model; import java.util.List; public class GroupEInfos { // 分组ID private List<GroupEInfo> groups; public List<GroupEInfo> getGroups() { return groups; } public void setGroups(List<GroupEInfo> groups) { this.groups = groups; } }
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/wxstore/shelf/model/FilterInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/FilterInfo.java
package org.jeewx.api.wxstore.shelf.model; public class FilterInfo { // 该控件展示商品个数 private Integer count; public Integer getCount() { return count; } public void setCount(Integer 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/wxstore/shelf/model/Shelf.java
src/main/java/org/jeewx/api/wxstore/shelf/model/Shelf.java
package org.jeewx.api.wxstore.shelf.model; public class Shelf { // 货架信息(数据说明详见《货架控件说明》)特别说明:货架信息使用要参考官方API文档说明 // 不同的货架对应的对象不同,分别是EidAInfo代表代表控件1,EidBInfo代表代表控件2... // 1,2,3,4可以相互搭配,5不能和1234搭配使用。shelf_data参数代表是按个控件就转换为对应的对象。 private Object shelf_data; // 货架招牌图片Url(图片需调用图片上传接口获得图片Url填写至此,否则添加货架失败, // 建议尺寸为640*120,仅控件1-4有banner,控件5没有banner) private String shelf_banner; // 货架名称 private String shelf_name; private Integer shelf_id; public Integer getShelf_id() { return shelf_id; } public void setShelf_id(Integer shelf_id) { this.shelf_id = shelf_id; } public Object getShelf_data() { return shelf_data; } public void setShelf_data(Object shelf_data) { this.shelf_data = shelf_data; } public String getShelf_banner() { return shelf_banner; } public void setShelf_banner(String shelf_banner) { this.shelf_banner = shelf_banner; } public String getShelf_name() { return shelf_name; } public void setShelf_name(String shelf_name) { this.shelf_name = shelf_name; } }
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/wxstore/shelf/model/GroupDInfos.java
src/main/java/org/jeewx/api/wxstore/shelf/model/GroupDInfos.java
package org.jeewx.api.wxstore.shelf.model; import java.util.List; public class GroupDInfos { // 分组ID private List<GroupDInfo> groups; public List<GroupDInfo> getGroups() { return groups; } public void setGroups(List<GroupDInfo> groups) { this.groups = groups; } }
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/wxstore/shelf/model/GroupCInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/GroupCInfo.java
package org.jeewx.api.wxstore.shelf.model; public class GroupCInfo { // 分组照片(图片需调用图片上传接口获得图片Url填写至此,否则添加货架失败,建议分辨率600*208) private String img; // 分组ID private Integer group_id; public String getImg() { return img; } public void setImg(String img) { this.img = img; } public Integer getGroup_id() { return group_id; } public void setGroup_id(Integer group_id) { this.group_id = group_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/wxstore/shelf/model/GroupDInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/GroupDInfo.java
package org.jeewx.api.wxstore.shelf.model; public class GroupDInfo { // 分组照片(图片需调用图片上传接口获得图片Url填写至此,否则添加货架失败,建议分辨率600*208) private String img; // 分组ID private Integer group_id; public String getImg() { return img; } public void setImg(String img) { this.img = img; } public Integer getGroup_id() { return group_id; } public void setGroup_id(Integer group_id) { this.group_id = group_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/wxstore/shelf/model/EidBInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/EidBInfo.java
package org.jeewx.api.wxstore.shelf.model; public class EidBInfo { // 分组数组 private GroupInfos group_infos; // 控件2的ID private Integer eid; public GroupInfos getGroup_infos() { return group_infos; } public void setGroup_infos(GroupInfos group_infos) { this.group_infos = group_infos; } public Integer getEid() { return eid; } public void setEid(Integer eid) { this.eid = eid; } }
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/wxstore/shelf/model/EidEInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/EidEInfo.java
package org.jeewx.api.wxstore.shelf.model; public class EidEInfo { // 分组信息 private GroupEInfos group_infos; // 分组照片(图片需调用图片上传接口获得图片Url填写至此, // 否则添加货架失败,建议分辨率640*1008) private String img_background; // 控件5的ID private Integer eid; public GroupEInfos getGroup_infos() { return group_infos; } public void setGroup_infos(GroupEInfos group_infos) { this.group_infos = group_infos; } public String getImg_background() { return img_background; } public void setImg_background(String img_background) { this.img_background = img_background; } public Integer getEid() { return eid; } public void setEid(Integer eid) { this.eid = eid; } }
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/wxstore/shelf/model/EidDInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/EidDInfo.java
package org.jeewx.api.wxstore.shelf.model; public class EidDInfo { // 分组信息 private GroupDInfos group_infos; // 控件4的ID private Integer eid; public GroupDInfos getGroup_infos() { return group_infos; } public void setGroup_infos(GroupDInfos group_infos) { this.group_infos = group_infos; } public Integer getEid() { return eid; } public void setEid(Integer eid) { this.eid = eid; } }
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/wxstore/shelf/model/ShelfRInfos.java
src/main/java/org/jeewx/api/wxstore/shelf/model/ShelfRInfos.java
package org.jeewx.api.wxstore.shelf.model; import java.util.List; public class ShelfRInfos { // 货架信息(数据说明详见《货架控件说明》)特别说明:货架信息使用要参考官方API文档说明 private List<ShelfRInfo> shelves; public List<ShelfRInfo> getShelves() { return shelves; } public void setShelves(List<ShelfRInfo> shelves) { this.shelves = shelves; } }
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/wxstore/shelf/model/ShelfRInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/ShelfRInfo.java
package org.jeewx.api.wxstore.shelf.model; public class ShelfRInfo { // 货架信息(数据说明详见《货架控件说明》)特别说明:货架信息使用要参考官方API文档说明 private Object shelf_info; // 货架招牌图片Url(图片需调用图片上传接口获得图片Url填写至此,否则添加货架失败, // 建议尺寸为640*120,仅控件1-4有banner,控件5没有banner) private String shelf_banner; // 货架名称 private String shelf_name; private Integer shelf_id; public Object getShelf_info() { return shelf_info; } public void setShelf_info(Object shelf_info) { this.shelf_info = shelf_info; } public String getShelf_banner() { return shelf_banner; } public void setShelf_banner(String shelf_banner) { this.shelf_banner = shelf_banner; } public String getShelf_name() { return shelf_name; } public void setShelf_name(String shelf_name) { this.shelf_name = shelf_name; } public Integer getShelf_id() { return shelf_id; } public void setShelf_id(Integer shelf_id) { this.shelf_id = shelf_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/wxstore/shelf/model/EidAInfo.java
src/main/java/org/jeewx/api/wxstore/shelf/model/EidAInfo.java
package org.jeewx.api.wxstore.shelf.model; public class EidAInfo { // 分组信息 private GroupInfo group_info; // 控件1的ID private Integer eid; public GroupInfo getGroup_info() { return group_info; } public void setGroup_info(GroupInfo group_info) { this.group_info = group_info; } public Integer getEid() { return eid; } public void setEid(Integer eid) { this.eid = eid; } }
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/wxstore/deliveryMoney/JwDeliveryMoneyAPI.java
src/main/java/org/jeewx/api/wxstore/deliveryMoney/JwDeliveryMoneyAPI.java
package org.jeewx.api.wxstore.deliveryMoney; 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.wxstore.deliveryMoney.model.DeliveryMoney; import org.jeewx.api.wxstore.deliveryMoney.model.DeliveryMoneyRtnInfo; import java.util.List; /** * 微信小店 - 邮费模板 * @author zhangdaihao * */ public class JwDeliveryMoneyAPI { // 增加邮费模板 private static String create_postage_url = "https://api.weixin.qq.com/merchant/express/add?access_token=ACCESS_TOKEN"; // 修改邮费模板 private static String update_postage_url = "https://api.weixin.qq.com/merchant/express/update?access_token=ACCESS_TOKEN"; // 获取指定ID的邮费模板 private static String get_postage_url = "https://api.weixin.qq.com/merchant/express/getbyid?access_token=ACCESS_TOKEN"; // 删除邮费模板 private static String del_postage_url = "https://api.weixin.qq.com/merchant/express/del?access_token=ACCESS_TOKEN"; // 获取所有邮费模板 private static String getall_postage_url = "https://api.weixin.qq.com/merchant/express/getall?access_token=ACCESS_TOKEN"; /** * 增加邮费模板 * @param postage * @return */ public static DeliveryMoneyRtnInfo doAddExpress(String newAccessToken, DeliveryMoney postage) { if (newAccessToken != null) { String requestUrl = create_postage_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(postage)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); DeliveryMoneyRtnInfo postageRtnInfo = (DeliveryMoneyRtnInfo)JSONObject.toJavaObject(result, DeliveryMoneyRtnInfo.class); return postageRtnInfo; } return null; } /** * 删除邮费模板 * @param template_id * @return */ public static DeliveryMoneyRtnInfo doDelExpress(String newAccessToken, Integer template_id) { if (newAccessToken != null) { String requestUrl = del_postage_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"template_id\": "+template_id+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); DeliveryMoneyRtnInfo postageRtnInfo = (DeliveryMoneyRtnInfo)JSONObject.toJavaObject(result, DeliveryMoneyRtnInfo.class); return postageRtnInfo; } return null; } /** * 修改邮费模板 * @param postage * @return */ public static DeliveryMoneyRtnInfo doUpdateExpress(String newAccessToken, DeliveryMoney postage) { if (newAccessToken != null) { String requestUrl = update_postage_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(postage)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); DeliveryMoneyRtnInfo postageRtnInfo = (DeliveryMoneyRtnInfo)JSONObject.toJavaObject(result, DeliveryMoneyRtnInfo.class); return postageRtnInfo; } return null; } /** * 获取指定ID的邮费模板 * @param template_id * @return */ public static DeliveryMoney getByIdExpress(String newAccessToken, Integer template_id) { if (newAccessToken != null) { String requestUrl = get_postage_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"template_id\": "+template_id+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); // 正常返回 DeliveryMoney postage = null; JSONObject info = result.getJSONObject("template_info"); postage = (DeliveryMoney)JSONHelper.toBean(info, DeliveryMoney.class); return postage; } return null; } /** * 获取所有邮费模板 * @return */ public static List<DeliveryMoney> getAllExpress(String newAccessToken) { if (newAccessToken != null) { String requestUrl = getall_postage_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "GET", ""); // 正常返回 List<DeliveryMoney> postages = null; JSONArray info = result.getJSONArray("templates_info"); postages = JSONHelper.toList(info, DeliveryMoney.class); return postages; } 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/wxstore/deliveryMoney/model/DeliveryMoneyRtnInfo.java
src/main/java/org/jeewx/api/wxstore/deliveryMoney/model/DeliveryMoneyRtnInfo.java
package org.jeewx.api.wxstore.deliveryMoney.model; public class DeliveryMoneyRtnInfo { // 错误码 private String errcode; // 错误信息 private String errmsg; // 邮费模板ID private Integer template_id; public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public Integer getTemplate_id() { return template_id; } public void setTemplate_id(Integer template_id) { this.template_id = template_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/wxstore/deliveryMoney/model/DeliveryMoneyNormalInfo.java
src/main/java/org/jeewx/api/wxstore/deliveryMoney/model/DeliveryMoneyNormalInfo.java
package org.jeewx.api.wxstore.deliveryMoney.model; public class DeliveryMoneyNormalInfo { // 起始计费数量(比如计费单位是按件, 填2代表起始计费为2件) private Integer StartStandards; // 起始计费金额(单位: 分) private Integer StartFees; // 递增计费数量 private Integer AddStandards; // 递增计费金额(单位 : 分) private Integer AddFees; public Integer getStartStandards() { return StartStandards; } public void setStartStandards(Integer startStandards) { StartStandards = startStandards; } public Integer getStartFees() { return StartFees; } public void setStartFees(Integer startFees) { StartFees = startFees; } public Integer getAddStandards() { return AddStandards; } public void setAddStandards(Integer addStandards) { AddStandards = addStandards; } public Integer getAddFees() { return AddFees; } public void setAddFees(Integer addFees) { AddFees = addFees; } }
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/wxstore/deliveryMoney/model/DeliveryMoneyCustomInfo.java
src/main/java/org/jeewx/api/wxstore/deliveryMoney/model/DeliveryMoneyCustomInfo.java
package org.jeewx.api.wxstore.deliveryMoney.model; public class DeliveryMoneyCustomInfo { // 起始计费数量 private Integer StartStandards; // 起始计费金额(单位: 分) private Integer StartFees; // 递增计费数量 private Integer AddStandards; // 递增计费金额(单位 : 分) private Integer AddFees; // 指定国家 private String DestCountry; // 指定省份 private String DestProvince; // 指定城市 private String DestCity; public Integer getStartStandards() { return StartStandards; } public void setStartStandards(Integer startStandards) { StartStandards = startStandards; } public Integer getStartFees() { return StartFees; } public void setStartFees(Integer startFees) { StartFees = startFees; } public Integer getAddStandards() { return AddStandards; } public void setAddStandards(Integer addStandards) { AddStandards = addStandards; } public Integer getAddFees() { return AddFees; } public void setAddFees(Integer addFees) { AddFees = addFees; } public String getDestCountry() { return DestCountry; } public void setDestCountry(String destCountry) { DestCountry = destCountry; } public String getDestProvince() { return DestProvince; } public void setDestProvince(String destProvince) { DestProvince = destProvince; } public String getDestCity() { return DestCity; } public void setDestCity(String destCity) { DestCity = destCity; } }
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/wxstore/deliveryMoney/model/DeliveryMoney.java
src/main/java/org/jeewx/api/wxstore/deliveryMoney/model/DeliveryMoney.java
package org.jeewx.api.wxstore.deliveryMoney.model; import java.util.List; public class DeliveryMoney { // 邮费模板名称 private String Name; // 支付方式(0-买家承担运费, 1-卖家承担运费) private Integer Assumer; // 计费单位(0-按件计费, 1-按重量计费, 2-按体积计费,目前只支持按件计费,默认为0) private Integer Valuation; // 具体运费计算 private List<DeliveryMoneyTopFreeInfo> TopFee; // 邮费模板ID private Integer template_id; public String getName() { return Name; } public void setName(String name) { Name = name; } public Integer getAssumer() { return Assumer; } public void setAssumer(Integer assumer) { Assumer = assumer; } public Integer getValuation() { return Valuation; } public void setValuation(Integer valuation) { Valuation = valuation; } public List<DeliveryMoneyTopFreeInfo> getTopFee() { return TopFee; } public void setTopFee(List<DeliveryMoneyTopFreeInfo> topFee) { TopFee = topFee; } public Integer getTemplate_id() { return template_id; } public void setTemplate_id(Integer template_id) { this.template_id = template_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/wxstore/deliveryMoney/model/DeliveryMoneyTopFreeInfo.java
src/main/java/org/jeewx/api/wxstore/deliveryMoney/model/DeliveryMoneyTopFreeInfo.java
package org.jeewx.api.wxstore.deliveryMoney.model; import java.util.List; public class DeliveryMoneyTopFreeInfo { // 快递类型ID private Integer Type; // 默认邮费计算方法 private DeliveryMoneyNormalInfo Normal; // 指定地区邮费计算方法 private List<DeliveryMoneyCustomInfo> Custom; public Integer getType() { return Type; } public void setType(Integer type) { Type = type; } public DeliveryMoneyNormalInfo getNormal() { return Normal; } public void setNormal(DeliveryMoneyNormalInfo normal) { Normal = normal; } public List<DeliveryMoneyCustomInfo> getCustom() { return Custom; } public void setCustom(List<DeliveryMoneyCustomInfo> custom) { Custom = custom; } }
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/wxstore/product/JwProductAPI.java
src/main/java/org/jeewx/api/wxstore/product/JwProductAPI.java
package org.jeewx.api.wxstore.product; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.apache.commons.io.IOUtils; import org.jeewx.api.core.common.JSONHelper; import org.jeewx.api.core.common.WxstoreUtils; import org.jeewx.api.core.common.util.WeixinUtil; import org.jeewx.api.wxstore.product.model.*; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.List; /** * 微信小店 - 商品 * @author zhangdaihao * */ public class JwProductAPI { // 增加商品 private static String create_commodity_url = "https://api.weixin.qq.com/merchant/create?access_token=${ACCESS_TOKEN}"; // 修改商品 private static String update_commodity_url = "https://api.weixin.qq.com/merchant/update?access_token=ACCESS_TOKEN"; // 查询商品 private static String get_commodity_url = "https://api.weixin.qq.com/merchant/get?access_token=ACCESS_TOKEN"; // 删除商品 private static String del_commodity_url = "https://api.weixin.qq.com/merchant/del?access_token=ACCESS_TOKEN"; // 上传图片 private static String upload_img_commodity_url = "https://api.weixin.qq.com/merchant/common/upload_img?access_token=ACCESS_TOKEN&filename=IMG_NAME"; // 获取指定状态商品 private static String getbystatus_commodity_url = "https://api.weixin.qq.com/merchant/getbystatus?access_token=ACCESS_TOKEN"; // 商品上下架 private static String modproductstatus_commodity_url = "https://api.weixin.qq.com/merchant/modproductstatus?access_token=ACCESS_TOKEN"; // 指定分类的所有子分类 private static String getsub_commodity_url = "https://api.weixin.qq.com/merchant/category/getsub?access_token=ACCESS_TOKEN"; // 指定子分类的所有SKU private static String getsku_commodity_url = "https://api.weixin.qq.com/merchant/category/getsku?access_token=ACCESS_TOKEN"; // 指定分类的所有属性 private static String getproperty_commodity_url = "https://api.weixin.qq.com/merchant/category/getproperty?access_token=ACCESS_TOKEN"; /** * 增加商品 */ public static CommodityRtnInfo doAddCommodity(String newAccessToken, Product product) { if (newAccessToken != null) { String requestUrl = WeixinUtil.parseWeiXinHttpUrl(create_commodity_url, newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(product)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); CommodityRtnInfo commodityRtnInfo = (CommodityRtnInfo)JSONObject.toJavaObject(result, CommodityRtnInfo.class); return commodityRtnInfo; } return null; } /** * 删除商品 */ public static CommodityRtnInfo doDelCommodity(String newAccessToken, String product_id) { if (newAccessToken != null) { String requestUrl = del_commodity_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"product_id\": \""+product_id+"\"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); CommodityRtnInfo commodityRtnInfo = (CommodityRtnInfo)JSONObject.toJavaObject(result, CommodityRtnInfo.class); return commodityRtnInfo; } return null; } /** * 修改商品 */ public static CommodityRtnInfo doUpdateCommodity(String newAccessToken, Product product, String accountid) { if (newAccessToken != null) { String requestUrl = update_commodity_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(product)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); CommodityRtnInfo commodityRtnInfo = (CommodityRtnInfo)JSONObject.toJavaObject(result, CommodityRtnInfo.class); return commodityRtnInfo; } return null; } /** * 获取商品详细 */ public static Product getCommodity(String newAccessToken, String product_id) { if (newAccessToken != null) { String requestUrl = get_commodity_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"product_id\": \""+product_id+"\"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "GET", json); // 正常返回 Product product = null; JSONObject info = result.getJSONObject("product_info"); product = (Product)JSONObject.toJavaObject(info, Product.class); return product; } return null; } /** * 获取指定状态的所有商品 * 商品状态(0-全部, 1-上架, 2-下架) */ public static CommodityRtnInfo getByStatus(String newAccessToken, Integer status) { if (newAccessToken != null) { String requestUrl = getbystatus_commodity_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"status\": "+status+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); CommodityRtnInfo commodityRtnInfo = (CommodityRtnInfo)JSONObject.toJavaObject(result, CommodityRtnInfo.class); return commodityRtnInfo; } return null; } /** * 上传图片 * @param fileName * @param accountid * @return */ public static String uploadImg(String newAccessToken, String filePath, String fileName) { if (newAccessToken != null) { String requestUrl = upload_img_commodity_url.replace("ACCESS_TOKEN", newAccessToken).replace("IMG_NAME", fileName); byte[] fileByte; try { fileByte = fileData(filePath+fileName); JSONObject result = WxstoreUtils.httpRequest2(requestUrl, "POST", fileByte); if (result.getInteger("errcode") == 0) { return result.getString("image_url"); } return ""; } catch (IOException e) { e.printStackTrace(); } } return ""; } private static byte[] fileData(String filePath) throws IOException { File file = new File(filePath);//存放照片的文件 InputStream fis = null; byte[] imageByteArray = null; fis = new FileInputStream(file); imageByteArray= IOUtils.toByteArray(fis); return imageByteArray; } /** * 商品上下架 * 上下架标识(0-下架, 1-上架) */ public static CommodityRtnInfo doModproductstatus(String newAccessToken, String product_id, Integer status) { if (newAccessToken != null) { String requestUrl = modproductstatus_commodity_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"product_id\":\""+product_id+"\",\"status\": "+status+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); CommodityRtnInfo commodityRtnInfo = (CommodityRtnInfo)JSONObject.toJavaObject(result, CommodityRtnInfo.class); return commodityRtnInfo; } return null; } /** * 获取指定分类的所有子分类 */ public static List<CateInfo> getCateSub(String newAccessToken, Integer cate_id) { if (newAccessToken != null) { String requestUrl = getsub_commodity_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"cate_id\": "+cate_id+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "GET", json); // 正常返回 List<CateInfo> cateInfos = null; JSONArray info = result.getJSONArray("cate_list"); cateInfos = JSONHelper.toList(info, CateInfo.class); return cateInfos; } return null; } /** * 获取指定子分类的所有SKU */ public static List<SkuInfo> getCateSubSku(String newAccessToken, Integer cate_id) { if (newAccessToken != null) { String requestUrl = getsku_commodity_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"cate_id\": "+cate_id+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "GET", json); // 正常返回 List<SkuInfo> skuInfos = null; JSONArray info = result.getJSONArray("sku_table"); skuInfos = JSONHelper.toList(info, SkuInfo.class); return skuInfos; } return null; } /** * 获取指定分类的所有属性 */ public static List<PropertiesInfo> getPropertyByCateId(String newAccessToken, Integer cate_id) { if (newAccessToken != null) { String requestUrl = getproperty_commodity_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"cate_id\": "+cate_id+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "GET", json); // 正常返回 List<PropertiesInfo> propertiesInfos = null; JSONArray info = result.getJSONArray("properties"); propertiesInfos = JSONHelper.toList(info, PropertiesInfo.class); return propertiesInfos; } 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/wxstore/product/model/AttrExtLocation.java
src/main/java/org/jeewx/api/wxstore/product/model/AttrExtLocation.java
package org.jeewx.api.wxstore.product.model; public class AttrExtLocation { // 国家 private String country; // 省份 private String province; // 城市 private String city; // 地址 private String address; 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 getAddress() { return address; } public void setAddress(String address) { this.address = address; } }
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/wxstore/product/model/Product.java
src/main/java/org/jeewx/api/wxstore/product/model/Product.java
package org.jeewx.api.wxstore.product.model; import java.util.List; public class Product { // 商品id private String product_id; // 基本属性 private AttrInfo product_base; // sku信息列表 private List<Sku> sku_list; // 商品其他属性 private AttrExt attrext; // 运费信息 private DeliveryInfo delivery_info; // 状态 private Integer status; public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public String getProduct_id() { return product_id; } public void setProduct_id(String product_id) { this.product_id = product_id; } public AttrInfo getProduct_base() { return product_base; } public void setProduct_base(AttrInfo product_base) { this.product_base = product_base; } public List<Sku> getSku_list() { return sku_list; } public void setSku_list(List<Sku> sku_list) { this.sku_list = sku_list; } public AttrExt getAttrext() { return attrext; } public void setAttrext(AttrExt attrext) { this.attrext = attrext; } public DeliveryInfo getDelivery_info() { return delivery_info; } public void setDelivery_info(DeliveryInfo delivery_info) { this.delivery_info = delivery_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/wxstore/product/model/SkuValue.java
src/main/java/org/jeewx/api/wxstore/product/model/SkuValue.java
package org.jeewx.api.wxstore.product.model; public class SkuValue { // vid private String id; // vid名称 private String name; 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; } }
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/wxstore/product/model/PropertiesInfo.java
src/main/java/org/jeewx/api/wxstore/product/model/PropertiesInfo.java
package org.jeewx.api.wxstore.product.model; import java.util.List; public class PropertiesInfo { // 属性id private String id; // 属性名称 private String name; // 属性值 private List<PropertiesValue> property_value; 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 List<PropertiesValue> getProperty_value() { return property_value; } public void setProperty_value(List<PropertiesValue> property_value) { this.property_value = property_value; } }
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/wxstore/product/model/AttrInfoProperty.java
src/main/java/org/jeewx/api/wxstore/product/model/AttrInfoProperty.java
package org.jeewx.api.wxstore.product.model; public class AttrInfoProperty { // 属性id private String id; // 属性值id private String vid; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getVid() { return vid; } public void setVid(String vid) { this.vid = vid; } }
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/wxstore/product/model/Sku.java
src/main/java/org/jeewx/api/wxstore/product/model/Sku.java
package org.jeewx.api.wxstore.product.model; public class Sku { // sku信息 private String sku_id; // 商家商品编码 private String product_code; // icon图片 private String icon_url; // sku原价 private Integer ori_price; // sku微信价 private Integer price; // sku库存 private Integer quantity; public String getSku_id() { return sku_id; } public void setSku_id(String sku_id) { this.sku_id = sku_id; } public String getProduct_code() { return product_code; } public void setProduct_code(String product_code) { this.product_code = product_code; } public String getIcon_url() { return icon_url; } public void setIcon_url(String icon_url) { this.icon_url = icon_url; } public Integer getOri_price() { return ori_price; } public void setOri_price(Integer ori_price) { this.ori_price = ori_price; } public Integer getPrice() { return price; } public void setPrice(Integer price) { this.price = price; } public Integer getQuantity() { return quantity; } public void setQuantity(Integer quantity) { this.quantity = quantity; } }
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/wxstore/product/model/PropertiesValue.java
src/main/java/org/jeewx/api/wxstore/product/model/PropertiesValue.java
package org.jeewx.api.wxstore.product.model; public class PropertiesValue { // 属性值id private String id; // 属性值名称 private String name; 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; } }
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/wxstore/product/model/AttrInfoDetail.java
src/main/java/org/jeewx/api/wxstore/product/model/AttrInfoDetail.java
package org.jeewx.api.wxstore.product.model; public class AttrInfoDetail { // 文字描述 private String text; // 图片 private String img; public String getText() { return text; } public void setText(String text) { this.text = text; } public String getImg() { return img; } public void setImg(String img) { this.img = img; } }
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/wxstore/product/model/AttrInfo.java
src/main/java/org/jeewx/api/wxstore/product/model/AttrInfo.java
package org.jeewx.api.wxstore.product.model; import java.util.List; public class AttrInfo { // 商品名称 private String name; // 商品分类id private List<String> category_id; // 商品主图 private String main_img; // 商品图片列表 private List<String> img; // 商品详情列表 private List<AttrInfoDetail> detail; // 商品属性列表List private List<AttrInfoProperty> property; // 商品sku定义 private List<AttrInfoSku> sku_info; // 用户商品限购数量 private Integer buy_limit; public String getName() { return name; } public void setName(String name) { this.name = name; } public List<String> getCategory_id() { return category_id; } public void setCategory_id(List<String> category_id) { this.category_id = category_id; } public String getMain_img() { return main_img; } public void setMain_img(String main_img) { this.main_img = main_img; } public List<String> getImg() { return img; } public void setImg(List<String> img) { this.img = img; } public List<AttrInfoDetail> getDetail() { return detail; } public void setDetail(List<AttrInfoDetail> detail) { this.detail = detail; } public List<AttrInfoProperty> getProperty() { return property; } public void setProperty(List<AttrInfoProperty> property) { this.property = property; } public List<AttrInfoSku> getSku_info() { return sku_info; } public void setSku_info(List<AttrInfoSku> sku_info) { this.sku_info = sku_info; } public Integer getBuy_limit() { return buy_limit; } public void setBuy_limit(Integer buy_limit) { this.buy_limit = buy_limit; } }
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/wxstore/product/model/SkuInfo.java
src/main/java/org/jeewx/api/wxstore/product/model/SkuInfo.java
package org.jeewx.api.wxstore.product.model; import java.util.List; public class SkuInfo { // sku id private String id; // sku 名称 private String name; // sku vid列表 private List<SkuValue> value_list; 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 List<SkuValue> getValue_list() { return value_list; } public void setValue_list(List<SkuValue> value_list) { this.value_list = value_list; } }
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/wxstore/product/model/DeliveryInfo.java
src/main/java/org/jeewx/api/wxstore/product/model/DeliveryInfo.java
package org.jeewx.api.wxstore.product.model; import java.util.List; public class DeliveryInfo { // 运费类型 private Integer delivery_type; // 邮费模板ID private Integer template_id; // 快递 private List<DeliveryInfoExpress> express; // private Integer weight; // private Integer volume; public Integer getWeight() { return weight; } public void setWeight(Integer weight) { this.weight = weight; } public Integer getVolume() { return volume; } public void setVolume(Integer volume) { this.volume = volume; } public Integer getDelivery_type() { return delivery_type; } public void setDelivery_type(Integer delivery_type) { this.delivery_type = delivery_type; } public Integer getTemplate_id() { return template_id; } public void setTemplate_id(Integer template_id) { this.template_id = template_id; } public List<DeliveryInfoExpress> getExpress() { return express; } public void setExpress(List<DeliveryInfoExpress> express) { this.express = express; } }
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/wxstore/product/model/AttrExt.java
src/main/java/org/jeewx/api/wxstore/product/model/AttrExt.java
package org.jeewx.api.wxstore.product.model; public class AttrExt { // 是否包邮 private Integer isPostFree; // 是否提供发票 private Integer isHasReceipt; // 是否保修 private Integer isUnderGuaranty; // 是否支持退换货 private Integer isSupportReplace; // 商品所在地地址 private AttrExtLocation location; public Integer getIsPostFree() { return isPostFree; } public void setIsPostFree(Integer isPostFree) { this.isPostFree = isPostFree; } public Integer getIsHasReceipt() { return isHasReceipt; } public void setIsHasReceipt(Integer isHasReceipt) { this.isHasReceipt = isHasReceipt; } public Integer getIsUnderGuaranty() { return isUnderGuaranty; } public void setIsUnderGuaranty(Integer isUnderGuaranty) { this.isUnderGuaranty = isUnderGuaranty; } public Integer getIsSupportReplace() { return isSupportReplace; } public void setIsSupportReplace(Integer isSupportReplace) { this.isSupportReplace = isSupportReplace; } public AttrExtLocation getLocation() { return location; } public void setLocation(AttrExtLocation location) { this.location = location; } }
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/wxstore/product/model/CateInfo.java
src/main/java/org/jeewx/api/wxstore/product/model/CateInfo.java
package org.jeewx.api.wxstore.product.model; public class CateInfo { // 子分类ID private String id; // 子分类名称 private String name; 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; } }
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/wxstore/product/model/AttrInfoSku.java
src/main/java/org/jeewx/api/wxstore/product/model/AttrInfoSku.java
package org.jeewx.api.wxstore.product.model; public class AttrInfoSku { // sku属性id private String id; // sku值 private String vid; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getVid() { return vid; } public void setVid(String vid) { this.vid = vid; } }
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/wxstore/product/model/CommodityRtnInfo.java
src/main/java/org/jeewx/api/wxstore/product/model/CommodityRtnInfo.java
package org.jeewx.api.wxstore.product.model; public class CommodityRtnInfo { // 错误码 private String errcode; // 错误信息 private String errmsg; // 商品ID private String product_id; public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public String getProduct_id() { return product_id; } public void setProduct_id(String product_id) { this.product_id = product_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/wxstore/product/model/DeliveryInfoExpress.java
src/main/java/org/jeewx/api/wxstore/product/model/DeliveryInfoExpress.java
package org.jeewx.api.wxstore.product.model; public class DeliveryInfoExpress { // 快递ID private Integer id; // 运费 private Integer price; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getPrice() { return price; } public void setPrice(Integer price) { this.price = price; } }
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/wxstore/stock/JwStockAPI.java
src/main/java/org/jeewx/api/wxstore/stock/JwStockAPI.java
package org.jeewx.api.wxstore.stock; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import org.jeewx.api.core.common.WxstoreUtils; import org.jeewx.api.wxstore.stock.model.StockInfo; import org.jeewx.api.wxstore.stock.model.StockRtnInfo; /** * 微信小店 - 库存 * @author zhangdaihao * */ public class JwStockAPI { // 增加库存 private static String add_stock_url = "https://api.weixin.qq.com/merchant/stock/add?access_token=ACCESS_TOKEN"; // 减少库存 private static String sub_stock_url = "https://api.weixin.qq.com/merchant/stock/reduce?access_token=ACCESS_TOKEN"; /** * 增加库存 */ public static StockRtnInfo doAddStock(String newAccessToken, StockInfo stockInfo) { if (newAccessToken != null) { String requestUrl = add_stock_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(stockInfo)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); StockRtnInfo stockRtnInfo = (StockRtnInfo)JSONObject.toJavaObject(result, StockRtnInfo.class); return stockRtnInfo; } return null; } /** * 减少库存 */ public static StockRtnInfo doSubStock(String newAccessToken, StockInfo stockInfo) { if (newAccessToken != null) { String requestUrl = sub_stock_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(stockInfo)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); StockRtnInfo stockRtnInfo = (StockRtnInfo)JSONObject.toJavaObject(result, StockRtnInfo.class); return stockRtnInfo; } 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/wxstore/stock/model/StockRtnInfo.java
src/main/java/org/jeewx/api/wxstore/stock/model/StockRtnInfo.java
package org.jeewx.api.wxstore.stock.model; public class StockRtnInfo { // 错误码 private String errcode; // 错误信息 private String errmsg; public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = 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/wxstore/stock/model/StockInfo.java
src/main/java/org/jeewx/api/wxstore/stock/model/StockInfo.java
package org.jeewx.api.wxstore.stock.model; public class StockInfo { // 商品ID private String product_id; // sku信息 private String sku_info; // 库存数量 private Integer quantity; public String getProduct_id() { return product_id; } public void setProduct_id(String product_id) { this.product_id = product_id; } public String getSku_info() { return sku_info; } public void setSku_info(String sku_info) { this.sku_info = sku_info; } public Integer getQuantity() { return quantity; } public void setQuantity(Integer quantity) { this.quantity = quantity; } }
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/wxstore/group/JwGroupManangerAPI.java
src/main/java/org/jeewx/api/wxstore/group/JwGroupManangerAPI.java
package org.jeewx.api.wxstore.group; 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.wxstore.group.model.Group; import org.jeewx.api.wxstore.group.model.GroupDetailInfo; import org.jeewx.api.wxstore.group.model.GroupProductInfo; import org.jeewx.api.wxstore.group.model.GroupRtnInfo; import java.util.List; /** * 微信小店 - 分组 * @author zhangdaihao * */ public class JwGroupManangerAPI { // 增加分组 private static String create_group_url = "https://api.weixin.qq.com/merchant/group/add?access_token=ACCESS_TOKEN"; // 修改分组属性 private static String update_group_url = "https://api.weixin.qq.com/merchant/group/propertymod?access_token=ACCESS_TOKEN"; // 根据分组ID获取分组信息 private static String getid_group_url = "https://api.weixin.qq.com/merchant/group/getbyid?access_token=ACCESS_TOKEN"; // 删除分组 private static String del_group_url = "https://api.weixin.qq.com/merchant/group/del?access_token=ACCESS_TOKEN"; // 获取所有分组 private static String getall_group_url = "https://api.weixin.qq.com/merchant/group/getall?access_token=ACCESS_TOKEN"; // 修改分组商品 private static String update_productmod_url = "https://api.weixin.qq.com/merchant/group/productmod?access_token=ACCESS_TOKEN"; /** * 增加分组 * @param group * @return */ public static GroupRtnInfo doAddGroupManager(String newAccessToken, Group group) { if (newAccessToken != null) { String requestUrl = create_group_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(group)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); GroupRtnInfo groupRtnInfo = (GroupRtnInfo)JSONObject.toJavaObject(result, GroupRtnInfo.class); return groupRtnInfo; } return null; } /** * 删除分组 * @param group_id * @return */ public static GroupRtnInfo doDelGroupManager(String newAccessToken, Integer group_id) { if (newAccessToken != null) { String requestUrl = del_group_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"group_id\": "+group_id+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); GroupRtnInfo groupRtnInfo = (GroupRtnInfo)JSONObject.toJavaObject(result, GroupRtnInfo.class); return groupRtnInfo; } return null; } /** * 修改分组属性 * @param group * @return */ public static GroupRtnInfo doUpdateGroupManagerProperties(String newAccessToken, Group group) { if (newAccessToken != null) { String requestUrl = update_group_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(group)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); GroupRtnInfo groupRtnInfo = (GroupRtnInfo)JSONObject.toJavaObject(result, GroupRtnInfo.class); return groupRtnInfo; } return null; } /** * 修改分组商品 * @param groupProductInfo * @return */ public static GroupRtnInfo doUpdateGroupManagerProduct(String newAccessToken, GroupProductInfo groupProductInfo) { if (newAccessToken != null) { String requestUrl = update_productmod_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(groupProductInfo)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); GroupRtnInfo groupRtnInfo = (GroupRtnInfo)JSONObject.toJavaObject(result, GroupRtnInfo.class); return groupRtnInfo; } return null; } /** * 获取所有分组 * @return */ public static List<GroupDetailInfo> getAllGroup(String newAccessToken) { if (newAccessToken != null) { String requestUrl = getall_group_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "GET", null); // 正常返回 List<GroupDetailInfo> groupsDetailInfo = null; JSONArray info = result.getJSONArray("groups_detail"); groupsDetailInfo = JSONHelper.toList(info, GroupDetailInfo.class); return groupsDetailInfo; } return null; } /** * 根据分组ID获取分组信息 * @return */ public static GroupDetailInfo getByGroupId(String newAccessToken, Integer group_id) { if (newAccessToken != null) { String requestUrl = getid_group_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"group_id\": "+group_id+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); // 正常返回 GroupDetailInfo groupDetailInfo = null; JSONObject info = result.getJSONObject("group_detail"); groupDetailInfo = (GroupDetailInfo)JSONObject.toJavaObject(info, GroupDetailInfo.class); return groupDetailInfo; } 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/wxstore/group/model/GroupProduct.java
src/main/java/org/jeewx/api/wxstore/group/model/GroupProduct.java
package org.jeewx.api.wxstore.group.model; public class GroupProduct { // 商品ID private String product_id; // 修改操作(0-删除, 1-增加) private Integer mod_action; public String getProduct_id() { return product_id; } public void setProduct_id(String product_id) { this.product_id = product_id; } public Integer getMod_action() { return mod_action; } public void setMod_action(Integer mod_action) { this.mod_action = mod_action; } }
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/wxstore/group/model/GroupRtnInfo.java
src/main/java/org/jeewx/api/wxstore/group/model/GroupRtnInfo.java
package org.jeewx.api.wxstore.group.model; public class GroupRtnInfo { // 错误码 private Integer errcode; // 错误信息 private String errmsg; // 分组ID private Integer group_id; public Integer getErrcode() { return errcode; } public void setErrcode(Integer errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public Integer getGroup_id() { return group_id; } public void setGroup_id(Integer group_id) { this.group_id = group_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/wxstore/group/model/GroupProductInfo.java
src/main/java/org/jeewx/api/wxstore/group/model/GroupProductInfo.java
package org.jeewx.api.wxstore.group.model; import java.util.List; public class GroupProductInfo { // 分组ID private Integer group_id; // 分组的商品集合 private List<GroupProduct> product; public Integer getGroup_id() { return group_id; } public void setGroup_id(Integer group_id) { this.group_id = group_id; } public List<GroupProduct> getProduct() { return product; } public void setProduct(List<GroupProduct> product) { this.product = product; } }
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/wxstore/group/model/GroupDetailInfo.java
src/main/java/org/jeewx/api/wxstore/group/model/GroupDetailInfo.java
package org.jeewx.api.wxstore.group.model; import java.util.List; public class GroupDetailInfo { // 分组名称 private String group_id; // 分组名称 private String group_name; // 商品ID集合 private List<String> product_list; public String getGroup_id() { return group_id; } public void setGroup_id(String group_id) { this.group_id = group_id; } public String getGroup_name() { return group_name; } public void setGroup_name(String group_name) { this.group_name = group_name; } public List<String> getProduct_list() { return product_list; } public void setProduct_list(List<String> product_list) { this.product_list = product_list; } }
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/wxstore/group/model/Group.java
src/main/java/org/jeewx/api/wxstore/group/model/Group.java
package org.jeewx.api.wxstore.group.model; public class Group { // 分组详细 private GroupDetailInfo group_detail; // 分组D private Integer group_id; // 分组名称 private String group_name; public GroupDetailInfo getGroup_detail() { return group_detail; } public void setGroup_detail(GroupDetailInfo group_detail) { this.group_detail = group_detail; } public Integer getGroup_id() { return group_id; } public void setGroup_id(Integer group_id) { this.group_id = group_id; } public String getGroup_name() { return group_name; } public void setGroup_name(String group_name) { this.group_name = group_name; } }
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/wxstore/order/JwOrderManagerAPI.java
src/main/java/org/jeewx/api/wxstore/order/JwOrderManagerAPI.java
package org.jeewx.api.wxstore.order; 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.wxstore.order.model.OrderDelivery; import org.jeewx.api.wxstore.order.model.OrderInfo; import org.jeewx.api.wxstore.order.model.OrderPara; import org.jeewx.api.wxstore.order.model.OrderRtnInfo; import java.util.List; /** * 微信小店 - 订单 * @author zhangdaihao * */ public class JwOrderManagerAPI { // 根据订单ID获取订单详情 private static String getid_order_url = "https://api.weixin.qq.com/merchant/order/getbyid?access_token=ACCESS_TOKEN"; // 根据订单状态/创建时间获取订单详情 private static String getfilter_order_url = "https://api.weixin.qq.com/merchant/order/getbyfilter?access_token=ACCESS_TOKEN"; // 设置订单发货信息 private static String setdelivery_order_url = "https://api.weixin.qq.com/merchant/order/setdelivery?access_token=ACCESS_TOKEN"; // 关闭订单 private static String close_order_url = "https://api.weixin.qq.com/merchant/order/close?access_token=ACCESS_TOKEN"; /** * 根据订单ID获取订单详情 * @param order_id * @return */ public static OrderInfo getByOrderId(String newAccessToken, String order_id) { if (newAccessToken != null) { String requestUrl = getid_order_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"order_id\": \""+order_id+"\"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); // 正常返回 OrderInfo orderInfo = null; JSONObject info = result.getJSONObject("order"); orderInfo = (OrderInfo)JSONObject.toJavaObject(info, OrderInfo.class); return orderInfo; } return null; } /** * 根据订单状态/创建时间获取订单详情 * @param orderPara * @return */ public static List<OrderInfo> getByFilter(String newAccessToken, OrderPara orderPara) { if (newAccessToken != null) { String requestUrl = getfilter_order_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(orderPara)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "GET", obj.toString()); // 正常返回 List<OrderInfo> orderInfos = null; JSONArray info = result.getJSONArray("order_list"); orderInfos = JSONHelper.toList(info, OrderInfo.class); return orderInfos; } return null; } /** * 设置订单发货信息 * @param orderDelivery * @return */ public static OrderRtnInfo doDelivery(String newAccessToken, OrderDelivery orderDelivery) { if (newAccessToken != null) { String requestUrl = setdelivery_order_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSON.toJSONString(orderDelivery)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); OrderRtnInfo orderRtnInfo = (OrderRtnInfo)JSONObject.toJavaObject(result, OrderRtnInfo.class); return orderRtnInfo; } return null; } /** * 关闭订单 * @param order_id * @return */ public static OrderRtnInfo doCloseOrder(String newAccessToken, String order_id) { if (newAccessToken != null) { String requestUrl = close_order_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"order_id\": \""+order_id+"\"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); OrderRtnInfo orderRtnInfo = (OrderRtnInfo)JSONObject.toJavaObject(result, OrderRtnInfo.class); return orderRtnInfo; } 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/wxstore/order/model/OrderDelivery.java
src/main/java/org/jeewx/api/wxstore/order/model/OrderDelivery.java
package org.jeewx.api.wxstore.order.model; public class OrderDelivery { // 订单ID private String order_id; // 物流公司ID private String delivery_company; // 运单ID private String delivery_track_no; // 商品是否需要物流(0-不需要,1-需要,无该字段默认为需要物流) private Integer need_delivery; // 是否是提供的物流公司 private Integer is_others; public String getOrder_id() { return order_id; } public void setOrder_id(String order_id) { this.order_id = order_id; } public String getDelivery_company() { return delivery_company; } public void setDelivery_company(String delivery_company) { this.delivery_company = delivery_company; } public String getDelivery_track_no() { return delivery_track_no; } public void setDelivery_track_no(String delivery_track_no) { this.delivery_track_no = delivery_track_no; } public Integer getNeed_delivery() { return need_delivery; } public void setNeed_delivery(Integer need_delivery) { this.need_delivery = need_delivery; } public Integer getIs_others() { return is_others; } public void setIs_others(Integer is_others) { this.is_others = is_others; } }
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/wxstore/order/model/OrderInfo.java
src/main/java/org/jeewx/api/wxstore/order/model/OrderInfo.java
package org.jeewx.api.wxstore.order.model; public class OrderInfo { // 订单ID private String order_id; // 订单状态 private Integer order_status; // 订单总价格(单位 : 分) private Integer order_total_price; // 订单创建时间 private Integer order_create_time; // 订单运费价格(单位 : 分) private Integer order_express_price; // 买家微信OPENID private String buyer_openid; // 买家微信昵称 private String buyer_nick; // 收货人姓名 private String receiver_name; // 收货地址省份 private String receiver_province; // 收货地址城市 private String receiver_city; // 收货地址区/县 private String receiver_zone; // 收货详细地址 private String receiver_address; // 收货人移动电话 private String receiver_mobile; // 收货人固定电话 private String receiver_phone; // 商品ID private String product_id; // 商品名称 private String product_name; // 商品价格(单位 : 分) private Integer product_price; // 商品SKU private String product_sku; // 商品个数 private Integer product_count; // 商品图片 private String product_img; // 运单ID private String delivery_id; // 物流公司编码 private String delivery_company; // 交易ID private String trans_id; public String getOrder_id() { return order_id; } public void setOrder_id(String order_id) { this.order_id = order_id; } public Integer getOrder_status() { return order_status; } public void setOrder_status(Integer order_status) { this.order_status = order_status; } public Integer getOrder_total_price() { return order_total_price; } public void setOrder_total_price(Integer order_total_price) { this.order_total_price = order_total_price; } public Integer getOrder_create_time() { return order_create_time; } public void setOrder_create_time(Integer order_create_time) { this.order_create_time = order_create_time; } public Integer getOrder_express_price() { return order_express_price; } public void setOrder_express_price(Integer order_express_price) { this.order_express_price = order_express_price; } public String getBuyer_openid() { return buyer_openid; } public void setBuyer_openid(String buyer_openid) { this.buyer_openid = buyer_openid; } public String getBuyer_nick() { return buyer_nick; } public void setBuyer_nick(String buyer_nick) { this.buyer_nick = buyer_nick; } public String getReceiver_name() { return receiver_name; } public void setReceiver_name(String receiver_name) { this.receiver_name = receiver_name; } public String getReceiver_province() { return receiver_province; } public void setReceiver_province(String receiver_province) { this.receiver_province = receiver_province; } public String getReceiver_city() { return receiver_city; } public void setReceiver_city(String receiver_city) { this.receiver_city = receiver_city; } public String getReceiver_zone() { return receiver_zone; } public void setReceiver_zone(String receiver_zone) { this.receiver_zone = receiver_zone; } public String getReceiver_address() { return receiver_address; } public void setReceiver_address(String receiver_address) { this.receiver_address = receiver_address; } public String getReceiver_mobile() { return receiver_mobile; } public void setReceiver_mobile(String receiver_mobile) { this.receiver_mobile = receiver_mobile; } public String getReceiver_phone() { return receiver_phone; } public void setReceiver_phone(String receiver_phone) { this.receiver_phone = receiver_phone; } public String getProduct_id() { return product_id; } public void setProduct_id(String product_id) { this.product_id = product_id; } public String getProduct_name() { return product_name; } public void setProduct_name(String product_name) { this.product_name = product_name; } public Integer getProduct_price() { return product_price; } public void setProduct_price(Integer product_price) { this.product_price = product_price; } public String getProduct_sku() { return product_sku; } public void setProduct_sku(String product_sku) { this.product_sku = product_sku; } public Integer getProduct_count() { return product_count; } public void setProduct_count(Integer product_count) { this.product_count = product_count; } public String getProduct_img() { return product_img; } public void setProduct_img(String product_img) { this.product_img = product_img; } public String getDelivery_id() { return delivery_id; } public void setDelivery_id(String delivery_id) { this.delivery_id = delivery_id; } public String getDelivery_company() { return delivery_company; } public void setDelivery_company(String delivery_company) { this.delivery_company = delivery_company; } public String getTrans_id() { return trans_id; } public void setTrans_id(String trans_id) { this.trans_id = trans_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/wxstore/order/model/OrderPara.java
src/main/java/org/jeewx/api/wxstore/order/model/OrderPara.java
package org.jeewx.api.wxstore.order.model; public class OrderPara { // 订单状态(不带该字段-全部状态, 2-待发货, 3-已发货, 5-已完成, 8-维权中, ) private Integer status; // 订单创建时间起始时间(不带该字段则不按照时间做筛选) private Integer begintime; // 订单创建时间终止时间(不带该字段则不按照时间做筛选) private Integer endtime; public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Integer getBegintime() { return begintime; } public void setBegintime(Integer begintime) { this.begintime = begintime; } public Integer getEndtime() { return endtime; } public void setEndtime(Integer endtime) { this.endtime = endtime; } }
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/wxstore/order/model/OrderRtnInfo.java
src/main/java/org/jeewx/api/wxstore/order/model/OrderRtnInfo.java
package org.jeewx.api.wxstore.order.model; public class OrderRtnInfo { // 错误码 private Integer errcode; // 错误信息 private String errmsg; public Integer getErrcode() { return errcode; } public void setErrcode(Integer errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = 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/custservice/Test.java
src/main/java/org/jeewx/api/custservice/Test.java
package org.jeewx.api.custservice; import java.util.Date; import java.util.Iterator; import java.util.List; import org.jeewx.api.core.common.AccessToken; import org.jeewx.api.custservice.multicustservice.JwMultiCustomerAPI; import org.jeewx.api.custservice.multicustservice.model.ChatRecord; public class Test { private static String appid = "wxb512901288a94943"; private static String appscret = "6f94b81b49cf9f89fafe305dcaf2c632"; /** * @param args */ public static void main(String[] args) { Test t = new Test(); // 多客户服务转发测试 t.getMultiCustServcieMessage(); //指定用户服务转发测试 t.getSpecCustServcie(); //获取指定用户的客服的聊天记录列表 t.getCustServiceRecordList(); } public String getNewAccessToken() { return new AccessToken(appid, appscret).getNewAccessToken(); } // 获取转发多客服的响应消息 public void getMultiCustServcieMessage() { JwMultiCustomerAPI multCust = new JwMultiCustomerAPI(); System.out.println(multCust.getMultiCustServcieMessage("oqII7uCZnrPv3xc4eRuk9TACVbxU", "wxb512901288a94943")); } // 获取指定客服的响应消息 public void getSpecCustServcie() { JwMultiCustomerAPI multCust = new JwMultiCustomerAPI(); System.out.println(multCust.getSpecCustServcie(getNewAccessToken(), "oqII7uCZnrPv3xc4eRuk9TACVbxU", "wxb512901288a94943","xxxxx")); } // 获取指定客服的响应消息 public void getCustServiceRecordList() { JwMultiCustomerAPI multCust = new JwMultiCustomerAPI(); List<ChatRecord> chatRecods = multCust.getCustServiceRecordList(getNewAccessToken(), null, new Date().getTime(), new Date().getTime()+10000, 10, 1); for(Iterator<ChatRecord> it = chatRecods.iterator();it.hasNext();){ ChatRecord chatRecod = (ChatRecord)it.next(); System.out.println(chatRecod.getText()); } } }
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/custservice/multicustservice/JwMultiCustomerAPI.java
src/main/java/org/jeewx/api/custservice/multicustservice/JwMultiCustomerAPI.java
package org.jeewx.api.custservice.multicustservice; 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.custservice.multicustservice.model.ChatRecord; import org.jeewx.api.custservice.multicustservice.model.CustService; import java.util.Date; import java.util.Iterator; import java.util.List; /** * 客户服务- 多客户 * * @author caojm */ public class JwMultiCustomerAPI { //转发多客户端类型 private final static String TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service"; // 获取在线客服接待信息 private static String GET_ONLINE_CUSTSEVICE_URL = "https://api.weixin.qq.com/cgi-bin/customservice/getonlinekflist?access_token=ACCESS_TOKEN"; //获取客服记录列表 private static String GET_CUSTSEVICE_ROCORD_LIST_URL = "https://api.weixin.qq.com/cgi-bin/customservice/getrecord?access_token=ACCESS_TOKEN"; /** * 获取转发多客服的响应消息 * @param touser * @param fromuser * @return */ public String getMultiCustServcieMessage(String toUserName, String fromUserName) { StringBuilder custServiceMessage = new StringBuilder(); custServiceMessage.append("<xml>"); custServiceMessage.append("<ToUserName><![CDATA["+toUserName+"]]></ToUserName>"); custServiceMessage.append("<FromUserName><![CDATA["+fromUserName+"]]></FromUserName>"); custServiceMessage.append("<CreateTime>"+new Date().getTime()+"</CreateTime>"); custServiceMessage.append("<MsgType><![CDATA["+TRANSFER_CUSTOMER_SERVICE+"]]></MsgType>"); custServiceMessage.append("</xml>"); return custServiceMessage.toString(); } /** * 获取指定客服的响应消息 * @param accessToken * @param toUserName * @param fromUserName * @param kfAccount * @return */ public String getSpecCustServcie(String accessToken,String toUserName,String fromUserName,String kfAccount) { if(isOnlineCustServiceAvailable(accessToken,kfAccount)){ StringBuilder custServiceMessage = new StringBuilder(); custServiceMessage.append("<xml>"); custServiceMessage.append("<ToUserName><![CDATA["+toUserName+"]]></ToUserName>"); custServiceMessage.append("<FromUserName><![CDATA["+fromUserName+"]]></FromUserName>"); custServiceMessage.append("<CreateTime>"+new Date().getTime()+"</CreateTime>"); custServiceMessage.append("<MsgType><![CDATA["+TRANSFER_CUSTOMER_SERVICE+"]]></MsgType>"); custServiceMessage.append("<TransInfo>"); custServiceMessage.append("<KfAccount><![CDATA["+kfAccount+"]]></KfAccount>"); custServiceMessage.append("</TransInfo>"); custServiceMessage.append("</xml>"); return custServiceMessage.toString(); }else{ return null; } } /** * 判断指定客服是否在线可用 * @param accessToken * @param kfAccount * @return */ public boolean isOnlineCustServiceAvailable(String accessToken,String kfAccount) { List<CustService> custServices = null; if (accessToken != null) { String requestUrl = GET_ONLINE_CUSTSEVICE_URL.replace("ACCESS_TOKEN", accessToken); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "GET", null); if(result != null){ JSONArray info = result.getJSONArray("kf_online_list"); custServices = JSONHelper.toList(info, CustService.class); } } if(custServices!=null&&!custServices.isEmpty()){ for(Iterator<CustService> it = custServices.iterator();it.hasNext();){ CustService custService = (CustService)it.next(); //不在线、没有开启自动接入或者自动接入已满,都返回不可用 //不再返回自动接入参数 if (custService != null && custService.getKfAccount().equals(kfAccount) && custService.getStatus() > 0){ return true; } } } return false; } /** * 获取客服聊天记录列表 * @param accessToken * @param openId * @param startTime * @param endTime * @param pageSize * @param pageIndex * @return */ public List<ChatRecord> getCustServiceRecordList(String accessToken,String openId,long startTime,long endTime,int pageSize,int pageIndex) { List<ChatRecord> chatRecods = null; if (accessToken != null && startTime >= 0 && endTime >=0 && pageSize>=0 && pageIndex>0 ) { String requestUrl = GET_CUSTSEVICE_ROCORD_LIST_URL.replace("ACCESS_TOKEN", accessToken); StringBuilder jsonStrBuilder = new StringBuilder(); jsonStrBuilder.append("{"); jsonStrBuilder.append("\"starttime\":"+startTime+","); jsonStrBuilder.append("\"endtime\":"+endTime+","); if(openId!=null && !openId.equals("")){ jsonStrBuilder.append("\"openid\":\""+openId+"\","); } jsonStrBuilder.append("\"pagesize\":"+pageSize+","); jsonStrBuilder.append("\"pageindex\":"+pageIndex+","); jsonStrBuilder.append("}"); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", jsonStrBuilder.toString()); if(result != null){ JSONArray info = result.getJSONArray("recordlist"); chatRecods = JSONHelper.toList(info, ChatRecord.class); } return chatRecods; } 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/custservice/multicustservice/model/ChatRecord.java
src/main/java/org/jeewx/api/custservice/multicustservice/model/ChatRecord.java
package org.jeewx.api.custservice.multicustservice.model; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 客服聊天记录 * @author caojm */ public class ChatRecord extends WeixinReqParam{ //客服帐号 private String worker = ""; //用户标识 private String openId = ""; /** * 操作ID * 1000 创建未接入会话 * 1001 接入会话 * 1002 主动发起会话 * 1004 关闭会话 * 1005 抢接会话 * 2001 公众号收到消息 * 2002 客服发送消息 * 2003 客服收到消息 */ private String opercode = ""; //操作时间,UNIX时间戳 private String time = ""; //聊天记录 private String text = ""; public String getWorker() { return worker; } public void setWorker(String worker) { this.worker = worker; } public String getOpenId() { return openId; } public void setOpenId(String openId) { this.openId = openId; } public String getOpercode() { return opercode; } public void setOpercode(String opercode) { this.opercode = opercode; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } public String getText() { return text; } public void setText(String text) { this.text = text; } }
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/custservice/multicustservice/model/CustService.java
src/main/java/org/jeewx/api/custservice/multicustservice/model/CustService.java
package org.jeewx.api.custservice.multicustservice.model; import org.jeewx.api.core.req.model.WeixinReqParam; /** * 客户服务人员 * @author caojm * */ public class CustService extends WeixinReqParam{ //完整客服账号,格式为:账号前缀@公众号微信号 private String kfAccount = ""; //客服在线状态 1:pc在线,2:手机在线。若pc和手机同时在线则为 1+2=3 private int status = -1; //客服工号 private String kfId = ""; //客服设置的最大自动接入数 private int autoAccept = -1; //客服当前正在接待的会话数 private int acceptedCase = -1; public String getKfAccount() { return kfAccount; } public void setKfAccount(String kfAccount) { this.kfAccount = kfAccount; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public String getKfId() { return kfId; } public void setKfId(String kfId) { this.kfId = kfId; } public int getAutoAccept() { return autoAccept; } public void setAutoAccept(int autoAccept) { this.autoAccept = autoAccept; } public int getAcceptedCase() { return acceptedCase; } public void setAcceptedCase(int acceptedCase) { this.acceptedCase = acceptedCase; } }
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/coupon/JwCardConsumeAPITest.java
src/main/java/org/jeewx/api/coupon/JwCardConsumeAPITest.java
package org.jeewx.api.coupon; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; import org.jeewx.api.coupon.consume.JwCardConsumeAPI; import org.jeewx.api.coupon.consume.model.ConsumeRtnInfo; import org.jeewx.api.coupon.consume.model.EncryptRtnInfo; import org.jeewx.api.core.common.AccessToken; /** * 测试卡券核销 * @author mcl * @version v1.0 */ public class JwCardConsumeAPITest { private static String appid = "wxb512901288a94943"; private static String appscret = "6f94b81b49cf9f89fafe305dcaf2c632"; /** * 测试 */ public static void main(String[] args) { AccessToken atoken = new AccessToken(appid, appscret); String newAccessToken = atoken.getNewAccessToken(); //核销一张卡券 doConsumeTest(newAccessToken); //解码卡券code doDecryptTest(newAccessToken); } public static boolean doConsumeTest(String newAccessToken) { ConsumeRtnInfo rtnInfo = null; Map<String, String> onecase = null; List<Map<String, String>> testCases = doConsumeTestParam(); int len = testCases.size(); int pass = 0 ; int fail = 0 ; try { System.out.println("=========JwCardConsumeAPI.doConsume[核销一张卡券]开始测试=========="); for (int i = 0; i < len; i++) { onecase = testCases.get(i); rtnInfo = JwCardConsumeAPI.doConsume(newAccessToken, onecase.get("code"), onecase.get("card_id")); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ pass++; System.out.println("JwCardConsumeAPI.doConsume["+i+"]" + ":成功"); }else{ fail++; System.out.println("JwCardConsumeAPI.doConsume["+i+"]" + ":失败"+"["+rtnInfo.getErrmsg()+"]"); } Thread.sleep(1000); } System.out.println("==============JwCardConsumeAPI.doConsume测试结果================="); System.out.println("====================共计测试用例:[" +len+ "个]===================="); System.out.println("====================成功测试用例:[" +pass+ "个]===================="); System.out.println("====================失败测试用例:[" +fail+ "个]===================="); } catch (InterruptedException e) { e.printStackTrace(); } return true; } private static List<Map<String, String>> doConsumeTestParam(){ Map<String, String> onecase = null; List<Map<String, String>> testCases = new ArrayList<Map<String, String>>(); for(int i = 0 ; i < 5 ; i++){ onecase = new HashMap<String,String>(); onecase.put("code", random(32)); onecase.put("card_id", random(32)); testCases.add(onecase); } return testCases; } public static boolean doDecryptTest(String newAccessToken) { EncryptRtnInfo rtnInfo = null; Map<String, String> onecase = null; List<Map<String, String>> testCases = doDecryptTestParam(); int len = testCases.size(); int pass = 0 ; int fail = 0 ; try { System.out.println("=========JwCardConsumeAPI.doDecrypt[核销一张卡券]开始测试=========="); for (int i = 0; i < len; i++) { onecase = testCases.get(i); rtnInfo = JwCardConsumeAPI.doDecrypt(newAccessToken, onecase.get("encrypt_code")); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ pass++; System.out.println("JwCardConsumeAPI.doDecrypt["+i+"]" + ":成功"); }else{ fail++; System.out.println("JwCardConsumeAPI.doDecrypt["+i+"]" + ":失败"+"["+rtnInfo.getErrmsg()+"]"); } Thread.sleep(1000); } System.out.println("==============JwCardConsumeAPI.doDecrypt测试结果================="); System.out.println("====================共计测试用例:[" +len+ "个]===================="); System.out.println("====================成功测试用例:[" +pass+ "个]===================="); System.out.println("====================失败测试用例:[" +fail+ "个]===================="); } catch (InterruptedException e) { e.printStackTrace(); } return true; } private static List<Map<String, String>> doDecryptTestParam(){ Map<String, String> onecase = null; List<Map<String, String>> testCases = new ArrayList<Map<String, String>>(); for(int i = 0 ; i < 5 ; i++){ onecase = new HashMap<String,String>(); onecase.put("encrypt_code", random(32)); testCases.add(onecase); } return testCases; } private static String random(int len){ String BASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; Random random = new Random(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < len; i++) { int number = random.nextInt(BASE.length()); sb.append(BASE.charAt(number)); } 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/coupon/JwCardManageAPITest.java
src/main/java/org/jeewx/api/coupon/JwCardManageAPITest.java
package org.jeewx.api.coupon; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; import org.jeewx.api.core.common.AccessToken; import org.jeewx.api.core.exception.WexinReqException; import org.jeewx.api.coupon.manage.JwCardManageAPI; import org.jeewx.api.coupon.manage.model.BatchGetCardRtnInfo; import org.jeewx.api.coupon.manage.model.CardUpdate; import org.jeewx.api.coupon.manage.model.CommCardRtnInfo; import org.jeewx.api.coupon.manage.model.DelRtnInfo; import org.jeewx.api.coupon.manage.model.GetCardDetailRtnInfo; import org.jeewx.api.coupon.manage.model.GetCardRtnInfo; import org.jeewx.api.coupon.qrcode.JwQrcodeAPI; import org.jeewx.api.coupon.qrcode.model.GetticketRtn; /** * 测试卡券管理 * @author mcl * @version v1.0 */ public class JwCardManageAPITest { private static String appid = "wxd2b52b8f4bd5af7f"; private static String appscret = "1b982dba2c3f853c3396babcdfa6cb1e"; /** * 测试卡券管理 */ public static void main1(String[] args) { AccessToken atoken = new AccessToken(appid, appscret); String newAccessToken = atoken.getNewAccessToken(); //获取所有卡券ID(此方法适合数量不超过50个的) List<String> ls = getCardList(newAccessToken); for(String p:ls){ //根据卡券ID,获取卡券详细 GetCardDetailRtnInfo rtnInfo = JwCardManageAPI.doGetCardDetail(newAccessToken, p); if(rtnInfo.getCard().getCard_type().equals("CASH")){ System.out.println(rtnInfo.getCard().getCash().getReduce_cost()/100); } } //1.0批量获取卡券 // doBatchGetCardTest(newAccessToken); // //2.0删除卡券 // doDelCardTest(newAccessToken); // //3.0获取卡券详细信息 // doGetCardDetailTest(newAccessToken); // //4.0获取卡券信息 // doGetCardTest(newAccessToken); // //5.0更新卡券库存 // doModifystockCardTest(newAccessToken); // //6.0设置卡券失效状态 // doUnavailableCodeTest(newAccessToken); // //7.0更新卡券信息 // doUpdateCardTest(newAccessToken); // //8.0更新卡券code // doUpdateCodeTest(newAccessToken); } /** * 测试卡券管理 */ public static void main(String[] args) { AccessToken atoken = new AccessToken(appid, appscret); String newAccessToken = atoken.getNewAccessToken(); try { GetticketRtn s = JwQrcodeAPI.doGetticket(newAccessToken); System.out.println(s.getTicket()); } catch (WexinReqException e) { e.printStackTrace(); } } public static List<String> getCardList(String newAccessToken){ BatchGetCardRtnInfo rtnInfo = null; rtnInfo = JwCardManageAPI.doBatchGetCard(newAccessToken, 0, 50); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ //System.out.println("JwCardManageAPI.doBatchGetCard["+i+"]" + ":成功"); System.out.println(""); System.out.println("接口调用成功: card_id_list: "+rtnInfo.getCard_id_list()); return rtnInfo.getCard_id_list(); }else{ System.out.println("接口调用失败:"+"["+rtnInfo.getErrmsg()+"]"); return null; } } public static boolean doBatchGetCardTest(String newAccessToken) { BatchGetCardRtnInfo rtnInfo = null; Map<String, Integer> onecase = null; List<Map<String, Integer>> testCases = doBatchGetCardParam(); int len = testCases.size(); int pass = 0 ; int fail = 0 ; try { System.out.println("=========JwCardManageAPI.doBatchGetCard[批量查询卡列表]开始测试=========="); for (int i = 0; i < len; i++) { onecase = testCases.get(i); rtnInfo = JwCardManageAPI.doBatchGetCard(newAccessToken, onecase.get("offset"), onecase.get("count")); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ pass++; //System.out.println("JwCardManageAPI.doBatchGetCard["+i+"]" + ":成功"); System.out.println("card_id_list: "+rtnInfo.getCard_id_list()); }else{ fail++; System.out.println("JwCardManageAPI.doBatchGetCard["+i+"]" + ":失败"+"["+rtnInfo.getErrmsg()+"]"); } Thread.sleep(1000); } System.out.println("==============JwCardManageAPI.doBatchGetCard测试结果================="); System.out.println("====================共计测试用例:[" +len+ "个]===================="); System.out.println("====================成功测试用例:[" +pass+ "个]===================="); System.out.println("====================失败测试用例:[" +fail+ "个]===================="); } catch (InterruptedException e) { e.printStackTrace(); } return true; } private static List<Map<String, Integer>> doBatchGetCardParam(){ Map<String, Integer> onecase = null; List<Map<String, Integer>> testCases = new ArrayList<Map<String, Integer>>(); for(int i = 0 ; i < 5 ; i++){ onecase = new HashMap<String,Integer>(); onecase.put("offset", randomInt(1)); onecase.put("count", randomInt(2)); testCases.add(onecase); } return testCases; } public static boolean doDelCardTest(String newAccessToken) { DelRtnInfo rtnInfo = null; Map<String, String> onecase = null; List<Map<String, String>> testCases = doDelCardParam(); int len = testCases.size(); int pass = 0 ; int fail = 0 ; try { System.out.println("=========JwCardManageAPI.doDelCard[删除卡券]开始测试=========="); for (int i = 0; i < len; i++) { onecase = testCases.get(i); rtnInfo = JwCardManageAPI.doDelCard(newAccessToken, onecase.get("card_id")); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ pass++; System.out.println("JwCardManageAPI.doDelCard["+i+"]" + ":成功"); }else{ fail++; System.out.println("JwCardManageAPI.doDelCard["+i+"]" + ":失败"+"["+rtnInfo.getErrmsg()+"]"); } Thread.sleep(1000); } System.out.println("==============JwCardManageAPI.doDelCard测试结果================="); System.out.println("====================共计测试用例:[" +len+ "个]===================="); System.out.println("====================成功测试用例:[" +pass+ "个]===================="); System.out.println("====================失败测试用例:[" +fail+ "个]===================="); } catch (InterruptedException e) { e.printStackTrace(); } return true; } private static List<Map<String, String>> doDelCardParam(){ Map<String, String> onecase = null; List<Map<String, String>> testCases = new ArrayList<Map<String, String>>(); for(int i = 0 ; i < 5 ; i++){ onecase = new HashMap<String,String>(); onecase.put("card_id", randomStr(32)); testCases.add(onecase); } return testCases; } public static boolean doGetCardDetailTest(String newAccessToken) { GetCardDetailRtnInfo rtnInfo = null; Map<String, String> onecase = null; List<Map<String, String>> testCases = doGetCardDetailParam(); int len = testCases.size(); int pass = 0 ; int fail = 0 ; try { System.out.println("=========JwCardManageAPI.doGetCardDetail[查询卡券详情]开始测试=========="); for (int i = 0; i < len; i++) { onecase = testCases.get(i); rtnInfo = JwCardManageAPI.doGetCardDetail(newAccessToken, onecase.get("card_id")); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ pass++; System.out.println("JwCardManageAPI.doGetCardDetail["+i+"]" + ":成功"); }else{ fail++; System.out.println("JwCardManageAPI.doGetCardDetail["+i+"]" + ":失败"+"["+rtnInfo.getErrmsg()+"]"); } Thread.sleep(1000); } System.out.println("==============JwCardManageAPI.doGetCardDetail测试结果================="); System.out.println("====================共计测试用例:[" +len+ "个]===================="); System.out.println("====================成功测试用例:[" +pass+ "个]===================="); System.out.println("====================失败测试用例:[" +fail+ "个]===================="); } catch (InterruptedException e) { e.printStackTrace(); } return true; } private static List<Map<String, String>> doGetCardDetailParam(){ Map<String, String> onecase = null; List<Map<String, String>> testCases = new ArrayList<Map<String, String>>(); for(int i = 0 ; i < 5 ; i++){ onecase = new HashMap<String,String>(); onecase.put("card_id", randomStr(32)); testCases.add(onecase); } return testCases; } public static boolean doGetCardTest(String newAccessToken) { GetCardRtnInfo rtnInfo = null; Map<String, String> onecase = null; List<Map<String, String>> testCases = doGetCardParam(); int len = testCases.size(); int pass = 0 ; int fail = 0 ; try { System.out.println("=========JwCardManageAPI.doGetCard[查询卡券]开始测试=========="); for (int i = 0; i < len; i++) { onecase = testCases.get(i); rtnInfo = JwCardManageAPI.doGetCard(newAccessToken, onecase.get("code"), onecase.get("card_id")); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ pass++; System.out.println("JwCardManageAPI.doGetCard["+i+"]" + ":成功"); }else{ fail++; System.out.println("JwCardManageAPI.doGetCard["+i+"]" + ":失败"+"["+rtnInfo.getErrmsg()+"]"); } Thread.sleep(1000); } System.out.println("==============JwCardManageAPI.doGetCard测试结果================="); System.out.println("====================共计测试用例:[" +len+ "个]===================="); System.out.println("====================成功测试用例:[" +pass+ "个]===================="); System.out.println("====================失败测试用例:[" +fail+ "个]===================="); } catch (InterruptedException e) { e.printStackTrace(); } return true; } private static List<Map<String, String>> doGetCardParam(){ Map<String, String> onecase = null; List<Map<String, String>> testCases = new ArrayList<Map<String, String>>(); for(int i = 0 ; i < 5 ; i++){ onecase = new HashMap<String,String>(); onecase.put("code", randomStr(32)); onecase.put("card_id", randomStr(32)); testCases.add(onecase); } return testCases; } public static boolean doModifystockCardTest(String newAccessToken) { CommCardRtnInfo rtnInfo = null; Map<String, String> onecase = null; List<Map<String, String>> testCases = doModifystockCardParam(); int len = testCases.size(); int pass = 0 ; int fail = 0 ; try { System.out.println("=========JwCardManageAPI.doModifystockCard[更改库存]开始测试=========="); for (int i = 0; i < len; i++) { onecase = testCases.get(i); rtnInfo = JwCardManageAPI.doModifystockCard(newAccessToken, onecase.get("card_id"), Integer.parseInt(onecase.get("increase_stock_value")), Integer.parseInt(onecase.get("reduce_stock_value"))); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ pass++; System.out.println("JwCardManageAPI.doModifystockCard["+i+"]" + ":成功"); }else{ fail++; System.out.println("JwCardManageAPI.doModifystockCard["+i+"]" + ":失败"+"["+rtnInfo.getErrmsg()+"]"); } Thread.sleep(1000); } System.out.println("==============JwCardManageAPI.doModifystockCard测试结果================="); System.out.println("====================共计测试用例:[" +len+ "个]===================="); System.out.println("====================成功测试用例:[" +pass+ "个]===================="); System.out.println("====================失败测试用例:[" +fail+ "个]===================="); } catch (InterruptedException e) { e.printStackTrace(); } return true; } private static List<Map<String, String>> doModifystockCardParam(){ Map<String, String> onecase = null; List<Map<String, String>> testCases = new ArrayList<Map<String, String>>(); for(int i = 0 ; i < 5 ; i++){ onecase = new HashMap<String,String>(); onecase.put("card_id", randomStr(32)); onecase.put("increase_stock_value", randomInt(1)+""); onecase.put("reduce_stock_value", randomInt(2)+""); testCases.add(onecase); } return testCases; } public static boolean doUnavailableCodeTest(String newAccessToken) { CommCardRtnInfo rtnInfo = null; Map<String, String> onecase = null; List<Map<String, String>> testCases = doUnavailableCodeParam(); int len = testCases.size(); int pass = 0 ; int fail = 0 ; try { System.out.println("=========JwCardManageAPI.doUnavailableCode[卡券设置为失效状态]开始测试=========="); for (int i = 0; i < len; i++) { onecase = testCases.get(i); rtnInfo = JwCardManageAPI.doUnavailableCode(newAccessToken, onecase.get("code"),onecase.get("card_id")); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ pass++; System.out.println("JwCardManageAPI.doUnavailableCode["+i+"]" + ":成功"); }else{ fail++; System.out.println("JwCardManageAPI.doUnavailableCode["+i+"]" + ":失败"+"["+rtnInfo.getErrmsg()+"]"); } Thread.sleep(1000); } System.out.println("==============JwCardManageAPI.doUnavailableCode测试结果================="); System.out.println("====================共计测试用例:[" +len+ "个]===================="); System.out.println("====================成功测试用例:[" +pass+ "个]===================="); System.out.println("====================失败测试用例:[" +fail+ "个]===================="); } catch (InterruptedException e) { e.printStackTrace(); } return true; } private static List<Map<String, String>> doUnavailableCodeParam(){ Map<String, String> onecase = null; List<Map<String, String>> testCases = new ArrayList<Map<String, String>>(); for(int i = 0 ; i < 5 ; i++){ onecase = new HashMap<String,String>(); onecase.put("card_id", randomStr(32)); onecase.put("code", randomStr(32)); testCases.add(onecase); } return testCases; } public static boolean doUpdateCardTest(String newAccessToken) { CommCardRtnInfo rtnInfo = null; Map<String, Object> onecase = null; List<Map<String, Object>> testCases = doUpdateCardParam(); int len = testCases.size(); int pass = 0 ; int fail = 0 ; try { System.out.println("=========JwCardManageAPI.doUpdateCard[更新卡券]开始测试=========="); for (int i = 0; i < len; i++) { onecase = testCases.get(i); rtnInfo = JwCardManageAPI.doUpdateCard(newAccessToken, (CardUpdate)(onecase.get("cardUpdate"))); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ pass++; System.out.println("JwCardManageAPI.doUpdateCard["+i+"]" + ":成功"); }else{ fail++; System.out.println("JwCardManageAPI.doUpdateCard["+i+"]" + ":失败"+"["+rtnInfo.getErrmsg()+"]"); } Thread.sleep(1000); } System.out.println("==============JwCardManageAPI.doUpdateCard测试结果================="); System.out.println("====================共计测试用例:[" +len+ "个]===================="); System.out.println("====================成功测试用例:[" +pass+ "个]===================="); System.out.println("====================失败测试用例:[" +fail+ "个]===================="); } catch (InterruptedException e) { e.printStackTrace(); } return true; } private static List<Map<String, Object>> doUpdateCardParam(){ Map<String, Object> onecase = null; List<Map<String, Object>> testCases = new ArrayList<Map<String, Object>>(); CardUpdate cardUpdate = new CardUpdate(); for(int i = 0 ; i < 5 ; i++){ onecase = new HashMap<String,Object>(); onecase.put("cardUpdate", cardUpdate); testCases.add(onecase); } return testCases; } public static boolean doUpdateCodeTest(String newAccessToken) { CommCardRtnInfo rtnInfo = null; Map<String, Object> onecase = null; List<Map<String, Object>> testCases = doUpdateCodeParam(); int len = testCases.size(); int pass = 0 ; int fail = 0 ; try { System.out.println("=========JwCardManageAPI.doUpdateCode[更改code]开始测试=========="); for (int i = 0; i < len; i++) { onecase = testCases.get(i); rtnInfo = JwCardManageAPI.doUpdateCode(newAccessToken, onecase.get("code").toString(), onecase.get("card_id").toString(), onecase.get("new_code").toString()); if(Integer.parseInt(rtnInfo.getErrcode()) == 0){ pass++; System.out.println("JwCardManageAPI.doUpdateCode["+i+"]" + ":成功"); }else{ fail++; System.out.println("JwCardManageAPI.doUpdateCode["+i+"]" + ":失败"+"["+rtnInfo.getErrmsg()+"]"); } Thread.sleep(1000); } System.out.println("==============JwCardManageAPI.doUpdateCode测试结果================="); System.out.println("====================共计测试用例:[" +len+ "个]===================="); System.out.println("====================成功测试用例:[" +pass+ "个]===================="); System.out.println("====================失败测试用例:[" +fail+ "个]===================="); } catch (InterruptedException e) { e.printStackTrace(); } return true; } private static List<Map<String, Object>> doUpdateCodeParam(){ Map<String, Object> onecase = null; List<Map<String, Object>> testCases = new ArrayList<Map<String, Object>>(); for(int i = 0 ; i < 5 ; i++){ onecase = new HashMap<String,Object>(); onecase.put("code", randomStr(32)); onecase.put("card_id", randomStr(32)); onecase.put("new_code", randomStr(32)); testCases.add(onecase); } return testCases; } private static String randomStr(int len){ String BASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; Random random = new Random(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < len; i++) { int number = random.nextInt(BASE.length()); sb.append(BASE.charAt(number)); } return sb.toString(); } private static Integer randomInt(int len){ String BASE = "0123456789"; Random random = new Random(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < len; i++) { int number = random.nextInt(BASE.length()); sb.append(BASE.charAt(number)); } return Integer.parseInt(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/coupon/consume/JwCardConsumeAPI.java
src/main/java/org/jeewx/api/coupon/consume/JwCardConsumeAPI.java
package org.jeewx.api.coupon.consume; import com.alibaba.fastjson.JSONObject; import org.jeewx.api.core.common.WxstoreUtils; import org.jeewx.api.coupon.consume.model.ConsumeRtnInfo; import org.jeewx.api.coupon.consume.model.EncryptRtnInfo; /** * 微信卡券 - 核销接口 * @author mcl * @version v1.0 */ public class JwCardConsumeAPI { // 消耗code 即核销一张卡券 private static final String consume_code_url = "https://api.weixin.qq.com/card/code/consume?access_token=ACCESS_TOKEN"; // 解码code private static final String decrypt_code_url = "https://api.weixin.qq.com/card/code/decrypt?access_token=ACCESS_TOKEN"; /** * 核销一张卡券. * * @param consumeCode * @return */ public static ConsumeRtnInfo doConsume(String newAccessToken,String code,String card_id) { if (newAccessToken != null) { String requestUrl = consume_code_url.replace("ACCESS_TOKEN", newAccessToken); String json = emptyStrJson("code",code,"card_id",card_id); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); ConsumeRtnInfo consumeRtnInfo = (ConsumeRtnInfo) JSONObject.toJavaObject( result, ConsumeRtnInfo.class); return consumeRtnInfo; } return null; } /** * 解码code. 解码接口支持两种场景: 1.商家获取choos_card_info 后,将card_id 和encrypt_code * 字段通过解码接口,获取真实code。 2.卡券内跳转外链的签名中会对code 进行加密处理,通过调用解码接口获取真实code。 * @param encrypt_code * @return */ public static EncryptRtnInfo doDecrypt(String newAccessToken,String encrypt_code) { if (newAccessToken != null) { String requestUrl = decrypt_code_url.replace("ACCESS_TOKEN", newAccessToken); String json = emptyStrJson("encrypt_code",encrypt_code); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); EncryptRtnInfo encryptRtnInfo = (EncryptRtnInfo) JSONObject.toJavaObject( result, EncryptRtnInfo.class); return encryptRtnInfo; } return null; } /** * 主要解决传入参数为null或""生成json的问题。 */ private static String emptyStrJson(String field1,String value1){ String json = ""; if(value1!=null && value1.trim().length() > 0){ json = "{\""+field1+"\":\""+value1+"\"}"; } return json; } /** * 主要解决传入参数为null或""生成json的问题。 */ private static String emptyStrJson(String field1,String value1,String field2,String value2){ String json = ""; if(value1!=null && value1.trim().length() > 0){ json = "{\""+field1+"\":\""+value1+"\""; } if(value2!=null && value2.trim().length() > 0){ if(json.trim().length() > 0){ json = json+",\""+field2+"\":\""+value2+"\"}"; }else{ json = "{\""+field2+"\":\""+value2+"\"}"; } } if(json.trim().length() > 0 && !json.endsWith("}")){ json = json + "}"; } 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/coupon/consume/model/ConsumeRtnInfoCard.java
src/main/java/org/jeewx/api/coupon/consume/model/ConsumeRtnInfoCard.java
package org.jeewx.api.coupon.consume.model; public class ConsumeRtnInfoCard { // 核销卡券id. private String card_id; public String getCard_id() { return card_id; } public void setCard_id(String card_id) { this.card_id = card_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/coupon/consume/model/EncryptRtnInfo.java
src/main/java/org/jeewx/api/coupon/consume/model/EncryptRtnInfo.java
package org.jeewx.api.coupon.consume.model; public class EncryptRtnInfo { // 错误码 private String errcode; // 错误信息 private String errmsg; // 卡券真实序列号 private String code; public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } }
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/coupon/consume/model/ConsumeRtnInfo.java
src/main/java/org/jeewx/api/coupon/consume/model/ConsumeRtnInfo.java
package org.jeewx.api.coupon.consume.model; public class ConsumeRtnInfo { // 错误码 private String errcode; // 错误信息 private String errmsg; // 核销卡券信息仅包含card_id private ConsumeRtnInfoCard card; // 核销卡券所属用户id(用户和公众号之间的唯一标识) private String openid; public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public ConsumeRtnInfoCard getCard() { return card; } public void setCard(ConsumeRtnInfoCard card) { this.card = card; } 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/coupon/manage/CardConsts.java
src/main/java/org/jeewx/api/coupon/manage/CardConsts.java
package org.jeewx.api.coupon.manage; public class CardConsts { /** * 卡券类型. */ public static class CardType { // 通用券 public static final String generalCoupon = "GENERAL_COUPON"; // 团购券 public static final String groupon = "GROUPON"; // 折扣券 public static final String discount = "DISCOUNT"; // 礼品券 public static final String gift = "GIFT"; // 代金券 public static final String cash = "CASH"; // 会员卡 public static final String memberCard = "MEMBER_CARD"; // 门票 public static final String scenicTicket = "SCENIC_TICKET"; // 电影票 public static final String movieTicket = "MOVIE_TICKET"; // 飞机票 public static final String boardingPass = "BOARDING_PASS"; // 红包 public static final String luckyMoney = "LUCKY_MONEY"; // 会议门票 public static final String meetingTicket = "MEETING_TICKET"; } /** * code 码展示类型. */ public static class CodeType { // 文本 public static final String codeTypeText = "CODE_TYPE_TEXT"; // 一维码 public static final String codeTypeBarcode = "CODE_TYPE_BARCODE"; // 二维码 public static final String codeTypeQrcode = "CODE_TYPE_QRCODE"; } /** * 卡券状态. */ public static class Status { // 待审核 public static final String cardStatusNotVerify = "CARD_STATUS_NOT_VERIFY"; // 审核失败 public static final String cardStatusVerifyFall = "CARD_STATUS_VERIFY_FALL"; // 通过审核 public static final String cardStatusVerifyOk = "CARD_STATUS_VERIFY_OK"; //卡券被用户删除 public static final String cardStatusUserDelete = "CARD_STATUS_USER_DELETE"; //在公众平台投放过的卡券 public static final String cardStatusUserOnShelf = "CARD_STATUS_USER_ON_SHELF"; } /** * 自定义cell 字段type 类型. */ public static class UrlNameType { // 外卖 public static final String urlNameTypeTakeAway = "URL_NAME_TYPE_TAKE_AWAY"; // 在线预订 public static final String urlNameTypeReservation = "URL_NAME_TYPE_RESERVATION"; // 立即使用 public static final String urlNameTypeUseImmediately = "URL_NAME_TYPE_USE_IMMEDIATELY"; // 在线预约 public static final String urlNameTypeAppointment = "URL_NAME_TYPE_APPOINTMENT"; // 在线兑换 public static final String urlNameTypeExchange = "URL_NAME_TYPE_EXCHANGE"; // 会员服务(仅会员卡类型可用) public static final String urlNameTypeVipService = "URL_NAME_TYPE_VIP_SERVICE"; } }
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/coupon/manage/JwCardManageAPI.java
src/main/java/org/jeewx/api/coupon/manage/JwCardManageAPI.java
package org.jeewx.api.coupon.manage; import com.alibaba.fastjson.JSONObject; import org.jeewx.api.core.common.WxstoreUtils; import org.jeewx.api.coupon.manage.model.*; /** * 微信卡券 - 基础管理 * @author mcl * @version v1.0 */ public class JwCardManageAPI { // 删除卡券 private static final String del_card_url = "https://api.weixin.qq.com/card/delete?access_token=ACCESS_TOKEN"; // 查询卡券 private static final String get_card_url = "https://api.weixin.qq.com/card/code/get?access_token=ACCESS_TOKEN"; // 批量查询卡列表 private static final String batchget_card_url = "https://api.weixin.qq.com/card/batchget?access_token=ACCESS_TOKEN"; // 查询卡券详情 private static final String get_card_detail_url = "https://api.weixin.qq.com/card/get?access_token=ACCESS_TOKEN"; //更改code private static final String update_code_url = "https://api.weixin.qq.com/card/code/update?access_token=ACCESS_TOKEN"; //设置卡券失效 private static final String unavailable_code_url = "https://api.weixin.qq.com/card/code/unavailable?access_token=ACCESS_TOKEN"; //更改卡券信息 private static final String update_card_url = "https://api.weixin.qq.com/card/update?access_token=ACCESS_TOKEN"; //更改库存 private static final String modifystock_card_url = "https://api.weixin.qq.com/card/modifystock?access_token=ACCESS_TOKEN"; /** * 删除卡券 */ public static DelRtnInfo doDelCard(String newAccessToken,String card_id) { if (newAccessToken != null) { String requestUrl = del_card_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"card_id\": \""+card_id+"\"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); DelRtnInfo delRtnInfo = (DelRtnInfo)JSONObject.toJavaObject(result, DelRtnInfo.class); return delRtnInfo; } return null; } /** * 查询卡券 */ public static GetCardRtnInfo doGetCard(String newAccessToken,String code,String card_id) { if (newAccessToken != null) { String requestUrl = get_card_url.replace("ACCESS_TOKEN", newAccessToken); String json = emptyStrJson("code",code,"card_id",card_id); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); GetCardRtnInfo getCardRtnInfo = (GetCardRtnInfo)JSONObject.toJavaObject(result, GetCardRtnInfo.class); return getCardRtnInfo; } return null; } /** * 批量查询卡列表 * @param offset 查询卡列表的起始偏移量,从0 开始,即offset: 5 是指从从列表里的第六个开始读取。 * @param count 需要查询的卡片的数量(数量最大50)。 */ public static BatchGetCardRtnInfo doBatchGetCard(String newAccessToken,int offset,int count) { if (newAccessToken != null) { String requestUrl = batchget_card_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"offset\":"+offset+",\"count\": "+count+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); BatchGetCardRtnInfo batchGetCardRtnInfo = (BatchGetCardRtnInfo)JSONObject.toJavaObject(result, BatchGetCardRtnInfo.class); return batchGetCardRtnInfo; } return null; } /** * 查询卡券详情 */ public static GetCardDetailRtnInfo doGetCardDetail(String newAccessToken,String card_id) { if (newAccessToken != null) { String requestUrl = get_card_detail_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"card_id\":\""+card_id+"\"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); GetCardDetailRtnInfo getCardDetailRtnInfo = (GetCardDetailRtnInfo)JSONObject.toJavaObject(result, GetCardDetailRtnInfo.class); return getCardDetailRtnInfo; } return null; } /** * 更改code * 为确保转赠后的安全性,微信允许自定义code的商户对已下发的code进行更改。 * 注:为避免用户疑惑,建议仅在发生转赠行为后(发生转赠后,微信会通过事件推送的方 * 式告知商户被转赠的卡券code)对用户的code进行更改。 * @param code 卡券的code 编码。 * @param card_id 卡券ID。 * @param new_code 新的卡券code 编码 */ public static CommCardRtnInfo doUpdateCode(String newAccessToken,String code,String card_id,String new_code) { if (newAccessToken != null) { String requestUrl = update_code_url.replace("ACCESS_TOKEN", newAccessToken); String json = emptyStrJson("code",code,"card_id",card_id,"new_code",new_code); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); CommCardRtnInfo commCardRtnInfo = (CommCardRtnInfo)JSONObject.toJavaObject(result, CommCardRtnInfo.class); return commCardRtnInfo; } return null; } /** * 卡券设置为失效状态 * 为满足改票、退款等异常情况,可调用卡券失效接口将用户的卡券设置为失效状态。 * 注:设置卡券失效的操作不可逆,即无法将设置为失效的卡券调回有效状态,商家须慎重调用该接口。 * @param code 卡券的code 编码。 * @param card_id 自定义code卡券才填写。 */ public static CommCardRtnInfo doUnavailableCode(String newAccessToken,String code,String card_id) { if (newAccessToken != null) { String requestUrl = unavailable_code_url.replace("ACCESS_TOKEN", newAccessToken); String json = emptyStrJson("code",code,"card_id",card_id); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); CommCardRtnInfo commCardRtnInfo = (CommCardRtnInfo)JSONObject.toJavaObject(result, CommCardRtnInfo.class); return commCardRtnInfo; } return null; } /** * 更改卡券信息 * 支持更新部分通用字段及特殊卡券(会员卡、飞机票、电影票、红包)中特定字段的信息。 * 注:更改卡券的部分字段后会重新提交审核 * @param code 卡券的code 编码。 * @param card_id 自定义code卡券才填写。 */ public static CommCardRtnInfo doUpdateCard(String newAccessToken,CardUpdate cardUpdate) { if (newAccessToken != null) { String requestUrl = update_card_url.replace("ACCESS_TOKEN", newAccessToken); JSONObject obj = JSONObject.parseObject(JSONObject.toJSONString(cardUpdate)); JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", obj.toString()); CommCardRtnInfo commCardRtnInfo = (CommCardRtnInfo)JSONObject.toJavaObject(result, CommCardRtnInfo.class); return commCardRtnInfo; } return null; } /** * 库存修改 * 增减某张卡券的库存 * @param card_id 自定义code卡券才填写。 * @param increase_stock_value 增加多少库存,可以不填或填0。 * @param reduce_stock_value 减少多少库存,可以不填或填0 */ public static CommCardRtnInfo doModifystockCard(String newAccessToken,String card_id,int increase_stock_value,int reduce_stock_value) { if (newAccessToken != null) { String requestUrl = modifystock_card_url.replace("ACCESS_TOKEN", newAccessToken); String json = "{\"card_id\":\""+card_id+"\",\"increase_stock_value\": "+increase_stock_value+",\"reduce_stock_value\": "+reduce_stock_value+"}"; JSONObject result = WxstoreUtils.httpRequest(requestUrl, "POST", json); CommCardRtnInfo commCardRtnInfo = (CommCardRtnInfo)JSONObject.toJavaObject(result, CommCardRtnInfo.class); return commCardRtnInfo; } return null; } /** * 主要解决传入参数为null或""生成json的问题。 */ private static String emptyStrJson(String field1,String value1,String field2,String value2){ String json = ""; if(value1!=null && value1.trim().length() > 0){ json = "{\""+field1+"\":\""+value1+"\""; } if(value2!=null && value2.trim().length() > 0){ if(json.trim().length() > 0){ json = json+",\""+field2+"\":\""+value1+"\"}"; }else{ json = "{\""+field2+"\":\""+value2+"\"}"; } } if(json.trim().length() > 0 && !json.endsWith("}")){ json = json + "}"; } return json; } /** * 主要解决传入参数为null或""生成json的问题。 */ private static String emptyStrJson(String field1,String value1,String field2,String value2,String field3,String value3){ String json = ""; if(value1!=null && value1.trim().length() > 0){ json = "{\""+field1+"\":\""+value1+"\""; } if(value2!=null && value2.trim().length() > 0){ if(json.trim().length() > 0){ json = json+",\""+field2+"\":\""+value2+"\""; }else{ json = "{\""+field2+"\":\""+value2+"\""; } } if(value3!=null && value3.trim().length() > 0){ if(json.trim().length() > 0){ json = json+",\""+field3+"\":\""+value3+"\""; }else{ json = "{\""+field3+"\":\""+value3+"\""; } } if(json.trim().length() > 0 && !json.endsWith("}")){ json = json + "}"; } 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/coupon/manage/model/BoardingPassUpdate.java
src/main/java/org/jeewx/api/coupon/manage/model/BoardingPassUpdate.java
package org.jeewx.api.coupon.manage.model; /** * 可以被更新的飞机票信息。 * * @author mcl * @version v1.0 */ public class BoardingPassUpdate { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfoUpdate base_info; // 起飞时间。Unix 时间戳格式。 private Long departure_time; // 降落时间。Unix 时间戳格式。 private Long landing_time; private String gate; // 登机时间,只显示“时分”不显示日期,按时间戳格式填写。如发生登机时间变更,建议商家实时调用该接口变更。 private Long boarding_time; public BaseInfoUpdate getBase_info() { return base_info; } public void setBase_info(BaseInfoUpdate base_info) { this.base_info = base_info; } public Long getDeparture_time() { return departure_time; } public void setDeparture_time(Long departure_time) { this.departure_time = departure_time; } public Long getLanding_time() { return landing_time; } public void setLanding_time(Long landing_time) { this.landing_time = landing_time; } public String getGate() { return gate; } public void setGate(String gate) { this.gate = gate; } public Long getBoarding_time() { return boarding_time; } public void setBoarding_time(Long boarding_time) { this.boarding_time = boarding_time; } }
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/coupon/manage/model/CommCardRtnInfo.java
src/main/java/org/jeewx/api/coupon/manage/model/CommCardRtnInfo.java
package org.jeewx.api.coupon.manage.model; public class CommCardRtnInfo { // 错误码 private String errcode; // 错误信息 private String errmsg; public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = 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/coupon/manage/model/BatchGetCardRtnInfo.java
src/main/java/org/jeewx/api/coupon/manage/model/BatchGetCardRtnInfo.java
package org.jeewx.api.coupon.manage.model; import java.util.List; public class BatchGetCardRtnInfo { // 错误码 private String errcode; // 错误信息 private String errmsg; // 卡id 列表 private List<String> card_id_list; // 该商户名下card_id 总数 private Integer total_num; public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public List<String> getCard_id_list() { return card_id_list; } public void setCard_id_list(List<String> card_id_list) { this.card_id_list = card_id_list; } public Integer getTotal_num() { return total_num; } public void setTotal_num(Integer total_num) { this.total_num = total_num; } }
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/coupon/manage/model/LuckyMoney.java
src/main/java/org/jeewx/api/coupon/manage/model/LuckyMoney.java
package org.jeewx.api.coupon.manage.model; /** * 红包。 * * @author mcl * @version v1.0 */ public class LuckyMoney { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfo base_info; public BaseInfo getBase_info() { return base_info; } public void setBase_info(BaseInfo base_info) { this.base_info = base_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/coupon/manage/model/ScenicTicket.java
src/main/java/org/jeewx/api/coupon/manage/model/ScenicTicket.java
package org.jeewx.api.coupon.manage.model; /** * 门票。 * * @author mcl * @version v1.0 */ public class ScenicTicket { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfo base_info; // 票类型,例如平日全票,套票等 private String ticket_class; // 导览图url。 private String guide_url; public BaseInfo getBase_info() { return base_info; } public void setBase_info(BaseInfo base_info) { this.base_info = base_info; } public String getTicket_class() { return ticket_class; } public void setTicket_class(String ticket_class) { this.ticket_class = ticket_class; } public String getGuide_url() { return guide_url; } public void setGuide_url(String guide_url) { this.guide_url = guide_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/coupon/manage/model/Discount.java
src/main/java/org/jeewx/api/coupon/manage/model/Discount.java
package org.jeewx.api.coupon.manage.model; /** * 折扣券。 * * @author mcl * @version v1.0 */ public class Discount { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfo base_info; // 折扣券专用,表示打折额度(百分比)。填 30 就是七折。 private Float discount; public BaseInfo getBase_info() { return base_info; } public void setBase_info(BaseInfo base_info) { this.base_info = base_info; } public Float getDiscount() { return discount; } public void setDiscount(Float discount) { this.discount = discount; } }
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/coupon/manage/model/MovieTicket.java
src/main/java/org/jeewx/api/coupon/manage/model/MovieTicket.java
package org.jeewx.api.coupon.manage.model; /** * 电影票。 * * @author mcl * @version v1.0 */ public class MovieTicket { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfo base_info; // 电影票详情 private String detail; public BaseInfo getBase_info() { return base_info; } public void setBase_info(BaseInfo base_info) { this.base_info = base_info; } public String getDetail() { return detail; } public void setDetail(String detail) { this.detail = detail; } }
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/coupon/manage/model/MeetingTicket.java
src/main/java/org/jeewx/api/coupon/manage/model/MeetingTicket.java
package org.jeewx.api.coupon.manage.model; /** * 会议门票。 * * @author mcl * @version v1.0 */ public class MeetingTicket { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfo base_info; // 会议详情 private String meeting_detail; // 会场导览图 private String map_url; public BaseInfo getBase_info() { return base_info; } public void setBase_info(BaseInfo base_info) { this.base_info = base_info; } public String getMeeting_detail() { return meeting_detail; } public void setMeeting_detail(String meeting_detail) { this.meeting_detail = meeting_detail; } public String getMap_url() { return map_url; } public void setMap_url(String map_url) { this.map_url = map_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/coupon/manage/model/ScenicTicketUpdate.java
src/main/java/org/jeewx/api/coupon/manage/model/ScenicTicketUpdate.java
package org.jeewx.api.coupon.manage.model; /** * 可以被更新的门票信息。 * * @author mcl * @version v1.0 */ public class ScenicTicketUpdate { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfoUpdate base_info; // 导览图url。 private String guide_url; public BaseInfoUpdate getBase_info() { return base_info; } public void setBase_info(BaseInfoUpdate base_info) { this.base_info = base_info; } public String getGuide_url() { return guide_url; } public void setGuide_url(String guide_url) { this.guide_url = guide_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/coupon/manage/model/MovieTicketUpdate.java
src/main/java/org/jeewx/api/coupon/manage/model/MovieTicketUpdate.java
package org.jeewx.api.coupon.manage.model; /** * 可以被更新的电影票信息。 * * @author mcl * @version v1.0 */ public class MovieTicketUpdate { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfoUpdate base_info; // 电影票详情 private String detail; public BaseInfoUpdate getBase_info() { return base_info; } public void setBase_info(BaseInfoUpdate base_info) { this.base_info = base_info; } public String getDetail() { return detail; } public void setDetail(String detail) { this.detail = detail; } }
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/coupon/manage/model/Sku.java
src/main/java/org/jeewx/api/coupon/manage/model/Sku.java
package org.jeewx.api.coupon.manage.model; /** * 卡券相关的商品信息 * @author mcl * @version v1.0 */ public class Sku { //库存数量。 private Integer quantity; public Integer getQuantity() { return quantity; } public void setQuantity(Integer quantity) { this.quantity = quantity; } }
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/coupon/manage/model/GetCardRtnInfoCard.java
src/main/java/org/jeewx/api/coupon/manage/model/GetCardRtnInfoCard.java
package org.jeewx.api.coupon.manage.model; public class GetCardRtnInfoCard { //卡券ID private String card_id; //起始使用时间 private long begin_time; //结束时间 private long end_time; public String getCard_id() { return card_id; } public void setCard_id(String card_id) { this.card_id = card_id; } public long getBegin_time() { return begin_time; } public void setBegin_time(long begin_time) { this.begin_time = begin_time; } public long getEnd_time() { return end_time; } public void setEnd_time(long end_time) { this.end_time = end_time; } }
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/coupon/manage/model/GetCardDetailRtnInfo.java
src/main/java/org/jeewx/api/coupon/manage/model/GetCardDetailRtnInfo.java
package org.jeewx.api.coupon.manage.model; public class GetCardDetailRtnInfo { // 错误码 private String errcode; // 错误信息 private String errmsg; // 卡券详细信息 private Card card; public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public Card getCard() { return card; } public void setCard(Card card) { this.card = card; } }
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/coupon/manage/model/MeetingTicketUpdate.java
src/main/java/org/jeewx/api/coupon/manage/model/MeetingTicketUpdate.java
package org.jeewx.api.coupon.manage.model; /** * 可以被更新的会议门票信息。 * @author mcl * @version v1.0 */ public class MeetingTicketUpdate { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfoUpdate base_info; // 会场导览图 private String map_url; public BaseInfoUpdate getBase_info() { return base_info; } public void setBase_info(BaseInfoUpdate base_info) { this.base_info = base_info; } public String getMap_url() { return map_url; } public void setMap_url(String map_url) { this.map_url = map_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/coupon/manage/model/MemberCardUpdate.java
src/main/java/org/jeewx/api/coupon/manage/model/MemberCardUpdate.java
package org.jeewx.api.coupon.manage.model; /** * 可以被更新的会员卡信息。 * * @author mcl * @version v1.0 */ public class MemberCardUpdate { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfoUpdate base_info; // 积分清零规则 private String bonus_cleared; // 积分规则 private String bonus_rules; // 储值说明 private String balance_rules; // 特权说明 private String prerogative; public BaseInfoUpdate getBase_info() { return base_info; } public void setBase_info(BaseInfoUpdate base_info) { this.base_info = base_info; } public String getBonus_cleared() { return bonus_cleared; } public void setBonus_cleared(String bonus_cleared) { this.bonus_cleared = bonus_cleared; } public String getBonus_rules() { return bonus_rules; } public void setBonus_rules(String bonus_rules) { this.bonus_rules = bonus_rules; } public String getBalance_rules() { return balance_rules; } public void setBalance_rules(String balance_rules) { this.balance_rules = balance_rules; } public String getPrerogative() { return prerogative; } public void setPrerogative(String prerogative) { this.prerogative = prerogative; } }
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/coupon/manage/model/GeneralCoupon.java
src/main/java/org/jeewx/api/coupon/manage/model/GeneralCoupon.java
package org.jeewx.api.coupon.manage.model; /** * 通用券。 * @author mcl * @version v1.0 */ public class GeneralCoupon { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfo base_info; // 描述文本。 private String default_detail; public BaseInfo getBase_info() { return base_info; } public void setBase_info(BaseInfo base_info) { this.base_info = base_info; } public String getDefault_detail() { return default_detail; } public void setDefault_detail(String default_detail) { this.default_detail = default_detail; } }
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/coupon/manage/model/GetCardRtnInfo.java
src/main/java/org/jeewx/api/coupon/manage/model/GetCardRtnInfo.java
package org.jeewx.api.coupon.manage.model; public class GetCardRtnInfo { // 错误码 private String errcode; // 错误信息 private String errmsg; // 用户openid private String openid; // 卡券相关信息 private GetCardRtnInfoCard card; public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public String getOpenid() { return openid; } public void setOpenid(String openid) { this.openid = openid; } public GetCardRtnInfoCard getCard() { return card; } public void setCard(GetCardRtnInfoCard card) { this.card = card; } }
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/coupon/manage/model/Cash.java
src/main/java/org/jeewx/api/coupon/manage/model/Cash.java
package org.jeewx.api.coupon.manage.model; /** * 代金券。 * * @author mcl * @version v1.0 */ public class Cash { // 基本的卡券数据,见下表,所有卡券通用 private BaseInfo base_info; // 代金券专用,表示起用金额(单位为分)。 private Integer least_cost; // 代金券专用,表示减免金额(单位为分)。 private Integer reduce_cost; public BaseInfo getBase_info() { return base_info; } public void setBase_info(BaseInfo base_info) { this.base_info = base_info; } public Integer getLeast_cost() { return least_cost; } public void setLeast_cost(Integer least_cost) { this.least_cost = least_cost; } public Integer getReduce_cost() { return reduce_cost; } public void setReduce_cost(Integer reduce_cost) { this.reduce_cost = reduce_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/coupon/manage/model/BaseInfoUpdate.java
src/main/java/org/jeewx/api/coupon/manage/model/BaseInfoUpdate.java
package org.jeewx.api.coupon.manage.model; import java.util.List; /** * 可以被更新的卡券基础数据. * @author mcl * @version v1.0 */ public class BaseInfoUpdate { // 卡券的商户logo private String logo_url; // 使用提醒。(一句话描述,展示在首页) private String notice; // 使用说明。长文本描述,可以分行。 private String description; // 客服电话 private String service_phone; // 券颜色。色彩规范标注值对应的色值。如#3373bb private String color; // 门店位置ID。 private List<Integer> location_id_list; // 商户自定义cell 名称,与custom_url 字段共同使用,目前支持类型参考 常量类CardConsts.UrlNameType。 private String url_name_type; // 商户自定义cell 跳转外链的地址链 接,跳转页面内容需与自定义cell 名称保持一致。 private String custom_url; // code 码展示类型 请参考常量类 CardConsts.CodeType private String code_type; // 每人使用次数限制。 private Integer use_limit; // 每人最大领取次数。 private Integer get_limit; // 领取卡券原生页面是否可分享,填写 true 或false,true 代表可分享。默认可分享。 private boolean can_share; // 卡券是否可转赠,填写true 或false,true 代表可转赠。默认可转赠。 private boolean can_give_friend; // 使用日期,有效期的信息。 private DateInfoUpdate date_info; public String getLogo_url() { return logo_url; } public void setLogo_url(String logo_url) { this.logo_url = logo_url; } public String getNotice() { return notice; } public void setNotice(String notice) { this.notice = notice; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getService_phone() { return service_phone; } public void setService_phone(String service_phone) { this.service_phone = service_phone; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } public List<Integer> getLocation_id_list() { return location_id_list; } public void setLocation_id_list(List<Integer> location_id_list) { this.location_id_list = location_id_list; } public String getUrl_name_type() { return url_name_type; } public void setUrl_name_type(String url_name_type) { this.url_name_type = url_name_type; } public String getCustom_url() { return custom_url; } public void setCustom_url(String custom_url) { this.custom_url = custom_url; } public String getCode_type() { return code_type; } public void setCode_type(String code_type) { this.code_type = code_type; } public Integer getUse_limit() { return use_limit; } public void setUse_limit(Integer use_limit) { this.use_limit = use_limit; } public Integer getGet_limit() { return get_limit; } public void setGet_limit(Integer get_limit) { this.get_limit = get_limit; } public boolean isCan_share() { return can_share; } public void setCan_share(boolean can_share) { this.can_share = can_share; } public boolean isCan_give_friend() { return can_give_friend; } public void setCan_give_friend(boolean can_give_friend) { this.can_give_friend = can_give_friend; } public DateInfoUpdate getDate_info() { return date_info; } public void setDate_info(DateInfoUpdate date_info) { this.date_info = date_info; } }
java
Apache-2.0
9a0a503cc99e24c77de671890fae15ee3235669f
2026-01-05T02:41:50.789942Z
false