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.

27 lines
787 B

  1. package api
  2. import (
  3. "github.com/flipped-aurora/gin-vue-admin/server/global"
  4. "github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
  5. "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/service"
  6. "github.com/gin-gonic/gin"
  7. "go.uber.org/zap"
  8. )
  9. type EmailApi struct {
  10. }
  11. // @Tags System
  12. // @Summary 发送测试邮件
  13. // @Security ApiKeyAuth
  14. // @Produce application/json
  15. // @Success 200 {string} string "{"success":true,"data":{},"msg":"发送成功"}"
  16. // @Router /email/emailTest [post]
  17. func (s *EmailApi) EmailTest(c *gin.Context) {
  18. if err := service.ServiceGroupApp.EmailTest(); err != nil {
  19. global.GVA_LOG.Error("发送失败!", zap.Any("err", err))
  20. response.FailWithMessage("发送失败", c)
  21. } else {
  22. response.OkWithData("发送成功", c)
  23. }
  24. }