email提为插件模式
This commit is contained in:
7
server/plugin/email/api/enter.go
Normal file
7
server/plugin/email/api/enter.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package api
|
||||
|
||||
type ApiGroup struct {
|
||||
EmailApi
|
||||
}
|
||||
|
||||
var ApiGroupApp = new(ApiGroup)
|
27
server/plugin/email/api/sys_email.go
Normal file
27
server/plugin/email/api/sys_email.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/global"
|
||||
"github.com/flipped-aurora/gin-vue-admin/model/common/response"
|
||||
"github.com/flipped-aurora/gin-vue-admin/plugin/email/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type EmailApi struct {
|
||||
}
|
||||
|
||||
// @Tags System
|
||||
// @Summary 发送测试邮件
|
||||
// @Security ApiKeyAuth
|
||||
// @Produce application/json
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"发送成功"}"
|
||||
// @Router /email/emailTest [post]
|
||||
func (s *EmailApi) EmailTest(c *gin.Context) {
|
||||
if err := service.ServiceGroupApp.EmailTest(); err != nil {
|
||||
global.GVA_LOG.Error("发送失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("发送失败", c)
|
||||
} else {
|
||||
response.OkWithData("发送成功", c)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user