golang 的 rabbitmq 消费项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sms.go 464 B

2 years ago
123456789101112131415161718192021
  1. package sms
  2. import (
  3. "applet/app/lib/zhimeng"
  4. "applet/app/svc"
  5. "applet/app/utils/logx"
  6. "github.com/gin-gonic/gin"
  7. )
  8. // NewZhimengSMS is 智盟的短信服务
  9. func NewZhimengSMS(c *gin.Context) *zhimeng.SDK {
  10. sms := new(zhimeng.SDK)
  11. key := svc.SysCfgGet(c, "third_zm_sms_key")
  12. secret := svc.SysCfgGet(c, "third_zm_sms_secret")
  13. if key == "" || secret == "" {
  14. _ = logx.Warn("短信服务配置错误")
  15. }
  16. sms.Init("send_msg", key, secret)
  17. return sms
  18. }