- update json

master
李光春 1 year ago
parent f21a47699e
commit 18b5a81d3f

@ -1,5 +1,5 @@
package go_library
func Version() string {
return "1.0.102"
return "1.0.103"
}

@ -2,7 +2,7 @@ package alipayopen
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -48,9 +48,9 @@ func (c *Client) AlipaySystemOauthToken(ctx context.Context, grantType, code, re
}
// 定义
var response AlipaySystemOauthTokenResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
// 错误
var apiError ApiError
err = json.Unmarshal(request.ResponseBody, &apiError)
err = gojson.Unmarshal(request.ResponseBody, &apiError)
return newAlipaySystemOauthTokenResult(response, request.ResponseBody, request, apiError), err
}

@ -2,7 +2,7 @@ package alipayopen
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -42,9 +42,9 @@ func (c *Client) AlipayUserInfoShare(ctx context.Context, authToken string) (*Al
}
// 定义
var response AlipayUserInfoShareResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
// 错误
var apiError ApiError
err = json.Unmarshal(request.ResponseBody, &apiError)
err = gojson.Unmarshal(request.ResponseBody, &apiError)
return newAlipayUserInfoShareResult(response, request.ResponseBody, request, apiError), err
}

@ -5,8 +5,8 @@ import (
"crypto"
"crypto/rand"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"log"
"sort"
@ -70,7 +70,7 @@ func (c *Client) getString(i interface{}) string {
case bool:
return strconv.FormatBool(v)
default:
bytes, _ := json.Marshal(v)
bytes, _ := gojson.Marshal(v)
return string(bytes)
}
}

@ -1,7 +1,7 @@
package baidu
import (
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -28,6 +28,6 @@ func (c *Client) Express() *ExpressResult {
request, err := c.request("https://m.baidu.com/s?word=快递查询&ts={$ts}&t_kt=0&ie=utf-8&rsv_iqid=&rsv_t=&sa=&rsv_pq=&rsv_sug4=&tj=1&inputT={$input}&sugid=&ss=", params, http.MethodPost)
// 定义
var response ExpressResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newExpressResult(response, request.ResponseBody, request, err)
}

@ -1,7 +1,7 @@
package cloudflare
import (
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -28,6 +28,6 @@ func (c *Client) IpsV4() *IpsV4Result {
request, err := c.request(apiUrl+"/ips-v4", params, http.MethodPost)
// 定义
var response IpsV4Response
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newIpsV4Result(response, request.ResponseBody, request, err)
}

@ -1,7 +1,7 @@
package cloudflare
import (
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -28,6 +28,6 @@ func (c *Client) IpsV6() *IpsV6Result {
request, err := c.request(apiUrl+"/ips-v6", params, http.MethodPost)
// 定义
var response IpsV6Response
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newIpsV6Result(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package dingdanxia
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -47,6 +47,6 @@ func (c *Client) JdJyOrderDetails(ctx context.Context, notMustParams ...goreques
request, err := c.request(ctx, apiUrl+"/jd/jy_order_details", params, http.MethodPost)
// 定义
var response JdJyOrderDetailsResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newJdJyOrderDetailsResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package dingdanxia
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -16,6 +16,6 @@ func (c *Client) JdOrderDetails2(ctx context.Context, notMustParams ...gorequest
request, err := c.request(ctx, apiUrl+"/jd/order_details2", params, http.MethodPost)
// 定义
var response JdJyOrderDetailsResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newJdJyOrderDetailsResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package dingdanxia
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -45,6 +45,6 @@ func (c *Client) TbkActivityinfo(ctx context.Context, notMustParams ...gorequest
request, err := c.request(ctx, apiUrl+"/tbk/activityinfo", params, http.MethodPost)
// 定义
var response TbkActivityinfoResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newTbkActivityinfoResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package dingdanxia
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -34,6 +34,6 @@ func (c *Client) WaiMaiMeituanGenerateLink(ctx context.Context, notMustParams ..
request, err := c.request(ctx, apiUrl+"/waimai/meituan_generateLink", params, http.MethodPost)
// 定义
var response WaiMaiMeituanGenerateLinkResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newWaiMaiMeituanGenerateLinkResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package dingdanxia
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -71,6 +71,6 @@ func (c *Client) WaiMaiMeituanOrderId(ctx context.Context, orderId string, Type
request, err := c.request(ctx, apiUrl+"/waimai/meituan_orderid", params, http.MethodPost)
// 定义
var response WaiMaiMeituanOrderIdResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newWaiMaiMeituanOrderIdResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package dingdanxia
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -48,6 +48,6 @@ func (c *Client) WaiMaiMeituanOrders(ctx context.Context, notMustParams ...goreq
request, err := c.request(ctx, apiUrl+"/waimai/meituan_orders", params, http.MethodPost)
// 定义
var response WaiMaiMeituanOrdersResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newWaiMaiMeituanOrdersResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package dingdanxia
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -50,6 +50,6 @@ func (c *Client) WaiMaiMeituanPrivilege(ctx context.Context, sid string, generat
request, err := c.request(ctx, apiUrl+"/waimai/meituan_privilege", params, http.MethodPost)
// 定义
var response WaiMaiMeituanPrivilegeResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newWaiMaiMeituanPrivilegeResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package dingdanxia
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -48,6 +48,6 @@ func (c *Client) WaiMaiMeituanSgPrivilege(ctx context.Context, sid string, gener
request, err := c.request(ctx, apiUrl+"/waimai/meituan_sg_privilege", params, http.MethodPost)
// 定义
var response WaiMaiMeituanSgPrivilegeResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newWaiMaiMeituanSgPrivilegeResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package dingdanxia
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -47,6 +47,6 @@ func (c *Client) WaiMaiMeituanYouxuanGoods(ctx context.Context, notMustParams ..
request, err := c.request(ctx, apiUrl+"/waimai/meituan_youxuan_goods", params, http.MethodPost)
// 定义
var response WaiMaiMeituanYouxuanGoodsResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newWaiMaiMeituanYouxuanGoodsResult(response, request.ResponseBody, request, err)
}

@ -2,8 +2,8 @@ package dingtalk
import (
"context"
"encoding/json"
"fmt"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
"time"
@ -36,6 +36,6 @@ func (c *Client) RobotSend(ctx context.Context, notMustParams ...gorequest.Param
request, err := c.request(ctx, apiUrl+fmt.Sprintf("/robot/send?access_token=%s&timestamp=%d&sign=%s", c.GetAccessToken(), timestamp, c.sign(timestamp)), params, http.MethodPost)
// 定义
var response RobotSendResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newRobotSendResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package eastiot
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -44,6 +44,6 @@ func (c *Client) IotApiQueryOrderedPkgInfo(ctx context.Context, simId string) *I
request, err := c.request(ctx, apiUrl+"/Api/IotApi/queryOrderedPkgInfo", params, http.MethodPost)
// 定义
var response IotApiQueryOrderedPkgInfoResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newIotApiQueryOrderedPkgInfoResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package eastiot
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -51,6 +51,6 @@ func (c *Client) IotApiQuerySimPkgInfo(ctx context.Context, simId string, sd int
request, err := c.request(ctx, apiUrl+"/Api/IotApi/querySimPkgInfo", params, http.MethodPost)
// 定义
var response IotApiQuerySimPkgInfoResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newIotApiQuerySimPkgInfoResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package eastiot
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -45,6 +45,6 @@ func (c *Client) IotApiQueryUserPkgInfo(ctx context.Context) *IotApiQueryUserPkg
request, err := c.request(ctx, apiUrl+"/Api/IotApi/queryUserPkgInfo", map[string]interface{}{}, http.MethodPost)
// 定义
var response IotApiQueryUserPkgInfoResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newIotApiQueryUserPkgInfoResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package eastiot
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -32,6 +32,6 @@ func (c *Client) IotApiRechargeSim(ctx context.Context, notMustParams ...goreque
request, err := c.request(ctx, apiUrl+"/Api/IotApi/rechargeSim", params, http.MethodPost)
// 定义
var response IotApiRechargeSimResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newIotApiRechargeSimResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package eastiot
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -35,6 +35,6 @@ func (c *Client) IotApiGetAllSimType(ctx context.Context) *IotApiGetAllSimTypeRe
request, err := c.request(ctx, apiUrl+"/Api/IotApi/getAllSimType", map[string]interface{}{}, http.MethodPost)
// 定义
var response IotApiGetAllSimTypeResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newIotApiGetAllSimTypeResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package eastiot
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -33,6 +33,6 @@ func (c *Client) IotApiQueryUserBalance(ctx context.Context) *IotApiQueryUserBal
request, err := c.request(ctx, apiUrl+"/Api/IotApi/queryUserBalance", map[string]interface{}{}, http.MethodPost)
// 定义
var response IotApiQueryUserBalanceResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newIotApiQueryUserBalanceResult(response, request.ResponseBody, request, err)
}

@ -1,8 +1,8 @@
package eastiot
import (
"encoding/json"
"fmt"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gomd5"
"sort"
"strconv"
@ -31,7 +31,7 @@ func (c *Client) getString(i interface{}) string {
case bool:
return strconv.FormatBool(v)
default:
bytes, _ := json.Marshal(v)
bytes, _ := gojson.Marshal(v)
return string(bytes)
}
}

@ -2,8 +2,8 @@ package feishu
import (
"context"
"encoding/json"
"fmt"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -34,6 +34,6 @@ func (c *Client) WebhookSend(ctx context.Context, notMustParams ...gorequest.Par
request, err := c.request(ctx, apiUrl+fmt.Sprintf("/open-apis/bot/v2/hook/%s", c.GetKey()), params)
// 定义
var response WebhookSendResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newWebhookSendResult(response, request.ResponseBody, request, err)
}

@ -2,9 +2,9 @@ package gddata
import (
"context"
"encoding/json"
"fmt"
"github.com/baidubce/bce-sdk-go/http"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -37,6 +37,6 @@ func (c *Client) GdpIndex(ctx context.Context, year string) *GdpIndexResult {
request, err := c.request(ctx, apiUrl+fmt.Sprintf("MjkwMDBfMDM2MDAwMTc=?token=%s", c.GetToken()), params, http.GET)
// 定义
var response GdpIndexResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newGdpIndexResult(response, request.ResponseBody, request, err)
}

@ -1,8 +1,8 @@
package gitee
import (
"encoding/json"
"fmt"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
"time"
@ -59,6 +59,6 @@ func (c *Client) ApiV5User(accessToken string) *ApiV5UserResult {
request, err := c.request(apiUrl+fmt.Sprintf("/api/v5/user?access_token=%s", accessToken), params, http.MethodGet)
// 定义
var response ApiV5UserResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiV5UserResult(response, request.ResponseBody, request, err)
}

@ -1,8 +1,8 @@
package gitee
import (
"encoding/json"
"fmt"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -31,6 +31,6 @@ func (c *Client) OauthToken(code string) *OauthTokenResult {
request, err := c.request(apiUrl+fmt.Sprintf("/oauth/token?grant_type=authorization_code&code=%s&client_id=%s&redirect_uri=%s&client_secret=%s", code, c.config.ClientID, c.config.RedirectUri, c.config.ClientSecret), params, http.MethodPost)
// 定义
var response OauthTokenResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newOauthTokenResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package jd
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -70,7 +70,7 @@ func (c *Client) UnionOpenActivityQuery(ctx context.Context, notMustParams ...Pa
// 定义
var responce UnionOpenActivityQueryResultResponse
var result UnionOpenActivityQueryQueryResult
err = json.Unmarshal(request.ResponseBody, &responce)
err = json.Unmarshal([]byte(responce.JdUnionOpenActivityQueryResponce.QueryResult), &result)
err = gojson.Unmarshal(request.ResponseBody, &responce)
err = gojson.Unmarshal([]byte(responce.JdUnionOpenActivityQueryResponce.QueryResult), &result)
return newUnionOpenActivityQueryResult(responce, result, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package jd
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -47,7 +47,7 @@ func (c *Client) UnionOpenCategoryGoodsGet(ctx context.Context, notMustParams ..
// 定义
var responce UnionOpenCategoryGoodsGetResultResponse
var result UnionOpenCategoryGoodsGetQueryResult
err = json.Unmarshal(request.ResponseBody, &responce)
err = json.Unmarshal([]byte(responce.JdUnionOpenCategoryGoodsGetResponce.GetResult), &result)
err = gojson.Unmarshal(request.ResponseBody, &responce)
err = gojson.Unmarshal([]byte(responce.JdUnionOpenCategoryGoodsGetResponce.GetResult), &result)
return newUnionOpenCategoryGoodsGetResult(responce, result, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package jd
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -67,7 +67,7 @@ func (c *Client) UnionOpenGoodsBigfieldQuery(ctx context.Context, notMustParams
// 定义
var responce UnionOpenGoodsBigfieldQueryResultResponse
var result UnionOpenGoodsBigfieldQueryQueryResult
err = json.Unmarshal(request.ResponseBody, &responce)
err = json.Unmarshal([]byte(responce.JdUnionOpenGoodsBigfieldQueryResponce.QueryResult), &result)
err = gojson.Unmarshal(request.ResponseBody, &responce)
err = gojson.Unmarshal([]byte(responce.JdUnionOpenGoodsBigfieldQueryResponce.QueryResult), &result)
return newUnionOpenGoodsBigfieldQueryResult(responce, result, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package jd
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -131,7 +131,7 @@ func (c *Client) UnionOpenGoodsJIngFenQuery(ctx context.Context, notMustParams .
// 定义
var responce UnionOpenGoodsJIngFenQueryResultResponse
var result UnionOpenGoodsJIngFenQueryQueryResult
err = json.Unmarshal(request.ResponseBody, &responce)
err = json.Unmarshal([]byte(responce.JdUnionOpenGoodsJingfenQueryResponce.QueryResult), &result)
err = gojson.Unmarshal(request.ResponseBody, &responce)
err = gojson.Unmarshal([]byte(responce.JdUnionOpenGoodsJingfenQueryResponce.QueryResult), &result)
return newUnionOpenGoodsJIngFenQueryResult(responce, result, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package jd
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -128,7 +128,7 @@ func (c *Client) UnionOpenGoodsMaterialQuery(ctx context.Context, notMustParams
// 定义
var responce UnionOpenGoodsMaterialQueryResultResponse
var result UnionOpenGoodsMaterialQueryQueryResult
err = json.Unmarshal(request.ResponseBody, &responce)
err = json.Unmarshal([]byte(responce.JdUnionOpenGoodsMaterialQueryResponce.QueryResult), &result)
err = gojson.Unmarshal(request.ResponseBody, &responce)
err = gojson.Unmarshal([]byte(responce.JdUnionOpenGoodsMaterialQueryResponce.QueryResult), &result)
return newUnionOpenGoodsMaterialQueryResult(responce, result, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package jd
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -66,7 +66,7 @@ func (c *Client) UnionOpenGoodsPromotionGoodsInfoQuery(ctx context.Context, notM
// 定义
var responce UnionOpenGoodsPromotionGoodsInfoQueryResultResponse
var result UnionOpenGoodsPromotionGoodsInfoQueryQueryResult
err = json.Unmarshal(request.ResponseBody, &responce)
err = json.Unmarshal([]byte(responce.JdUnionOpenGoodsPromotiongoodsinfoQueryResponce.QueryResult), &result)
err = gojson.Unmarshal(request.ResponseBody, &responce)
err = gojson.Unmarshal([]byte(responce.JdUnionOpenGoodsPromotiongoodsinfoQueryResponce.QueryResult), &result)
return newUnionOpenGoodsPromotionGoodsInfoQueryResult(responce, result, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package jd
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -91,7 +91,7 @@ func (c *Client) UnionOpenOrderQuery(ctx context.Context, notMustParams ...Param
// 定义
var responce UnionOpenOrderQueryResultResponse
var result UnionOpenOrderQueryQueryResult
err = json.Unmarshal(request.ResponseBody, &responce)
err = json.Unmarshal([]byte(responce.JdUnionOpenOrderQueryResponce.QueryResult), &result)
err = gojson.Unmarshal(request.ResponseBody, &responce)
err = gojson.Unmarshal([]byte(responce.JdUnionOpenOrderQueryResponce.QueryResult), &result)
return newUnionOpenOrderQueryResult(responce, result, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package jd
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -100,7 +100,7 @@ func (c *Client) UnionOpenOrderRowQuery(ctx context.Context, notMustParams ...Pa
// 定义
var responce UnionOpenOrderRowQueryResultResponse
var result UnionOpenOrderRowQueryQueryResult
err = json.Unmarshal(request.ResponseBody, &responce)
err = json.Unmarshal([]byte(responce.JdUnionOpenOrderRowQueryResponce.QueryResult), &result)
err = gojson.Unmarshal(request.ResponseBody, &responce)
err = gojson.Unmarshal([]byte(responce.JdUnionOpenOrderRowQueryResponce.QueryResult), &result)
return newUnionOpenOrderRowQueryResult(responce, result, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package jd
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -45,7 +45,7 @@ func (c *Client) UnionOpenPromotionBySubUnionIdGet(ctx context.Context, notMustP
// 定义
var responce UnionOpenPromotionBySubUnionIdGetResultResponse
var result UnionOpenPromotionBySubUnionIdGetGetResult
err = json.Unmarshal(request.ResponseBody, &responce)
err = json.Unmarshal([]byte(responce.JdUnionOpenPromotionBySubUnionIdGetResponce.GetResult), &result)
err = gojson.Unmarshal(request.ResponseBody, &responce)
err = gojson.Unmarshal([]byte(responce.JdUnionOpenPromotionBySubUnionIdGetResponce.GetResult), &result)
return newUnionOpenPromotionBySubUnionIdGetResult(responce, result, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package jd
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -45,7 +45,7 @@ func (c *Client) UnionOpenPromotionCommonGet(ctx context.Context, notMustParams
// 定义
var responce UnionOpenPromotionCommonGetResultResponse
var result UnionOpenPromotionCommonGetGetResult
err = json.Unmarshal(request.ResponseBody, &responce)
err = json.Unmarshal([]byte(responce.JdUnionOpenPromotionCommonGetResponce.GetResult), &result)
err = gojson.Unmarshal(request.ResponseBody, &responce)
err = gojson.Unmarshal([]byte(responce.JdUnionOpenPromotionCommonGetResponce.GetResult), &result)
return newUnionOpenPromotionCommonGetResult(responce, result, request.ResponseBody, request, err)
}

@ -1,7 +1,7 @@
package jd
import (
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"net/url"
"sort"
"strconv"
@ -91,7 +91,7 @@ func getString(i interface{}) string {
case bool:
return strconv.FormatBool(v)
default:
bytes, _ := json.Marshal(v)
bytes, _ := gojson.Marshal(v)
return string(bytes)
}
}

@ -2,7 +2,7 @@ package kashangwl
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -46,6 +46,6 @@ func (c *Client) ApiBuy(ctx context.Context, notMustParams ...gorequest.Params)
request, err := c.request(ctx, apiUrl+"/api/buy", params)
// 定义
var response ApiBuyResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiBuyResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package kashangwl
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -34,6 +34,6 @@ func (c *Client) ApiCustomer(ctx context.Context) *ApiCustomerResult {
request, err := c.request(ctx, apiUrl+"/api/customer", map[string]interface{}{})
// 定义
var response ApiCustomerResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiCustomerResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package kashangwl
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -62,6 +62,6 @@ func (c *Client) ApiOrder(ctx context.Context, orderId string) *ApiOrderResult {
request, err := c.request(ctx, apiUrl+"/api/order", params)
// 定义
var response ApiOrderResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiOrderResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package kashangwl
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -62,7 +62,7 @@ func (c *Client) ApiOuterOrder(ctx context.Context, orderId string) *ApiOuterOrd
request, err := c.request(ctx, apiUrl+"/api/outer-order", params)
// 定义
var response ApiOuterOrderResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiOuterOrderResult(response, request.ResponseBody, request, err)
}

@ -2,8 +2,8 @@ package kashangwl
import (
"context"
"encoding/json"
"fmt"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -43,6 +43,6 @@ func (c *Client) ApiProductCache(ctx context.Context, productId int64) *ApiProdu
request, err := c.requestCache(ctx, fmt.Sprintf("%s/goods_info", apiUrlCache), params, http.MethodGet)
// 定义
var response ApiProductCacheResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiProductCacheResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package kashangwl
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -45,6 +45,6 @@ func (c *Client) ApiProduct(ctx context.Context, productId int64) *ApiProductRes
request, err := c.request(ctx, apiUrl+"/api/product", params)
// 定义
var response ApiProductResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiProductResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package kashangwl
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -41,6 +41,6 @@ func (c *Client) ApiProductRechargeParams(ctx context.Context, productId int64)
request, err := c.request(ctx, apiUrl+"/api/product/recharge-params", params)
// 定义
var response ApiProductRechargeParamsResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiProductRechargeParamsResult(response, request.ResponseBody, request, err)
}

@ -4,7 +4,7 @@ import (
"bytes"
"crypto/md5"
"encoding/hex"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"io"
"net/url"
@ -53,7 +53,7 @@ func (c *Client) getString(i interface{}) string {
case bool:
return strconv.FormatBool(v)
default:
marshal, _ := json.Marshal(v)
marshal, _ := gojson.Marshal(v)
return string(marshal)
}
}

@ -1,7 +1,7 @@
package leshuazf
import (
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -29,6 +29,6 @@ func (c *Client) ApiV2MerchantUpdateAuthority(notMustParams ...gorequest.Params)
request, err := c.request("/apiv2/merchant/updateAuthority", params, http.MethodPost)
// 定义
var response ApiV2MerchantUpdateAuthorityResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiV2MerchantUpdateAuthorityResult(response, request.ResponseBody, request, err)
}

@ -1,7 +1,7 @@
package leshuazf
import (
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -37,6 +37,6 @@ func (c *Client) DataArea(notMustParams ...gorequest.Params) *DataAreaResult {
request, err := c.request("/data/area", params, http.MethodPost)
// 定义
var response DataAreaResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newDataAreaResult(response, request.ResponseBody, request, err)
}

@ -1,7 +1,7 @@
package leshuazf
import (
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -50,6 +50,6 @@ func (c *Client) DataBankBranch2(notMustParams ...gorequest.Params) *DataBankBra
request, err := c.request("/data/bankbranch2", params, http.MethodPost)
// 定义
var response DataBankBranch2Response
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newDataBankBranch2Result(response, request.ResponseBody, request, err)
}

@ -1,7 +1,7 @@
package leshuazf
import (
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -36,6 +36,6 @@ func (c *Client) DataMcc(notMustParams ...gorequest.Params) *DataMccResult {
request, err := c.request("/data/mcc", params, http.MethodPost)
// 定义
var response DataMccResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newDataMccResult(response, request.ResponseBody, request, err)
}

@ -1,8 +1,8 @@
package leshuazf
import (
"encoding/json"
"github.com/dtapps/go-library/utils/gobase64"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gomd5"
"sort"
)
@ -16,6 +16,6 @@ func (c *Client) getSign(params map[string]interface{}) string {
keys = append(keys, k)
}
sort.Strings(keys)
str, _ := json.Marshal(keys) // data字符串值
str, _ := gojson.Marshal(keys) // data字符串值
return gobase64.Encode(gomd5.ToLower("lepos" + c.GetKeyAgent() + string(str)))
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -35,6 +35,6 @@ func (c *Client) ApiGenerateLink(ctx context.Context, notMustParams ...gorequest
request, err := c.request(ctx, apiUrl+"/api/generateLink", params, http.MethodGet)
// 定义
var response ApiGenerateLinkResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiGenerateLinkResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"github.com/dtapps/go-library/utils/gotime"
"net/http"
@ -46,6 +46,6 @@ func (c *Client) ApiGetQuaLitYsCoreBySid(ctx context.Context, notMustParams ...g
request, err := c.request(ctx, apiUrl+"/api/getqualityscorebysid", params, http.MethodGet)
// 定义
var response ApiGetQuaLitYsCoreBySidResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiGetQuaLitYsCoreBySidResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -35,6 +35,6 @@ func (c *Client) ApiMiniCode(ctx context.Context, notMustParams ...gorequest.Par
request, err := c.request(ctx, apiUrl+"/api/miniCode", params, http.MethodGet)
// 定义
var response ApiMiniCodeResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiMiniCodeResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"github.com/dtapps/go-library/utils/gotime"
"net/http"
@ -43,6 +43,6 @@ func (c *Client) ApiMtUnionCategory(ctx context.Context, notMustParams ...gorequ
request, err := c.request(ctx, apiUrl+"/api/getqualityscorebysid", params, http.MethodGet)
// 定义
var response ApiMtUnionCategoryResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiMtUnionCategoryResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"github.com/dtapps/go-library/utils/gotime"
"net/http"
@ -43,6 +43,6 @@ func (c *Client) ApiMtUnionCity(ctx context.Context, notMustParams ...gorequest.
request, err := c.request(ctx, apiUrl+"/api/getqualityscorebysid", params, http.MethodGet)
// 定义
var response ApiMtUnionCityResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiMtUnionCityResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"github.com/dtapps/go-library/utils/gotime"
"net/http"
@ -58,6 +58,6 @@ func (c *Client) ApiMtUnionPoi(ctx context.Context, notMustParams ...gorequest.P
request, err := c.request(ctx, apiUrl+"/api/getqualityscorebysid", params, http.MethodGet)
// 定义
var response ApiMtUnionPoiResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiMtUnionPoiResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"github.com/dtapps/go-library/utils/gotime"
"net/http"
@ -48,6 +48,6 @@ func (c *Client) ApiMtUnionSku(ctx context.Context, notMustParams ...gorequest.P
request, err := c.request(ctx, apiUrl+"/api/getqualityscorebysid", params, http.MethodGet)
// 定义
var response ApiMtUnionSkuResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiMtUnionSkuResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -75,6 +75,6 @@ func (c *Client) ApiOrder(ctx context.Context, notMustParams ...gorequest.Params
request, err := c.request(ctx, apiUrl+"/api/order", params, http.MethodGet)
// 定义
var response ApiOrderResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiOrderResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"github.com/dtapps/go-library/utils/gotime"
"net/http"
@ -60,6 +60,6 @@ func (c *Client) ApiOrderList(ctx context.Context, notMustParams ...gorequest.Pa
request, err := c.request(ctx, apiUrl+"/api/orderList", params, http.MethodGet)
// 定义
var response ApiOrderListResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newApiOrderListResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -41,6 +41,6 @@ func (c *Client) PoiArea(ctx context.Context, cityID int) *PoiAreaResult {
request, err := c.request(ctx, apiUrl+"/poi/area", params, http.MethodGet)
// 定义
var response PoiAreaResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPoiAreaResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -41,6 +41,6 @@ func (c *Client) PoiCategory(ctx context.Context, cityID int) *PoiCategoryResult
request, err := c.request(ctx, apiUrl+"/poi/category", params, http.MethodGet)
// 定义
var response PoiCategoryResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPoiCategoryResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -34,6 +34,6 @@ func (c *Client) PoiCity(ctx context.Context) *PoiCityResult {
request, err := c.request(ctx, apiUrl+"/poi/city", map[string]interface{}{}, http.MethodGet)
// 定义
var response PoiCityResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPoiCityResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package meituan
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -37,6 +37,6 @@ func (c *Client) PoiDistrict(ctx context.Context, cityID int) *PoiDistrictResult
request, err := c.request(ctx, apiUrl+"/poi/district", params, http.MethodGet)
// 定义
var response PoiDistrictResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPoiDistrictResult(response, request.ResponseBody, request, err)
}

@ -4,7 +4,7 @@ import (
"bytes"
"crypto/md5"
"encoding/hex"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"io"
"sort"
"strconv"
@ -40,7 +40,7 @@ func (c *Client) getString(i interface{}) string {
case bool:
return strconv.FormatBool(v)
default:
marshal, _ := json.Marshal(v)
marshal, _ := gojson.Marshal(v)
return string(marshal)
}
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -36,6 +36,6 @@ func (c *Client) PartnerCommonGetSurplusMoney(ctx context.Context, notMustParams
request, err := c.request(ctx, apiUrl+"/partner/common/GetSurplusMoney", params)
// 定义
var response PartnerCommonGetSurplusMoneyResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerCommonGetSurplusMoneyResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -31,6 +31,6 @@ func (c *Client) PartnerData4GetOrderData(ctx context.Context, notMustParams ...
request, err := c.request(ctx, apiUrl+"/partner/data4/GetOrderData", params)
// 定义
var response PartnerData4GetOrderDataResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4GetOrderDataResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -36,6 +36,6 @@ func (c *Client) PartnerData4GetAddressLists(ctx context.Context) *PartnerData4G
request, err := c.request(ctx, apiUrl+"/partner/data4/getAddressLists", params)
// 定义
var response PartnerData4GetAddressListsResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4GetAddressListsResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -49,6 +49,6 @@ func (c *Client) PartnerData4GetCinema(ctx context.Context) *PartnerData4GetCine
request, err := c.request(ctx, apiUrl+"/partner/data4/getCinema", params)
// 定义
var response PartnerData4GetCinemaResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4GetCinemaResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -37,6 +37,6 @@ func (c *Client) PartnerData4GetCityLists(ctx context.Context) *PartnerData4GetC
request, err := c.request(ctx, apiUrl+"/partner/data4/getCityLists", params)
// 定义
var response PartnerData4GetCityListsResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4GetCityListsResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -50,6 +50,6 @@ func (c *Client) PartnerData4GetFilmList(ctx context.Context) *PartnerData4GetFi
request, err := c.request(ctx, apiUrl+"/partner/data4/getFilmList", params)
// 定义
var response PartnerData4GetFilmListResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4GetFilmListResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -47,6 +47,6 @@ func (c *Client) PartnerData4GetOrderDetail(ctx context.Context, orderNo string)
request, err := c.request(ctx, apiUrl+"/partner/data4/getOrderDetail", params)
// 定义
var response PartnerData4GetOrderDetailResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4GetOrderDetailResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -55,6 +55,6 @@ func (c *Client) PartnerData4GetOrderStatus(ctx context.Context, notMustParams .
request, err := c.request(ctx, apiUrl+"/partner/data4/getOrderStatus", params)
// 定义
var response PartnerData4GetOrderStatusResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4GetOrderStatusResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -51,6 +51,6 @@ func (c *Client) PartnerData4GetPlan(ctx context.Context) *PartnerData4GetPlanRe
request, err := c.request(ctx, apiUrl+"/partner/data4/getPlan", params)
// 定义
var response PartnerData4GetPlanResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4GetPlanResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -53,6 +53,6 @@ func (c *Client) PartnerData4GetPlanDetail(ctx context.Context, cinemaId int, fe
request, err := c.request(ctx, apiUrl+"/partner/data4/getPlanDetail", params)
// 定义
var response PartnerData4GetPlanDetailResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4GetPlanDetailResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -47,6 +47,6 @@ func (c *Client) PartnerData4GetPlanSeat(ctx context.Context, cinemaId int, feat
request, err := c.request(ctx, apiUrl+"/partner/data4/getPlanSeat", params)
// 定义
var response PartnerData4GetPlanSeatResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4GetPlanSeatResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -38,6 +38,6 @@ func (c *Client) PartnerData4LockSeat(ctx context.Context, notMustParams ...gore
request, err := c.request(ctx, apiUrl+"/partner/data4/lockSeat", params)
// 定义
var response PartnerData4LockSeatResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4LockSeatResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -40,6 +40,6 @@ func (c *Client) PartnerData4SellTicket(ctx context.Context, orderId, orderNo, n
request, err := c.request(ctx, apiUrl+"/partner/data4/sellTicket", params)
// 定义
var response PartnerData4SellTicketResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4SellTicketResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package nldyp
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -35,6 +35,6 @@ func (c *Client) PartnerData4UnLockOrder(ctx context.Context, notMustParams ...g
request, err := c.request(ctx, apiUrl+"/partner/data4/unLockOrder", params)
// 定义
var response PartnerData4UnLockOrderResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPartnerData4UnLockOrderResult(response, request.ResponseBody, request, err)
}

@ -3,8 +3,8 @@ package nldyp
import (
"crypto/md5"
"encoding/hex"
"encoding/json"
"fmt"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gotime"
"sort"
"strconv"
@ -39,7 +39,7 @@ func getString(i interface{}) string {
case bool:
return strconv.FormatBool(v)
default:
bytes, _ := json.Marshal(v)
bytes, _ := gojson.Marshal(v)
return string(bytes)
}
}

@ -1,8 +1,8 @@
package pconline
import (
"encoding/json"
"fmt"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
"golang.org/x/text/encoding/simplifiedchinese"
)
@ -42,6 +42,6 @@ func (c *Client) Ip(ip string) *IpResult {
var decodeBytes, _ = simplifiedchinese.GB18030.NewDecoder().Bytes(request.ResponseBody)
// 定义
var response IpResponse
err = json.Unmarshal(decodeBytes, &response)
err = gojson.Unmarshal(decodeBytes, &response)
return newIpResult(response, request.ResponseBody, request, err)
}

@ -1,7 +1,7 @@
package pinduoduo
import (
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"net/url"
"sort"
"strconv"
@ -84,7 +84,7 @@ func getString(i interface{}) string {
return strconv.FormatBool(v)
default:
bytes, _ := json.Marshal(v)
bytes, _ := gojson.Marshal(v)
return string(bytes)
}
}

@ -2,7 +2,7 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -71,8 +71,8 @@ func (c *Client) CmsPromUrlGenerate(ctx context.Context, notMustParams ...Params
request, err := c.request(ctx, params)
// 定义
var response CmsPromUrlGenerateResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
var responseError CmsPromUrlGenerateError
err = json.Unmarshal(request.ResponseBody, &responseError)
err = gojson.Unmarshal(request.ResponseBody, &responseError)
return newCmsPromUrlGenerateResult(response, request.ResponseBody, request, err, responseError)
}

@ -2,7 +2,7 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -106,6 +106,6 @@ func (c *Client) GoodsDetail(ctx context.Context, notMustParams ...Params) *Good
request, err := c.request(ctx, params)
// 定义
var response GoodsDetailResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newGoodsDetailResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -38,6 +38,6 @@ func (c *Client) GoodsPidGenerate(ctx context.Context, notMustParams ...Params)
request, err := c.request(ctx, params)
// 定义
var response GoodsPidGenerateResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newGoodsPidGenerateResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,6 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -64,6 +63,6 @@ func (c *Client) GoodsPromotionUrlGenerate(ctx context.Context, notMustParams ..
request, err := c.request(ctx, params)
// 定义
var response GoodsPromotionUrlGenerateResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newGoodsPromotionUrlGenerateResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -88,6 +88,6 @@ func (c *Client) GoodsRecommendGet(ctx context.Context, notMustParams ...Params)
request, err := c.request(ctx, params)
// 定义
var response GoodsRecommendGetResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newGoodsRecommendGetResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -102,6 +102,6 @@ func (c *Client) GoodsSearch(ctx context.Context, notMustParams ...Params) *Good
request, err := c.request(ctx, params)
// 定义
var response GoodsSearchResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newGoodsSearchResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -34,6 +34,6 @@ func (c *Client) MemberAuthorityQuery(ctx context.Context, notMustParams ...Para
request, err := c.request(ctx, params)
// 定义
var response MemberAuthorityQueryResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newMemberAuthorityQueryResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -33,6 +33,6 @@ func (c *PddDdkOauthCashGiftApi) Create(ctx context.Context, notMustParams ...Pa
request, err := c.client.request(ctx, params)
// 定义
var response PddDdkOauthCashGiftCreateResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPddDdkOauthCashGiftCreateResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -56,6 +56,6 @@ func (c *PddDdkOauthCashGiftApi) DataQuery(ctx context.Context, notMustParams ..
request, err := c.client.request(ctx, params)
// 定义
var response PddDdkOauthCashGiftDataQueryResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPddDdkOauthCashGiftDataQueryResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -32,6 +32,6 @@ func (c *PddDdkOauthCashGiftApi) StatusUpdate(ctx context.Context, notMustParams
request, err := c.client.request(ctx, params)
// 定义
var response PddDdkOauthCashGiftStatusUpdateResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPddDdkOauthCashGiftStatusUpdateResult(response, request.ResponseBody, request, err)
}

@ -2,7 +2,7 @@ package pinduoduo
import (
"context"
"encoding/json"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -67,6 +67,6 @@ func (c *PddDdkOauthCmsApi) UrlGenerate(ctx context.Context, notMustParams ...Pa
request, err := c.client.request(ctx, params)
// 定义
var response PddDdkOauthCmsUrlGenerateResponse
err = json.Unmarshal(request.ResponseBody, &response)
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPddDdkOauthCmsUrlGenerateResult(response, request.ResponseBody, request, err)
}

@ -0,0 +1,80 @@
package pinduoduo
import (
"context"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
type PddDdkOauthGoodsDetailResponse struct {
OrderDetailResponse struct {
SepMarketFee int `json:"sep_market_fee"`
GoodsPrice int `json:"goods_price"`
SepDuoId int `json:"sep_duo_id"`
Pid string `json:"pid"`
PromotionRate int `json:"promotion_rate"`
CpsSign string `json:"cps_sign"`
Type int `json:"type"`
SubsidyDuoAmountLevel int `json:"subsidy_duo_amount_level"`
OrderStatus int `json:"order_status"`
CatIds []int `json:"cat_ids"`
OrderCreateTime int64 `json:"order_create_time"`
IsDirect int `json:"is_direct"`
OrderGroupSuccessTime int `json:"order_group_success_time"`
MallId int `json:"mall_id"`
OrderAmount int64 `json:"order_amount"`
PriceCompareStatus int `json:"price_compare_status"`
MallName string `json:"mall_name"`
OrderModifyAt int `json:"order_modify_at"`
AuthDuoId int `json:"auth_duo_id"`
CpaNew int `json:"cpa_new"`
GoodsName string `json:"goods_name"`
BatchNo string `json:"batch_no"`
RedPacketType int `json:"red_packet_type"`
UrlLastGenerateTime int `json:"url_last_generate_time"`
GoodsQuantity int `json:"goods_quantity"`
GoodsId int64 `json:"goods_id"`
SepParameters string `json:"sep_parameters"`
SepRate int `json:"sep_rate"`
SubsidyType int `json:"subsidy_type"`
ShareRate int `json:"share_rate"`
CustomParameters string `json:"custom_parameters"`
GoodsThumbnailUrl string `json:"goods_thumbnail_url"`
PromotionAmount int64 `json:"promotion_amount"`
OrderPayTime int `json:"order_pay_time"`
GroupId int64 `json:"group_id"`
SepPid string `json:"sep_pid"`
ReturnStatus int `json:"return_status"`
OrderStatusDesc string `json:"order_status_desc"`
ShareAmount int `json:"share_amount"`
GoodsCategoryName string `json:"goods_category_name"`
RequestId string `json:"request_id"`
GoodsSign string `json:"goods_sign"`
OrderSn string `json:"order_sn"`
ZsDuoId int `json:"zs_duo_id"`
} `json:"order_detail_response"`
}
type PddDdkOauthGoodsDetailResult struct {
Result PddDdkOauthGoodsDetailResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
Err error // 错误
}
func newPddDdkOauthGoodsDetailResult(result PddDdkOauthGoodsDetailResponse, body []byte, http gorequest.Response, err error) *PddDdkOauthGoodsDetailResult {
return &PddDdkOauthGoodsDetailResult{Result: result, Body: body, Http: http, Err: err}
}
// Detail 多多进宝商品详情查询
// https://jinbao.pinduoduo.com/third-party/api-detail?apiName=pdd.ddk.oauth.goods.detail
func (c *PddDdkOauthGoodsApi) Detail(ctx context.Context, notMustParams ...Params) *PddDdkOauthGoodsDetailResult {
// 参数
params := NewParamsWithType("pdd.ddk.oauth.goods.detail", notMustParams...)
// 请求
request, err := c.client.request(ctx, params)
// 定义
var response PddDdkOauthGoodsDetailResponse
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPddDdkOauthGoodsDetailResult(response, request.ResponseBody, request, err)
}

@ -0,0 +1,80 @@
package pinduoduo
import (
"context"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
type PddDdkOauthGoodsPidGenerateResponse struct {
OrderDetailResponse struct {
SepMarketFee int `json:"sep_market_fee"`
GoodsPrice int `json:"goods_price"`
SepDuoId int `json:"sep_duo_id"`
Pid string `json:"pid"`
PromotionRate int `json:"promotion_rate"`
CpsSign string `json:"cps_sign"`
Type int `json:"type"`
SubsidyDuoAmountLevel int `json:"subsidy_duo_amount_level"`
OrderStatus int `json:"order_status"`
CatIds []int `json:"cat_ids"`
OrderCreateTime int64 `json:"order_create_time"`
IsDirect int `json:"is_direct"`
OrderGroupSuccessTime int `json:"order_group_success_time"`
MallId int `json:"mall_id"`
OrderAmount int64 `json:"order_amount"`
PriceCompareStatus int `json:"price_compare_status"`
MallName string `json:"mall_name"`
OrderModifyAt int `json:"order_modify_at"`
AuthDuoId int `json:"auth_duo_id"`
CpaNew int `json:"cpa_new"`
GoodsName string `json:"goods_name"`
BatchNo string `json:"batch_no"`
RedPacketType int `json:"red_packet_type"`
UrlLastGenerateTime int `json:"url_last_generate_time"`
GoodsQuantity int `json:"goods_quantity"`
GoodsId int64 `json:"goods_id"`
SepParameters string `json:"sep_parameters"`
SepRate int `json:"sep_rate"`
SubsidyType int `json:"subsidy_type"`
ShareRate int `json:"share_rate"`
CustomParameters string `json:"custom_parameters"`
GoodsThumbnailUrl string `json:"goods_thumbnail_url"`
PromotionAmount int64 `json:"promotion_amount"`
OrderPayTime int `json:"order_pay_time"`
GroupId int64 `json:"group_id"`
SepPid string `json:"sep_pid"`
ReturnStatus int `json:"return_status"`
OrderStatusDesc string `json:"order_status_desc"`
ShareAmount int `json:"share_amount"`
GoodsCategoryName string `json:"goods_category_name"`
RequestId string `json:"request_id"`
GoodsSign string `json:"goods_sign"`
OrderSn string `json:"order_sn"`
ZsDuoId int `json:"zs_duo_id"`
} `json:"order_detail_response"`
}
type PddDdkOauthGoodsPidGenerateResult struct {
Result PddDdkOauthGoodsPidGenerateResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
Err error // 错误
}
func newPddDdkOauthGoodsPidGenerateResult(result PddDdkOauthGoodsPidGenerateResponse, body []byte, http gorequest.Response, err error) *PddDdkOauthGoodsPidGenerateResult {
return &PddDdkOauthGoodsPidGenerateResult{Result: result, Body: body, Http: http, Err: err}
}
// PidGenerate 多多进宝推广位创建接口
// https://jinbao.pinduoduo.com/third-party/api-detail?apiName=pdd.ddk.oauth.goods.pid.generate
func (c *PddDdkOauthGoodsApi) PidGenerate(ctx context.Context, notMustParams ...Params) *PddDdkOauthGoodsPidGenerateResult {
// 参数
params := NewParamsWithType("pdd.ddk.oauth.goods.pid.generate", notMustParams...)
// 请求
request, err := c.client.request(ctx, params)
// 定义
var response PddDdkOauthGoodsPidGenerateResponse
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPddDdkOauthGoodsPidGenerateResult(response, request.ResponseBody, request, err)
}

@ -0,0 +1,80 @@
package pinduoduo
import (
"context"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
type PddDdkOauthGoodsPidQueryResponse struct {
OrderDetailResponse struct {
SepMarketFee int `json:"sep_market_fee"`
GoodsPrice int `json:"goods_price"`
SepDuoId int `json:"sep_duo_id"`
Pid string `json:"pid"`
PromotionRate int `json:"promotion_rate"`
CpsSign string `json:"cps_sign"`
Type int `json:"type"`
SubsidyDuoAmountLevel int `json:"subsidy_duo_amount_level"`
OrderStatus int `json:"order_status"`
CatIds []int `json:"cat_ids"`
OrderCreateTime int64 `json:"order_create_time"`
IsDirect int `json:"is_direct"`
OrderGroupSuccessTime int `json:"order_group_success_time"`
MallId int `json:"mall_id"`
OrderAmount int64 `json:"order_amount"`
PriceCompareStatus int `json:"price_compare_status"`
MallName string `json:"mall_name"`
OrderModifyAt int `json:"order_modify_at"`
AuthDuoId int `json:"auth_duo_id"`
CpaNew int `json:"cpa_new"`
GoodsName string `json:"goods_name"`
BatchNo string `json:"batch_no"`
RedPacketType int `json:"red_packet_type"`
UrlLastGenerateTime int `json:"url_last_generate_time"`
GoodsQuantity int `json:"goods_quantity"`
GoodsId int64 `json:"goods_id"`
SepParameters string `json:"sep_parameters"`
SepRate int `json:"sep_rate"`
SubsidyType int `json:"subsidy_type"`
ShareRate int `json:"share_rate"`
CustomParameters string `json:"custom_parameters"`
GoodsThumbnailUrl string `json:"goods_thumbnail_url"`
PromotionAmount int64 `json:"promotion_amount"`
OrderPayTime int `json:"order_pay_time"`
GroupId int64 `json:"group_id"`
SepPid string `json:"sep_pid"`
ReturnStatus int `json:"return_status"`
OrderStatusDesc string `json:"order_status_desc"`
ShareAmount int `json:"share_amount"`
GoodsCategoryName string `json:"goods_category_name"`
RequestId string `json:"request_id"`
GoodsSign string `json:"goods_sign"`
OrderSn string `json:"order_sn"`
ZsDuoId int `json:"zs_duo_id"`
} `json:"order_detail_response"`
}
type PddDdkOauthGoodsPidQueryResult struct {
Result PddDdkOauthGoodsPidQueryResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
Err error // 错误
}
func newPddDdkOauthGoodsPidQueryResult(result PddDdkOauthGoodsPidQueryResponse, body []byte, http gorequest.Response, err error) *PddDdkOauthGoodsPidQueryResult {
return &PddDdkOauthGoodsPidQueryResult{Result: result, Body: body, Http: http, Err: err}
}
// PidQuery 多多客已生成推广位信息查询
// https://jinbao.pinduoduo.com/third-party/api-detail?apiName=pdd.ddk.oauth.goods.pid.query
func (c *PddDdkOauthGoodsApi) PidQuery(ctx context.Context, notMustParams ...Params) *PddDdkOauthGoodsPidQueryResult {
// 参数
params := NewParamsWithType("pdd.ddk.oauth.goods.pid.query", notMustParams...)
// 请求
request, err := c.client.request(ctx, params)
// 定义
var response PddDdkOauthGoodsPidQueryResponse
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPddDdkOauthGoodsPidQueryResult(response, request.ResponseBody, request, err)
}

@ -0,0 +1,80 @@
package pinduoduo
import (
"context"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
type PddDdkOauthGoodsPromUrlGenerateResponse struct {
OrderDetailResponse struct {
SepMarketFee int `json:"sep_market_fee"`
GoodsPrice int `json:"goods_price"`
SepDuoId int `json:"sep_duo_id"`
Pid string `json:"pid"`
PromotionRate int `json:"promotion_rate"`
CpsSign string `json:"cps_sign"`
Type int `json:"type"`
SubsidyDuoAmountLevel int `json:"subsidy_duo_amount_level"`
OrderStatus int `json:"order_status"`
CatIds []int `json:"cat_ids"`
OrderCreateTime int64 `json:"order_create_time"`
IsDirect int `json:"is_direct"`
OrderGroupSuccessTime int `json:"order_group_success_time"`
MallId int `json:"mall_id"`
OrderAmount int64 `json:"order_amount"`
PriceCompareStatus int `json:"price_compare_status"`
MallName string `json:"mall_name"`
OrderModifyAt int `json:"order_modify_at"`
AuthDuoId int `json:"auth_duo_id"`
CpaNew int `json:"cpa_new"`
GoodsName string `json:"goods_name"`
BatchNo string `json:"batch_no"`
RedPacketType int `json:"red_packet_type"`
UrlLastGenerateTime int `json:"url_last_generate_time"`
GoodsQuantity int `json:"goods_quantity"`
GoodsId int64 `json:"goods_id"`
SepParameters string `json:"sep_parameters"`
SepRate int `json:"sep_rate"`
SubsidyType int `json:"subsidy_type"`
ShareRate int `json:"share_rate"`
CustomParameters string `json:"custom_parameters"`
GoodsThumbnailUrl string `json:"goods_thumbnail_url"`
PromotionAmount int64 `json:"promotion_amount"`
OrderPayTime int `json:"order_pay_time"`
GroupId int64 `json:"group_id"`
SepPid string `json:"sep_pid"`
ReturnStatus int `json:"return_status"`
OrderStatusDesc string `json:"order_status_desc"`
ShareAmount int `json:"share_amount"`
GoodsCategoryName string `json:"goods_category_name"`
RequestId string `json:"request_id"`
GoodsSign string `json:"goods_sign"`
OrderSn string `json:"order_sn"`
ZsDuoId int `json:"zs_duo_id"`
} `json:"order_detail_response"`
}
type PddDdkOauthGoodsPromUrlGenerateResult struct {
Result PddDdkOauthGoodsPromUrlGenerateResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
Err error // 错误
}
func newPddDdkOauthGoodsPromUrlGenerateResult(result PddDdkOauthGoodsPromUrlGenerateResponse, body []byte, http gorequest.Response, err error) *PddDdkOauthGoodsPromUrlGenerateResult {
return &PddDdkOauthGoodsPromUrlGenerateResult{Result: result, Body: body, Http: http, Err: err}
}
// PromUrlGenerate 生成多多进宝推广链接
// https://jinbao.pinduoduo.com/third-party/api-detail?apiName=pdd.ddk.oauth.goods.prom.url.generate
func (c *PddDdkOauthGoodsApi) PromUrlGenerate(ctx context.Context, notMustParams ...Params) *PddDdkOauthGoodsPromUrlGenerateResult {
// 参数
params := NewParamsWithType("pdd.ddk.oauth.goods.prom.url.generate", notMustParams...)
// 请求
request, err := c.client.request(ctx, params)
// 定义
var response PddDdkOauthGoodsPromUrlGenerateResponse
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPddDdkOauthGoodsPromUrlGenerateResult(response, request.ResponseBody, request, err)
}

@ -0,0 +1,80 @@
package pinduoduo
import (
"context"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gorequest"
)
type PddDdkOauthGoodsRecommendGetResponse struct {
OrderDetailResponse struct {
SepMarketFee int `json:"sep_market_fee"`
GoodsPrice int `json:"goods_price"`
SepDuoId int `json:"sep_duo_id"`
Pid string `json:"pid"`
PromotionRate int `json:"promotion_rate"`
CpsSign string `json:"cps_sign"`
Type int `json:"type"`
SubsidyDuoAmountLevel int `json:"subsidy_duo_amount_level"`
OrderStatus int `json:"order_status"`
CatIds []int `json:"cat_ids"`
OrderCreateTime int64 `json:"order_create_time"`
IsDirect int `json:"is_direct"`
OrderGroupSuccessTime int `json:"order_group_success_time"`
MallId int `json:"mall_id"`
OrderAmount int64 `json:"order_amount"`
PriceCompareStatus int `json:"price_compare_status"`
MallName string `json:"mall_name"`
OrderModifyAt int `json:"order_modify_at"`
AuthDuoId int `json:"auth_duo_id"`
CpaNew int `json:"cpa_new"`
GoodsName string `json:"goods_name"`
BatchNo string `json:"batch_no"`
RedPacketType int `json:"red_packet_type"`
UrlLastGenerateTime int `json:"url_last_generate_time"`
GoodsQuantity int `json:"goods_quantity"`
GoodsId int64 `json:"goods_id"`
SepParameters string `json:"sep_parameters"`
SepRate int `json:"sep_rate"`
SubsidyType int `json:"subsidy_type"`
ShareRate int `json:"share_rate"`
CustomParameters string `json:"custom_parameters"`
GoodsThumbnailUrl string `json:"goods_thumbnail_url"`
PromotionAmount int64 `json:"promotion_amount"`
OrderPayTime int `json:"order_pay_time"`
GroupId int64 `json:"group_id"`
SepPid string `json:"sep_pid"`
ReturnStatus int `json:"return_status"`
OrderStatusDesc string `json:"order_status_desc"`
ShareAmount int `json:"share_amount"`
GoodsCategoryName string `json:"goods_category_name"`
RequestId string `json:"request_id"`
GoodsSign string `json:"goods_sign"`
OrderSn string `json:"order_sn"`
ZsDuoId int `json:"zs_duo_id"`
} `json:"order_detail_response"`
}
type PddDdkOauthGoodsRecommendGetResult struct {
Result PddDdkOauthGoodsRecommendGetResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
Err error // 错误
}
func newPddDdkOauthGoodsRecommendGetResult(result PddDdkOauthGoodsRecommendGetResponse, body []byte, http gorequest.Response, err error) *PddDdkOauthGoodsRecommendGetResult {
return &PddDdkOauthGoodsRecommendGetResult{Result: result, Body: body, Http: http, Err: err}
}
// RecommendGet 运营频道商品查询API
// https://jinbao.pinduoduo.com/third-party/api-detail?apiName=pdd.ddk.oauth.goods.recommend.get
func (c *PddDdkOauthGoodsApi) RecommendGet(ctx context.Context, notMustParams ...Params) *PddDdkOauthGoodsRecommendGetResult {
// 参数
params := NewParamsWithType("pdd.ddk.oauth.goods.recommend.get", notMustParams...)
// 请求
request, err := c.client.request(ctx, params)
// 定义
var response PddDdkOauthGoodsRecommendGetResponse
err = gojson.Unmarshal(request.ResponseBody, &response)
return newPddDdkOauthGoodsRecommendGetResult(response, request.ResponseBody, request, err)
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save