main.go 754 B

1234567891011121314151617181920212223242526272829
  1. package email
  2. import (
  3. "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/global"
  4. "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/router"
  5. "github.com/gin-gonic/gin"
  6. )
  7. type emailPlugin struct {
  8. }
  9. func CreateEmailPlug(To, From, Host, Secret, Nickname string, Port int, IsSSL bool) *emailPlugin {
  10. global.GlobalConfig.To = To
  11. global.GlobalConfig.From = From
  12. global.GlobalConfig.Host = Host
  13. global.GlobalConfig.Secret = Secret
  14. global.GlobalConfig.Nickname = Nickname
  15. global.GlobalConfig.Port = Port
  16. global.GlobalConfig.IsSSL = IsSSL
  17. return &emailPlugin{}
  18. }
  19. func (*emailPlugin) Register(group *gin.RouterGroup) {
  20. router.RouterGroupApp.InitEmailRouter(group)
  21. }
  22. func (*emailPlugin) RouterPath() string {
  23. return "email"
  24. }