pub struct JDClient<T: SessionStore> { /* private fields */ }Implementations
sourceimpl<T: SessionStore> JDClient<T>
impl<T: SessionStore> JDClient<T>
JDClient
Example
async fn main() {
use labrador::JDClient;
let client = JDClient::new("appKey", "secret");
// Do Some Thing You Want
// ...
}pub fn new<Q: Into<String>, S: Into<String>>(
app_key: Q,
secret: S
) -> JDClient<SimpleStorage>
jd only.pub fn from_session<Q: Into<String>, S: Into<String>>(
app_key: Q,
secret: S,
session: T
) -> JDClient<T>
jd only.sourcepub async fn get_jf_select(
&self,
request: JdJFGoodsParam
) -> LabradorResult<JdCommonResponse<Vec<JdJFGoodsSelect>>>
Available on crate feature jd only.
pub async fn get_jf_select(
&self,
request: JdJFGoodsParam
) -> LabradorResult<JdCommonResponse<Vec<JdJFGoodsSelect>>>
jd only.京粉精选商品查询
京东联盟精选优质商品,每日更新,可通过频道ID查询各个频道下的精选商品。 用获取的优惠券链接调用转链接口时,需传入搜索接口link字段返回的原始优惠券链接 切勿对链接进行任何encode、decode操作,否则将导致转链二合一推广链接时校验失败。
示例
use labrador::JDClient;
use labrador::{JdJFGoodsParam};
async fn main() {
let param = JdJFGoodsParam {
elite_id: 22,
page_index: 1.into(),
page_size: 1.into(),
sort_name: None,
sort: None,
pid: "1001969763_4100247890_3003271490".to_owned().into(),
fields: None,
forbid_types: None,
};
let client = JDClient::new("appKey", "secret");
match client.get_jf_select(param).await {
Ok(res) => {}
Err(err) => {}
}
}
sourcepub async fn get_goods_detail(
&self,
request: JdGoodsInfoQueryRequest
) -> LabradorResult<JdCommonResponse<Vec<JdGoodsInfoQuery>>>
Available on crate feature jd only.
pub async fn get_goods_detail(
&self,
request: JdGoodsInfoQueryRequest
) -> LabradorResult<JdCommonResponse<Vec<JdGoodsInfoQuery>>>
jd only.根据skuid查询商品信息
通过SKUID查询推广商品的名称、主图、类目、价格、物流、是否自营、30天引单数量等详细信息,支持批量获取。 通常用于在媒体侧展示商品详情。
示例
use labrador::JDClient;
use labrador::{JdGoodsInfoQueryRequest};
async fn main() {
let param = JdGoodsInfoQueryRequest {
sku_ids: "60566006897".to_string().into(),
};
let client = JDClient::new("appKey", "secret");
match client.get_goods_detail(param).await {
Ok(res) => {}
Err(err) => {}
}
}
sourcepub async fn generate_promotion_url(
&self,
request: JdPromotionUrlGenerateParam
) -> LabradorResult<JdCommonResponse<JdPromotionUrlGenerateResponse>>
Available on crate feature jd only.
pub async fn generate_promotion_url(
&self,
request: JdPromotionUrlGenerateParam
) -> LabradorResult<JdCommonResponse<JdPromotionUrlGenerateResponse>>
jd only.网站/APP获取推广链接接口
网站/APP来获取的推广链接,功能同宙斯接口的自定义链接转换、 APP领取代码接口通过商品链接、活动链接获取普通推广链接 支持传入subunionid参数,可用于区分媒体自身的用户ID,该参数可在订单查询接口返回,需向cps-qxsq@jd.com申请权限。
示例
use labrador::JDClient;
use labrador::{JdPromotionUrlGenerateParam};
async fn main() {
let param = JdPromotionUrlGenerateParam {
material_id: "".to_owned(),
site_id: "".to_owned(),
position_id: None,
sub_union_id: None,
ext1: None,
pid: None,
coupon_url: None,
gift_coupon_key: None,
};
let client = JDClient::new("appKey", "secret");
match client.generate_promotion_url(param).await {
Ok(res) => {}
Err(err) => {}
}
}
sourcepub async fn query_recent_order(
&self,
request: JdOrderRecentQueryParam
) -> LabradorResult<JdCommonResponse<Vec<JdOrderQueryResponse>>>
👎 DeprecatedAvailable on crate feature jd only.
pub async fn query_recent_order(
&self,
request: JdOrderRecentQueryParam
) -> LabradorResult<JdCommonResponse<Vec<JdOrderQueryResponse>>>
jd only.订单查询
查询推广订单及佣金信息,可查询最近90天内下单的订单,会随着订单状态变化同步更新数据。支持按下单时间、完成时间或更新时间查询。建议按更新时间每分钟调用一次,查询最近一分钟的订单更新数据。 支持查询subunionid、推广位、PID参数,支持普通推客及工具商推客订单查询。 该接口即将下线,请使用订单行查询接口https://union.jd.com/openplatform/api/12707
示例
use labrador::JDClient;
use labrador::{JdOrderRecentQueryParam};
async fn main() {
let param = JdOrderRecentQueryParam {
page_no: 1.into(),
page_size: 1.into(),
bill_type: 1,
time: "".to_owned(),
child_union_id: None,
key: None,
};
let client = JDClient::new("appKey", "secret");
match client.query_recent_order(param).await {
Ok(res) => {}
Err(err) => {}
}
}
sourcepub async fn query_raw_order(
&self,
request: JdOrderRawQueryParam
) -> LabradorResult<JdCommonResponse<Vec<JdOrderQueryResponse>>>
Available on crate feature jd only.
pub async fn query_raw_order(
&self,
request: JdOrderRawQueryParam
) -> LabradorResult<JdCommonResponse<Vec<JdOrderQueryResponse>>>
jd only.订单行查询
查询推广订单及佣金信息,可查询最近90天内下单的订单,会随着订单状态变化同步更新数据。 支持按下单时间、完成时间或更新时间查询。建议按更新时间每分钟调用一次,查询最近一分钟的订单更新数据。 支持查询subunionid、推广位、PID参数,支持普通推客及工具商推客订单查询。
如需要通过SDK调用此接口,请接入JOS SDK
示例
use labrador::JDClient;
use labrador::{JdOrderRawQueryParam};
async fn main() {
let param = JdOrderRawQueryParam {
page_index: 1.into(),
page_size: 1.into(),
bill_type: 1,
start_time: "".to_string(),
end_time: "".to_string(),
child_union_id: None,
key: None,
fields: None,
};
let client = JDClient::new("appKey", "secret");
match client.query_raw_order(param).await {
Ok(res) => {}
Err(err) => {}
}
}
Trait Implementations
sourceimpl<T: Clone + SessionStore> Clone for JDClient<T>
Available on crate feature jd only.
impl<T: Clone + SessionStore> Clone for JDClient<T>
jd only.Auto Trait Implementations
impl<T> RefUnwindSafe for JDClient<T> where
T: RefUnwindSafe,
impl<T> Send for JDClient<T> where
T: Send,
impl<T> Sync for JDClient<T> where
T: Sync,
impl<T> Unpin for JDClient<T> where
T: Unpin,
impl<T> UnwindSafe for JDClient<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more