{"id":13810176,"url":"https://github.com/dromara/SMS4J","last_synced_at":"2025-05-14T10:32:32.768Z","repository":{"id":153900921,"uuid":"618237073","full_name":"dromara/SMS4J","owner":"dromara","description":"让简单的事情回归简单的本质。 SMS4J为短信聚合框架，帮您轻松集成多家短信服务，解决接入多个短信SDK的繁琐流程。 目前已接入数家常见的短信服务商，后续将会继续集成。后续的版本中我们还将推出更多的相关功能 你的 ⭐️ ⭐️⭐️Star⭐️⭐️ ⭐️，是我的动力！如果你觉得还不错，请点上一颗小星星","archived":false,"fork":false,"pushed_at":"2025-05-10T05:39:14.000Z","size":6513,"stargazers_count":1085,"open_issues_count":15,"forks_count":137,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-10T06:26:17.285Z","etag":null,"topics":["java","sms","solon","springboot"],"latest_commit_sha":null,"homepage":"https://sms4j.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dromara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-24T03:06:15.000Z","updated_at":"2025-05-10T05:39:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1737991-ab66-4a3e-9df9-0291146add8f","html_url":"https://github.com/dromara/SMS4J","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dromara%2FSMS4J","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dromara%2FSMS4J/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dromara%2FSMS4J/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dromara%2FSMS4J/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dromara","download_url":"https://codeload.github.com/dromara/SMS4J/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254120922,"owners_count":22018067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["java","sms","solon","springboot"],"created_at":"2024-08-04T02:00:47.381Z","updated_at":"2025-05-14T10:32:27.754Z","avatar_url":"https://github.com/dromara.png","language":"Java","readme":"\u003ch1 align=\"center\" style=\"margin: 30px 0 30px; font-weight: bold;\"\u003esms4j v3.3.3\u003c/h1\u003e\n\u003ch4 align=\"center\" style=\"margin: 30px 0 30px; font-weight: bold;\"\u003esms4j -- 让发送短信变的更简单\u003c/h4\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://gitee.com/dromara/sms4j/stargazers\"\u003e\u003cimg src=\"https://gitee.com/dromara/sms4j/badge/star.svg?theme=gvp\"\u003e\u003c/a\u003e\n\u003ca href=\"https://gitee.com/dromara/sms4j/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-Apache--2.0-green\"\u003e\u003c/a\u003e\n\u003ca href=\"https://gitee.com/dromara/sms4j\"\u003e\u003cimg src=\"https://img.shields.io/badge/version-v3.3.3-blue\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cimg src=\"/public/logo.png\"\u003e\n\n## 前言\n\n在日常的开发过程中，短信的发送经常使用（尤其是中小型的外包公司），毕竟不是每个公司都有阿里腾讯一样的实力，\n也不是每个都像银行联通等公司一样有内部的短信规程。第三方的短信往往是最常见的解决方案，但是市面上第三方短信服务商众多，\n各家都有不同的方式和标准，每次需要使用时候，都需要花费时间去阅读文档和编写相应的工具，为一个短信浪费了太多的精力和时间。\n这个工具的目的就是为了统一下各个厂商的短信发送工具的标准，甚至于更换短信厂商只需要更改yml配置文件即可。  \n如果我们的项目对你产生了帮助，或者你觉得还算值得鼓励，请用你发财的小手帮助点上一个start  \n[gitee](https://gitee.com/dromara/sms4j)\n[github](https://github.com/dromara/sms4j)\n[gitcode](https://gitcode.com/dromara/SMS4J)\n\n#### [官方文档](https://sms4j.com)\n#### [JavaDoc文档](https://apidoc.gitee.com/dromara/sms4j/)\n\n## 支持厂商一览\n- **[亿美软通国内短信](https://www.emay.cn/article949.html)**\n- **[阿里云国内短信](https://www.aliyun.com/product/sms)**\n- **[腾讯云国内短信](https://cloud.tencent.com/product/sms)**\n- **[华为云国内短信](https://www.huaweicloud.com/product/msgsms.html)**\n- **[京东云国内短信](https://www.jdcloud.com/cn/products/text-message)**\n- **[容联云国内短信（原云通讯）](https://www.yuntongxun.com/sms/note-inform)**\n- **[网易云信短信](https://netease.im/sms)**\n- **[天翼云短信](https://www.ctyun.cn/products/10020341)**\n- **[七牛云短信](https://www.qiniu.com/products/sms)**\n- **[合一短信](https://unisms.apistd.com/)**\n- **[云片短信](https://www.yunpian.com/product/domestic-sms)**\n- **[助通短信](https://www.ztinfo.cn/products/sms)**\n- **[联麓短信](https://console.shlianlu.com/#/document/smsDoc)**\n- **[鼎众短信](http://demoapi.321sms.com:8201/index.html)**\n\n## 在SpringBoot环境集成\n\n1. maven引入\n   \n   ```xml\n   \u003cdependency\u003e\n    \u003cgroupId\u003eorg.dromara.sms4j\u003c/groupId\u003e\n    \u003cartifactId\u003esms4j-spring-boot-starter\u003c/artifactId\u003e\n    \u003cversion\u003e最新版本\u003c/version\u003e\n   \u003c/dependency\u003e\n   ```\n2. 设置配置文件\n   \n   ```yaml\n   sms:\n      config-type: yaml\n      blends:\n          自定义标识1:\n            #阿里云的accessKey\n            accessKeyId: 您的accessKey\n            #阿里云的accessKeySecret\n            accessKeySecret: 您的accessKeySecret\n            #短信签名\n            signature: 测试签名\n            #模板ID 用于发送固定模板短信使用\n            templateId: SMS_215125134\n            #模板变量 上述模板的变量\n            templateName: code\n            #请求地址 默认为dysmsapi.aliyuncs.com 如无特殊改变可以不用设置\n            requestUrl: dysmsapi.aliyuncs.com\n          自定义标识2:\n            #华为短信appKey\n            appKey: 5N6fvXXXX920HaWhVXXXXXX7fYa\n            #华为短信appSecret\n            app-secret: Wujt7EYzZTBXXXXXXEhSP6XXXX\n            #短信签名\n            signature: 华为短信测试\n             #通道号\n            sender: 8823040504797\n            #模板ID 如果使用自定义模板发送方法可不设定\n            template-id: acXXXXXXXXc274b2a8263479b954c1ab5\n            #华为回调地址，如不需要可不设置或为空\n            statusCallBack:\n            #华为分配的app请求地址\n            url: https://XXXXX.cn-north-4.XXXXXXXX.com:443\n          自定义标识3:\n            #助通短信\n            #助通终端用户管理的用户名 username 必填；非登录账号密码，请登录后台管理地址进行查看：https://mix2.zthysms.com/login\n            accessKeyId: tusxxxxxxXXX\n            #助通终端用户管理的用户名 passwrod 必填；\n            accessKeySecret: UbXXXxxx\n            #短信签名，可选；可选的时候，只能使用自定义短信不能使用模板短信； 具体在这里查看审核过的短信签名：https://mix2.zthysms.com/index.html#/SignatureManagement\n            signature: 上海千XXXX\n   ```\n\n3. 方法使用\n   \n```java\n@RestController\n@RequestMapping(\"/test/\")\npublic class DemoController {\n\n    // 测试发送固定模板短信\n    @RequestMapping(\"/\")\n    public void send() {\n         //阿里云向此手机号发送短信\n        SmsFactory.getSmsBlend(\"自定义标识1\").sendMessage(\"18888888888\",\"123456\");\n        //华为短信向此手机号发送短信\n        SmsFactory.getSmsBlend(\"自定义标识2\").sendMessage(\"16666666666\",\"000000\");\n    }\n}\n```\n\n\n## 配置详解\n\n#### 线程池配置\n\n每一家厂商都对于异步短信有不同的支持，有些甚至没有，为了统一存在一个异步短信，我们配置了一个线程池用于执行异步短信任务，线程池默认配置如下：  \n\n```yaml\nsms:\n  #核心线程池大小\n  corePoolSize: 10\n  #最大线程数\n  maxPoolSize: 30\n  #队列容量\n  queueCapacity: 50\n  #活跃时间\n  keepAliveSeconds: 60\n  # 线程名字前缀\n  threadNamePrefix: sms-executor-\n  #设置线程池关闭的时候等待所有任务都完成再继续销毁其他的Bean\n  shutdownStrategy: true\n```\n\n以上线程池为默认的配置，如果有需要可以跟随自己的需求在yml文件进行配置\n\n\n## 参与贡献\n```\n1.  Fork 本仓库\n2.  新建 Feat_xxx 分支\n3.  提交代码\n4.  新建 Pull Request 到 dev-3.0.x 分支\n```\n## 贡献原则\n- 我们原则上欢迎任何人为sms4j添加加瓦贡献代码\n- 贡献代码应注释完备，按照javaDoc标准对 类，方法，变量，参数，返回值等信息说明\n- 新增的方法模块不能破坏原有结构和兼容性\n- 如果我们关闭了你的issues或者pr请查看回复内容，我们会在回复中做出解释\n\n### 分支介绍\n1. master 正式版分支，最终发布到maven中央仓库的版本\n2. dev 开发分支，贡献的代码将合并到这里，无误后合并至preview\n","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdromara%2FSMS4J","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdromara%2FSMS4J","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdromara%2FSMS4J/lists"}