cheat.go 587 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 updateCheat(c *bm.Context) {
  8. log.Info("begin updateCheat")
  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("updateCheat date error!date:%s", v.Date)
  18. return
  19. }
  20. err = svr.UpdateCheatHTTP(c, t)
  21. if err != nil {
  22. log.Error("Exec UpdateCheat error!(%v)", err)
  23. } else {
  24. log.Info("Exec UpdateCheat succeed!")
  25. }
  26. c.JSON(nil, err)
  27. }