combinemails.go 637 B

12345678910111213141516171819202122232425262728293031
  1. package http
  2. import (
  3. "time"
  4. "go-common/library/log"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. func combineMails(c *bm.Context) {
  8. log.Info("begin combineMails")
  9. v := new(struct {
  10. Date string `form:"date" validate:"required"`
  11. })
  12. if err := c.Bind(v); err != nil {
  13. return
  14. }
  15. t, err := time.Parse("2006-01-02", v.Date)
  16. if err != nil {
  17. log.Error("sendIncome date error!date:%s", v.Date)
  18. return
  19. }
  20. err = svr.CombineMailsByHTTP(c, t.Year(), int(t.Month()), t.Day())
  21. if err != nil {
  22. log.Error("Exec CombineMailsByHTTP error!(%v)", err)
  23. } else {
  24. log.Info("Exec CombineMailsByHTTP succeed!")
  25. }
  26. c.JSON(nil, err)
  27. }