workflow.go 910 B

123456789101112131415161718192021222324252627282930313233343536
  1. package dao
  2. import (
  3. "context"
  4. "go-common/library/ecode"
  5. "net/url"
  6. "strconv"
  7. "go-common/library/log"
  8. )
  9. const (
  10. _workflowDel = "http://api.bilibili.co/x/internal/workflow/appeal/v3/delete"
  11. )
  12. // FilterContent get filtered contents by ids.
  13. func (d *Dao) DelReport(c context.Context, oid int64, rpid int64) (err error) {
  14. var res struct {
  15. Code int `json:"code"`
  16. }
  17. params := url.Values{}
  18. params.Set("business", "13")
  19. params.Set("oid", strconv.FormatInt(oid, 10))
  20. params.Set("eid", strconv.FormatInt(rpid, 10))
  21. if err = d.httpClient.Post(c, _workflowDel, "", params, &res); err != nil {
  22. log.Error("DelReport(%s,%s) error(%v)", _workflowDel, params.Encode(), err)
  23. return
  24. }
  25. if res.Code != 0 {
  26. log.Error("DelReport(%s,%s) error(%v)", _workflowDel, params.Encode(), err)
  27. err = ecode.Int(res.Code)
  28. return
  29. }
  30. log.Info("DelReport success!(%s,%s,%d)", _workflowDel, params.Encode())
  31. return
  32. }