english_report.go 822 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package controllers
  2. import (
  3. "hongze/hongze_open_api/services"
  4. "hongze/hongze_open_api/utils"
  5. )
  6. type EnglishReportController struct {
  7. BaseCommon
  8. }
  9. // PublishNotify
  10. // @Title 策略报告发布通知
  11. // @Description 策略报告发布通知
  12. // @router /notify [get]
  13. func (c *EnglishReportController) PublishNotify() {
  14. // 解析出url上的参数值如下:
  15. id, err := c.GetInt("id")
  16. utils.ApiLog.Println("PublishNotify: id = ", id)
  17. if err != nil {
  18. c.FailWithMessageErr("id 格式错误", err.Error())
  19. return
  20. }
  21. if id == 0 {
  22. //go services.PullEnglishPolicyReportAll()
  23. c.FailWithMessage("请输入id")
  24. return
  25. }
  26. if utils.RunMode == "debug" {
  27. go services.PullEnglishPolicyReportSingle(id)
  28. } else {
  29. //暂不上线,走测试环境
  30. services.TestDebugEnglishPolicyReport(id)
  31. }
  32. c.Ok()
  33. return
  34. }