eta_trial.go 718 B

12345678910111213141516171819202122232425262728
  1. package services
  2. import (
  3. "context"
  4. "eta/eta_forum_task/services/alarm_msg"
  5. "eta/eta_forum_task/services/eta_forum"
  6. "eta/eta_forum_task/utils"
  7. "fmt"
  8. "time"
  9. )
  10. func ETATrialDisabled(cont context.Context) (err error) {
  11. defer func() {
  12. if err != nil {
  13. go alarm_msg.SendAlarmMsg(utils.APP_NAME_CN+"自动禁用ETA试用客户失败"+time.Now().Format("2006-01-02 15:04:05")+"<br/>"+err.Error(), 3)
  14. }
  15. }()
  16. respItem, err := eta_forum.ETATrialDisabled()
  17. if err != nil {
  18. err = fmt.Errorf("自动禁用ETA试用客户失败,Err:" + err.Error())
  19. return
  20. }
  21. if respItem.Ret != 200 {
  22. err = fmt.Errorf("自动禁用ETA试用客户失败,Err:%v,errMsg:%v", respItem.Msg, respItem.ErrMsg)
  23. return
  24. }
  25. return
  26. }