Skip to content

单纯的短信服务, 目前仅仅集成了腾讯云短信(人在电信外包, 差点没了)

Notifications You must be signed in to change notification settings

mikuhuyo/sms-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1d1fbf4 · Feb 27, 2023

History

1 Commit
Feb 27, 2023
Feb 27, 2023
Feb 27, 2023
Feb 27, 2023
Feb 27, 2023

Repository files navigation

短信服务使用手册

GitHub license GitHub issues GitHub stars GitHub forks Java version SpringBoot version

修改redis相关配置

将下面redis相关配置修改为你的redis相关配置:

spring:
  cache:
    type: REDIS
  redis:
    host: 127.0.0.1
    password: yueliminvc@outlook.com
    port: 6379
    database: 0
    timeout: 3000ms
    lettuce:
      pool:
        max-idle: 8
        min-idle: 1
        max-active: 8
        max-wait: 30000ms
      shutdown-timeout: 10000ms

修改腾讯云相关配置

application.yml文件中腾讯云配置部分修改为你的配置:

sms:
  defaultExpire: 300
  qcloud:
    # your app id
    appId: 000000
    appKey: 'your_app_key'
    templateId: 'your_sms_template'
    sign: 'your_tencent_cloud_sms_sign'
    # tencent sms api
    url: 'https://yun.tim.qq.com/v5/tlssmssvr/sendsms'

接口请求

http://127.0.0.1:52000/swagger-ui.html

获取验证码 http://127.0.0.1:52000/sms/tencent/generat/{effectiveTime}

参数effectiveTime: 过期时间, 单位秒, 必选项

请求体:

{
  "mobile": "15711111111"
}

返回值:

{
  "code": 0,
  "msg": "success",
  "result": {
    "key": "tencent:sms:?"
  }
}

验证码校验 http://127.0.0.1:52000/sms/tencent/verification/{key}/{code}

参数key: 生成的签名

参数code: 生成的验证码

返回值:

{
  "code": 0,
  "msg": "success",
  "result": true // true表示成功, false表示失败
}

特别鸣谢

关注者

Stargazers repo roster for @mikuhuyo/sms-service

收藏者

Forkers repo roster for @mikuhuyo/sms-service

请这个b喝杯水?

Alipay


WeChatPay

About

单纯的短信服务, 目前仅仅集成了腾讯云短信(人在电信外包, 差点没了)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages