GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - cgb-java-tools/sms.java: java 发送短信,一行代码接入,可任意切换多家短信通道

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
core
core
 
 
framework_springboot
framework_springboot
 
 
service_aliyuncloud
service_aliyuncloud
 
 
service_huaweicloud
service_huaweicloud
 
 
service_sioo
service_sioo
 
 
service_tencentcloud
service_tencentcloud
 
 
service_yuntongxun
service_yuntongxun
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

java 发送短信,一行代码接入,可任意切换多家短信通道

快速使用

1. pom.xml 中

<!-- 短信的核心实现 https://github.com/xnx3/sms.java -->
<dependency> 
	<groupId>cn.zvo.sms</groupId>
	<artifactId>sms-core</artifactId>
	<version>1.0</version>
</dependency>
<!-- 使用 sioo的短信服务通道 -->
<dependency>
	<groupId>cn.zvo.sms</groupId>
	<artifactId>sms-service-sioo</artifactId>
	<version>1.0</version>
</dependency>

2. Java代码

ServiceInterface service = new SiooService("12345", "password"); //创建短信服务通道
Sms sms = new Sms(service); //创建短信发送类,指定使用哪个短信服务通道来实现短信发送
Map<String, String> params = new HashMap<String, String>(); //构造发送短信的参数。这里不同的短信服务通道所传入的params参数是不同的,详细参见具体短信服务通道的使用说明
params.put("content", "你好,我是短信的内容");
sms.send("17000000000", params); //发送短信

这里创建Sms对象时使用的是 SiooService 短信服务通道,你也可以使用别的短信服务通道,如 HuaweicloudService
另外不同的通道在 sms.send(...) 发送短信时传入的map格式的params参数也不同,具体还要看使用的是哪个短信通道

短信服务通道

短信服务通道列表及其详细使用说明,可参考:

  • sioo 短信服务通道
  • 华为云 短信服务通道

About

java 发送短信,一行代码接入,可任意切换多家短信通道

Resources

Readme
License
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.