{"id":24624951,"url":"https://github.com/heyuxian/weixin-sdk","last_synced_at":"2026-03-02T20:35:20.158Z","repository":{"id":217716334,"uuid":"115793441","full_name":"heyuxian/weixin-sdk","owner":"heyuxian","description":null,"archived":false,"fork":false,"pushed_at":"2018-01-16T13:24:14.000Z","size":118,"stargazers_count":20,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-10T01:06:02.701Z","etag":null,"topics":["spring-boot-starter","springboot","wechat","weixin"],"latest_commit_sha":null,"homepage":"https://www.docs4dev.com/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heyuxian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-12-30T11:47:20.000Z","updated_at":"2023-08-30T03:28:59.000Z","dependencies_parsed_at":"2024-01-18T01:57:41.134Z","dependency_job_id":"aa2a81e7-c064-4cd2-81e4-3c6688452c66","html_url":"https://github.com/heyuxian/weixin-sdk","commit_stats":null,"previous_names":["heyuxian/weixin-sdk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/heyuxian/weixin-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyuxian%2Fweixin-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyuxian%2Fweixin-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyuxian%2Fweixin-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyuxian%2Fweixin-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heyuxian","download_url":"https://codeload.github.com/heyuxian/weixin-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heyuxian%2Fweixin-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30018583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T17:00:27.440Z","status":"ssl_error","status_checked_at":"2026-03-02T17:00:03.402Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["spring-boot-starter","springboot","wechat","weixin"],"created_at":"2025-01-25T04:12:16.493Z","updated_at":"2026-03-02T20:35:20.102Z","avatar_url":"https://github.com/heyuxian.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 微信 SDK\n[![Build Status](https://www.travis-ci.org/heyuxian/weixin-sdk.svg?branch=master)](https://www.travis-ci.org/heyuxian/weixin-sdk)\n[![Coverage Status](https://coveralls.io/repos/github/heyuxian/weixin-sdk/badge.svg?branch=master)](https://coveralls.io/github/heyuxian/weixin-sdk?branch=master)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## 项目简介\n\n本项目使用 spring-boot-starter 的形式封装了微信公众平台的常用 API，延续了 spring-boot 的风格，以最少化配置项为目标，除了 appid, secret 等基础配置项之外，你不需要做任何其他设置，系统提供的默认设置已经能覆盖大部分的使用情况；当然，总还是会有些特殊需求不能被覆盖到，所以系统也对外提供了接口，用户可以实现对应模块的接口来覆盖系统的默认设置。\n\n## 配置\n\n**前提**\n\n- 本项目基于 Spring Boot，所以要使用本项目，必须引入 Spring Boot 的相关依赖\n- JDK 1.8 及以上\n\n**引入 maven 依赖**\n\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003eme.javaroad.openapi.wechat\u003c/groupId\u003e\n\t\u003cartifactId\u003ewechat-spring-boot-starter\u003c/artifactId\u003e\n\t\u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n因为目前是 snapshot 版本，所以还需要引入 snapshot repository :\n\n```xml\n\u003crepositories\u003e\n  \u003crepository\u003e\n      \u003csnapshots /\u003e\n      \u003cid\u003esonatype snapshots\u003c/id\u003e\n      \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots/\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\n**基础配置**\n\n在 application.yml 中新增以下配置：\n\n```yaml\nweixin:\n  mp:\n    endpoint:\n      # 微信回调地址，默认为 /weixin/callback，如需自定义，请修改以下配置项\n      callback-url: /weixin/callback\n    security:\n      # 微信后台配置的 token\n      token: 1234567890\n      # 微信后台配置的消息加解密 aeskey\n      encodingAesKey: abcdefghijklmnopqrstuvwxyz0123456789ABCDEFG\n      # #############################################################\n      # 微信 access token 过期刷新阈值，计算方法：\n      # 当前时间 - (获得token时间 + token 有效期 + 阈值) \u003c 0 则刷新 token\n      # 默认为 token 失效前 5 分钟刷新\n      # #############################################################\n      refresh-token-threshold: 300\n    auth:\n      # APPID\n      appid: appid\n      # APP secret\n      secret: secret\n```\n\n完成以上两项配置后，已经可以成功接入微信。接下来，你可以根据自身需求阅读对应模块的[文档](https://github.com/heyuxian/weixin-sdk/wiki)，实现自己的业务逻辑。\n\n## [目录](https://github.com/heyuxian/weixin-sdk/wiki)\n\n- [获取 AccessToken](https://github.com/heyuxian/weixin-sdk/wiki/%E8%8E%B7%E5%8F%96-AccessToken)\n- [消息管理](https://github.com/heyuxian/weixin-sdk/wiki/%E6%B6%88%E6%81%AF%E7%AE%A1%E7%90%86)\n  - 接收普通消息\n  - 接收事件推送\n  - 被动回复消息\n  - 消息加解密\n  - 获取微信服务器 IP\n  - 客服消息\n  - 群发接口和原创校验\n  - 模板消息接口\n  - 一次性订阅消息\n- 素材管理\n- 图文消息留言管理\n- 用户管理\n- 账号管理\n- 数据统计\n- 微信卡卷\n- ... TODO\n\n\n## 问题及建议\n\n若是对于本项目有任何问题或建议,请提 [Issue](https://github.com/heyuxian/weixin-sdk/issues/new) 。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyuxian%2Fweixin-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheyuxian%2Fweixin-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheyuxian%2Fweixin-sdk/lists"}