附近小店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

search_submit_pages.go 756 B

1 month ago
1234567891011121314151617181920212223242526272829303132333435
  1. package weapp
  2. const (
  3. apiSearchSubmitPages = "/wxa/search/wxaapi_submitpages"
  4. )
  5. // SearchSubmitPages 小程序页面收录请求
  6. type SearchSubmitPages struct {
  7. Pages []SearchSubmitPage `json:"pages"`
  8. }
  9. // SearchSubmitPage 请求收录的页面
  10. type SearchSubmitPage struct {
  11. Path string `json:"path"`
  12. Query string `json:"query"`
  13. }
  14. // Send 提交收录请求
  15. func (s *SearchSubmitPages) Send(token string) (*CommonError, error) {
  16. return s.send(baseURL+apiSearchSubmitPages, token)
  17. }
  18. func (s *SearchSubmitPages) send(api, token string) (*CommonError, error) {
  19. api, err := tokenAPI(api, token)
  20. if err != nil {
  21. return nil, err
  22. }
  23. res := new(CommonError)
  24. if err := postJSON(api, s, res); err != nil {
  25. return nil, err
  26. }
  27. return res, nil
  28. }