Skip to content

Commit

Permalink
Merge branch 'release/v1.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Feb 28, 2024
2 parents 56b09b4 + cb640f8 commit 760ee40
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion api/conversion/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ import (
// 1.展现回传事件的统计信息,例如回传”商品成单“时间,我们会by计划/创意等维度呈现订单量、订单成本、转化率等指标
// 2.数据进入您的广告模型,优化您的广告效果。
func Conversion(ctx context.Context, clt *core.SDKClient, req *conversion.Request) error {
req.AppID = clt.AppID()
return clt.Post(ctx, "/conversion", req, nil, "")
}
6 changes: 3 additions & 3 deletions core/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

// SDKClient sdk client
type SDKClient struct {
appID string
appID uint64
secret string
debug bool
sandbox bool
Expand All @@ -25,7 +25,7 @@ type SDKClient struct {
}

// NewSDKClient 创建SDKClient
func NewSDKClient(appID string, secret string) *SDKClient {
func NewSDKClient(appID uint64, secret string) *SDKClient {
return &SDKClient{
appID: appID,
secret: secret,
Expand Down Expand Up @@ -58,7 +58,7 @@ func (c *SDKClient) SetRateLimiter(limiter RateLimiter) {
c.limiter = limiter
}

func (c *SDKClient) AppID() string {
func (c *SDKClient) AppID() uint64 {
return c.appID
}

Expand Down
4 changes: 2 additions & 2 deletions model/conversion/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

// Request 转化回传请求
type Request struct {
// AppID
// AppID 开发组id,联系运营获取
AppID string `json:"app_id,omitempty"`
// AccessToken
// AccessToken 开发者id对应的验证token,联系运营获取
AccessToken string `json:"access_token,omitempty"`
// EventType 事件类型
EventType enum.EventType `json:"event_type,omitempty"`
Expand Down
4 changes: 3 additions & 1 deletion model/oauth/url_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package oauth

import (
"strconv"

"github.com/bububa/spotlight-mapi/enum"
"github.com/bububa/spotlight-mapi/model"
"github.com/bububa/spotlight-mapi/util"
Expand All @@ -21,7 +23,7 @@ type URLRequest struct {
func (r URLRequest) Encode() string {
values := util.NewUrlValues()
defer util.ReleaseUrlValues(values)
values.Set("app_id", r.AppID)
values.Set("app_id", strconv.FormatUint(r.AppID, 10))
values.Set("scope", string(util.JSONMarshal(r.Scope)))
values.Set("redirect_uri", r.RedirectURI)
if r.State != "" {
Expand Down
2 changes: 1 addition & 1 deletion model/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type UploadRequest interface {

type BaseRequest struct {
// AppID 应用ID
AppID string `json:"app_id,omitempty"`
AppID uint64 `json:"app_id,omitempty"`
// Secret 应用secret
Secret string `json:"secret,omitempty"`
}
Expand Down

0 comments on commit 760ee40

Please sign in to comment.