search.go 798 B

1234567891011121314151617181920212223242526272829
  1. package manager
  2. import (
  3. "context"
  4. "go-common/library/log"
  5. "net/url"
  6. "strconv"
  7. )
  8. // searchUpdate .
  9. func (d *Dao) SearchUpdate(c context.Context, business, data string, aid int64) (err error) {
  10. params := url.Values{}
  11. params.Set("business", business)
  12. params.Set("data", data)
  13. params.Set("aid", strconv.FormatInt(aid, 10))
  14. var res struct {
  15. Code int `json:"code"`
  16. }
  17. if err = d.httpW.Post(c, d.searchUpdateURL, "", params, &res); err != nil {
  18. log.Error("searchUpdate d.httpW.Post(%s) error(%v)", d.searchUpdateURL+"?"+params.Encode(), err)
  19. return
  20. }
  21. if res.Code != 0 {
  22. log.Error("searchUpdate url(%s) code(%d)", d.searchUpdateURL+"?"+params.Encode(), res.Code)
  23. }
  24. log.Info("aid (%d) SearchUpdate url(%s) code(%d)", aid, d.searchUpdateURL+"?"+params.Encode(), res.Code)
  25. return
  26. }