Commit 94736eb3 authored by jingbo.wang's avatar jingbo.wang

发送邮件

parent ce60e1fe
...@@ -69,8 +69,9 @@ func RegularMail(dir string) { ...@@ -69,8 +69,9 @@ func RegularMail(dir string) {
} }
func callSendEmailApi(long string, t time.Time, name string, emailList []string) { func callSendEmailApi(long string, t time.Time, name string, emailList []string) {
url := fmt.Sprintf("http://127.0.0.1:%d/send-email/%s/%02d/%02d/%02d/%s", t = t.Add(time.Hour * -24)
global.HttpPort, long, t.Year(), t.Month(), t.Day(), name) url := fmt.Sprintf("http://%s:%d/send-email/%s/%02d/%02d/%02d/%s",
global.LocalIp, global.HttpPort, long, t.Year(), t.Month(), t.Day(), name)
body, err := json.Marshal(emailList) body, err := json.Marshal(emailList)
if err != nil { if err != nil {
glog.Error("can not marshal json", receiverList) glog.Error("can not marshal json", receiverList)
......
...@@ -8,11 +8,11 @@ import ( ...@@ -8,11 +8,11 @@ import (
func TestRun(t *testing.T) { func TestRun(t *testing.T) {
sm := NewServiceMap(time.Now().AddDate(0, 0, -10), time.Now()) sm := NewServiceMap(time.Now().AddDate(0, 0, -10), time.Now())
smForm := sm.ReportForm() smForm := sm.ReportForm("day")
fmt.Println(smForm) fmt.Println(smForm)
for _, s := range sm.GetServiceMap() { for _, s := range sm.GetServiceMap() {
fmt.Println(s.ReportForm()) fmt.Println(s.ReportForm("day"))
fmt.Printf("-------------------------------\n\n\n\n") fmt.Printf("-------------------------------\n\n\n\n")
} }
} }
......
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