component.go 599 B

1234567891011121314151617181920
  1. package component
  2. import (
  3. "eta/eta_mini_ht_api/common/component/config"
  4. _ "eta/eta_mini_ht_api/common/component/database"
  5. logger "eta/eta_mini_ht_api/common/component/log"
  6. _ "eta/eta_mini_ht_api/common/component/sms"
  7. "eta/eta_mini_ht_api/common/contants"
  8. "eta/eta_mini_ht_api/common/utils/sms"
  9. )
  10. func init() {
  11. //配置SMS平台,没有配置直接报错
  12. if smsConf, ok := config.GetConfig(contants.SMS).(*config.SMSConfig); ok && smsConf != nil {
  13. logger.Info("开始加载短信平台客户端")
  14. sms.InitSmsSender(smsConf)
  15. } else {
  16. panic("加载短信平台客户端失败")
  17. }
  18. }