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.
|
|
|
package jd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"git.oa00.com/supply-chain/service/client"
|
|
|
|
)
|
|
|
|
|
|
|
|
type task struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
// PullSku @Title 拉取京东商品
|
|
|
|
func (t *task) PullSku(ctx context.Context) error {
|
|
|
|
a := 0
|
|
|
|
xClient, err := client.GetClient(t)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return xClient.Call(ctx, "PullSku", 0, &a)
|
|
|
|
}
|
|
|
|
|
|
|
|
// SkuAdd @Title 添加商品到库
|
|
|
|
func (t *task) SkuAdd(ctx context.Context) error {
|
|
|
|
a := 0
|
|
|
|
xClient, err := client.GetClient(t)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return xClient.Call(ctx, "SkuAdd", 0, &a)
|
|
|
|
}
|
|
|
|
|
|
|
|
// RefreshToken @Title 更新token
|
|
|
|
func (t *task) RefreshToken(ctx context.Context) error {
|
|
|
|
a := 0
|
|
|
|
xClient, err := client.GetClient(t)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return xClient.Call(ctx, "RefreshToken", 0, &a)
|
|
|
|
}
|
|
|
|
|
|
|
|
type ReplySkuAddStatus struct {
|
|
|
|
Total uint
|
|
|
|
Count uint
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetSkuAddStatus @Title 获取同步状态
|
|
|
|
func (t *task) GetSkuAddStatus(ctx context.Context) (reply ReplySkuAddStatus, err error) {
|
|
|
|
xClient, err := client.GetClient(t)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
err = xClient.Call(ctx, "GetSkuAddStatus", 0, &reply)
|
|
|
|
return
|
|
|
|
}
|