task_status.go 784 B

123456789101112131415161718192021222324252627282930313233343536
  1. package http
  2. import (
  3. "go-common/library/log"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. func updateTaskStatus(c *bm.Context) {
  7. v := new(struct {
  8. Status int `form:"status" validate:"required"`
  9. Date string `form:"date" validate:"required"`
  10. Type int `form:"type"`
  11. })
  12. if err := c.Bind(v); err != nil {
  13. return
  14. }
  15. err := svr.UpdateTaskStatus(c, v.Date, v.Type, v.Status)
  16. if err != nil {
  17. log.Error("svr.UpdateTaskStatus error(%v)", err)
  18. }
  19. c.JSON(nil, err)
  20. }
  21. func checkTaskColumn(c *bm.Context) {
  22. v := new(struct {
  23. Date string `form:"date" validate:"required"`
  24. })
  25. if err := c.Bind(v); err != nil {
  26. return
  27. }
  28. err := chargeSrv.CheckTaskColumn(c, v.Date)
  29. if err != nil {
  30. log.Error("incomeSrv.CheckTaskColumn error(%v)", err)
  31. }
  32. c.JSON(nil, err)
  33. }