2016-11-29 18:20:06 +00:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
2017-03-15 15:55:30 +00:00
|
|
|
"context"
|
2016-11-29 18:20:06 +00:00
|
|
|
"encoding/json"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
func decodeCreateDistributedQueryCampaignRequest(ctx context.Context, r *http.Request) (interface{}, error) {
|
|
|
|
var req createDistributedQueryCampaignRequest
|
|
|
|
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return req, nil
|
|
|
|
}
|
2018-05-17 22:54:34 +00:00
|
|
|
|
|
|
|
func decodeCreateDistributedQueryCampaignByNamesRequest(ctx context.Context, r *http.Request) (interface{}, error) {
|
|
|
|
var req createDistributedQueryCampaignByNamesRequest
|
|
|
|
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return req, nil
|
|
|
|
}
|