sys_email.go 766 字节
Newer Older
Mr.奇淼('s avatar
Mr.奇淼( 已提交
1
package api
M
maplepie 已提交
2 3

import (
S
songzhibin97 已提交
4 5
	"github.com/flipped-aurora/gin-vue-admin/global"
	"github.com/flipped-aurora/gin-vue-admin/model/common/response"
Mr.奇淼('s avatar
Mr.奇淼( 已提交
6
	"github.com/flipped-aurora/gin-vue-admin/plugin/email/service"
M
maplepie 已提交
7
	"github.com/gin-gonic/gin"
8
	"go.uber.org/zap"
M
maplepie 已提交
9 10
)

Mr.奇淼('s avatar
Mr.奇淼( 已提交
11 12 13
type EmailApi struct {
}

14
// @Tags System
M
maplepie 已提交
15 16 17
// @Summary 发送测试邮件
// @Security ApiKeyAuth
// @Produce  application/json
18
// @Success 200 {string} string "{"success":true,"data":{},"msg":"发送成功"}"
M
maplepie 已提交
19
// @Router /email/emailTest [post]
Mr.奇淼('s avatar
Mr.奇淼( 已提交
20 21
func (s *EmailApi) EmailTest(c *gin.Context) {
	if err := service.ServiceGroupApp.EmailTest(); err != nil {
22 23
		global.GVA_LOG.Error("发送失败!", zap.Any("err", err))
		response.FailWithMessage("发送失败", c)
M
maplepie 已提交
24 25 26 27
	} else {
		response.OkWithData("发送成功", c)
	}
}