Commit 1736b6f3 authored by jingbo.wang's avatar jingbo.wang

更新注释

parent 74c74d4c
...@@ -3,7 +3,7 @@ package report_form ...@@ -3,7 +3,7 @@ package report_form
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"git.quantgroup.cn/DevOps/enoch/pkg/api-server" api_server "git.quantgroup.cn/DevOps/enoch/pkg/api-server"
"git.quantgroup.cn/DevOps/enoch/pkg/email" "git.quantgroup.cn/DevOps/enoch/pkg/email"
"git.quantgroup.cn/DevOps/enoch/pkg/global" "git.quantgroup.cn/DevOps/enoch/pkg/global"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
...@@ -11,6 +11,16 @@ import ( ...@@ -11,6 +11,16 @@ import (
"io/ioutil" "io/ioutil"
) )
func init() {
//显示报表
api_server.HandlerFunc(api_server.GET, "/show/:long/:y/:m/:d/:name", show)
//发送邮件
//参数格式:["xx1@xx.x", "xx2@xx.x"]
api_server.HandlerFunc(api_server.POST, "/send-email/:long/:y/:m/:d/:name", sendEmail)
}
func show(ctx *fasthttp.RequestCtx) { func show(ctx *fasthttp.RequestCtx) {
long := ctx.UserValue("long").(string) long := ctx.UserValue("long").(string)
y := ctx.UserValue("y").(string) y := ctx.UserValue("y").(string)
...@@ -90,11 +100,3 @@ func sendEmail(ctx *fasthttp.RequestCtx) { ...@@ -90,11 +100,3 @@ func sendEmail(ctx *fasthttp.RequestCtx) {
email.SendEmail(fmt.Sprintf("服务健康状态表:%s_%s_%s", name, date, long), util.BytesString(body), emailList...) email.SendEmail(fmt.Sprintf("服务健康状态表:%s_%s_%s", name, date, long), util.BytesString(body), emailList...)
} }
func init() {
//显示报表
api_server.HandlerFunc(api_server.GET, "/show/:long/:y/:m/:d/:name", show)
//发送邮件:周
api_server.HandlerFunc(api_server.POST, "/send-email/:long/:y/:m/:d/:name", sendEmail)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment