From 905d664a3400b4c626327b9b9724d53698ab3189 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Wed, 2 Mar 2022 03:11:54 +0800 Subject: [PATCH] =?UTF-8?q?1688sdk=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.1688SDK/APIFacade.cs | 39 ++++ BBWY.1688SDK/APIId.cs | 43 ++++ BBWY.1688SDK/GatewayAPIRequest.cs | 23 ++ BBWY.1688SDK/GatewayAPIResponse.cs | 14 ++ BBWY.1688SDK/Request.cs | 66 ++++++ BBWY.1688SDK/Response.cs | 56 +++++ BBWY.1688SDK/SyncAPIClient.cs | 99 ++++++++ BBWY.1688SDK/entity/AuthorizationToken.cs | 159 +++++++++++++ BBWY.1688SDK/entity/ErrorExceptionDesc.cs | 35 +++ .../entity/OrderPreview/CreateOrderPreview.cs | 49 ++++ BBWY.1688SDK/entity/ResponseStatus.cs | 28 +++ BBWY.1688SDK/entity/ResponseWrapper.cs | 40 ++++ BBWY.1688SDK/example/ExampleFacade.cs | 88 ++++++++ .../example/param/apiexample/ExampleCar.cs | 160 +++++++++++++ .../example/param/apiexample/ExampleFamily.cs | 132 +++++++++++ .../param/apiexample/ExampleFamilyGetParam.cs | 41 ++++ .../apiexample/ExampleFamilyGetResult.cs | 37 +++ .../apiexample/ExampleFamilyPostParam.cs | 75 ++++++ .../apiexample/ExampleFamilyPostResult.cs | 56 +++++ .../example/param/apiexample/ExampleHouse.cs | 94 ++++++++ .../example/param/apiexample/ExamplePerson.cs | 99 ++++++++ BBWY.1688SDK/exception/OceanException.cs | 58 +++++ BBWY.1688SDK/http/HttpClient.cs | 213 ++++++++++++++++++ BBWY.1688SDK/policy/ClientPolicy.cs | 70 ++++++ BBWY.1688SDK/policy/GrantType.cs | 17 ++ BBWY.1688SDK/policy/Protocol.cs | 26 +++ BBWY.1688SDK/policy/RequestPolicy.cs | 113 ++++++++++ BBWY.1688SDK/primitive/NullableBool.cs | 36 +++ BBWY.1688SDK/primitive/NullableByte.cs | 36 +++ BBWY.1688SDK/primitive/NullableChar.cs | 36 +++ BBWY.1688SDK/primitive/NullableDateTime.cs | 36 +++ BBWY.1688SDK/primitive/NullableDouble.cs | 36 +++ BBWY.1688SDK/primitive/NullableFloat.cs | 36 +++ BBWY.1688SDK/primitive/NullableInt.cs | 36 +++ BBWY.1688SDK/primitive/NullableLong.cs | 36 +++ .../primitive/NullablePrimitiveObject.cs | 12 + BBWY.1688SDK/serialize/DeSerializer.cs | 21 ++ BBWY.1688SDK/serialize/Json2Deserializer.cs | 56 +++++ .../serialize/Param2RequestSerializer.cs | 109 +++++++++ BBWY.1688SDK/serialize/Serializer.cs | 18 ++ BBWY.1688SDK/serialize/SerializerProvider.cs | 60 +++++ BBWY.1688SDK/util/DateUtil.cs | 66 ++++++ BBWY.1688SDK/util/SignatureUtil.cs | 74 ++++++ .../Controllers/PlatformSDKController.cs | 11 + BBWY.Server.API/Startup.cs | 1 + .../BBWY.Server.Business.csproj | 1 + .../PlatformSDK/JDBusiness.cs | 2 +- .../PlatformSDK/PDDBusiness.cs | 7 +- .../PlatformSDK/PlatformSDKBusiness.cs | 14 +- .../PlatformSDK/TaoBaoBusiness.cs | 7 +- .../PlatformSDK/_1688Business.cs | 85 +++++++ .../OnlinePurchase/CargoParamRequest.cs | 14 ++ .../OnlinePurchase/ConsigneeRequest.cs | 43 ++++ .../OnlinePurchase/PreviewOrderReuqest.cs | 11 + .../OnlinePurchase/PreviewOrderResponse.cs | 20 ++ 55 files changed, 2842 insertions(+), 8 deletions(-) create mode 100644 BBWY.1688SDK/APIFacade.cs create mode 100644 BBWY.1688SDK/APIId.cs create mode 100644 BBWY.1688SDK/GatewayAPIRequest.cs create mode 100644 BBWY.1688SDK/GatewayAPIResponse.cs create mode 100644 BBWY.1688SDK/Request.cs create mode 100644 BBWY.1688SDK/Response.cs create mode 100644 BBWY.1688SDK/SyncAPIClient.cs create mode 100644 BBWY.1688SDK/entity/AuthorizationToken.cs create mode 100644 BBWY.1688SDK/entity/ErrorExceptionDesc.cs create mode 100644 BBWY.1688SDK/entity/OrderPreview/CreateOrderPreview.cs create mode 100644 BBWY.1688SDK/entity/ResponseStatus.cs create mode 100644 BBWY.1688SDK/entity/ResponseWrapper.cs create mode 100644 BBWY.1688SDK/example/ExampleFacade.cs create mode 100644 BBWY.1688SDK/example/param/apiexample/ExampleCar.cs create mode 100644 BBWY.1688SDK/example/param/apiexample/ExampleFamily.cs create mode 100644 BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetParam.cs create mode 100644 BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetResult.cs create mode 100644 BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostParam.cs create mode 100644 BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostResult.cs create mode 100644 BBWY.1688SDK/example/param/apiexample/ExampleHouse.cs create mode 100644 BBWY.1688SDK/example/param/apiexample/ExamplePerson.cs create mode 100644 BBWY.1688SDK/exception/OceanException.cs create mode 100644 BBWY.1688SDK/http/HttpClient.cs create mode 100644 BBWY.1688SDK/policy/ClientPolicy.cs create mode 100644 BBWY.1688SDK/policy/GrantType.cs create mode 100644 BBWY.1688SDK/policy/Protocol.cs create mode 100644 BBWY.1688SDK/policy/RequestPolicy.cs create mode 100644 BBWY.1688SDK/primitive/NullableBool.cs create mode 100644 BBWY.1688SDK/primitive/NullableByte.cs create mode 100644 BBWY.1688SDK/primitive/NullableChar.cs create mode 100644 BBWY.1688SDK/primitive/NullableDateTime.cs create mode 100644 BBWY.1688SDK/primitive/NullableDouble.cs create mode 100644 BBWY.1688SDK/primitive/NullableFloat.cs create mode 100644 BBWY.1688SDK/primitive/NullableInt.cs create mode 100644 BBWY.1688SDK/primitive/NullableLong.cs create mode 100644 BBWY.1688SDK/primitive/NullablePrimitiveObject.cs create mode 100644 BBWY.1688SDK/serialize/DeSerializer.cs create mode 100644 BBWY.1688SDK/serialize/Json2Deserializer.cs create mode 100644 BBWY.1688SDK/serialize/Param2RequestSerializer.cs create mode 100644 BBWY.1688SDK/serialize/Serializer.cs create mode 100644 BBWY.1688SDK/serialize/SerializerProvider.cs create mode 100644 BBWY.1688SDK/util/DateUtil.cs create mode 100644 BBWY.1688SDK/util/SignatureUtil.cs create mode 100644 BBWY.Server.Business/PlatformSDK/_1688Business.cs create mode 100644 BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CargoParamRequest.cs create mode 100644 BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/ConsigneeRequest.cs create mode 100644 BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/PreviewOrderReuqest.cs create mode 100644 BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs diff --git a/BBWY.1688SDK/APIFacade.cs b/BBWY.1688SDK/APIFacade.cs new file mode 100644 index 00000000..24a71cbb --- /dev/null +++ b/BBWY.1688SDK/APIFacade.cs @@ -0,0 +1,39 @@ +using com.alibaba.openapi.client; +using com.alibaba.openapi.client.entity; +using com.alibaba.openapi.client.policy; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetSdkClient.sdk +{ + public class APIFacade + { + private ClientPolicy clientPolicy; + + public APIFacade(ClientPolicy clientPolicy) + { + this.clientPolicy = clientPolicy; + } + + + private SyncAPIClient getAPIClient() + { + return new SyncAPIClient(clientPolicy); + } + + public AuthorizationToken getToken(string code) + { + + return getAPIClient().getToken(code); + + } + + public AuthorizationToken refreshToken(String refreshToken) + { + return getAPIClient().refreshToken(refreshToken); + } + } +} diff --git a/BBWY.1688SDK/APIId.cs b/BBWY.1688SDK/APIId.cs new file mode 100644 index 00000000..0fefda53 --- /dev/null +++ b/BBWY.1688SDK/APIId.cs @@ -0,0 +1,43 @@ +using System; + +namespace com.alibaba.openapi.client +{ + public class APIId + { + public APIId() + { + + } + + public APIId(String namespaceValue,String name, int version) + { + this.NamespaceValue = namespaceValue; + this.Name = name; + this.version = version; + } + + private String namespaceValue; + + public String NamespaceValue + { + get { return namespaceValue; } + set { namespaceValue = value; } + } + private String name; + + public String Name + { + get { return name; } + set { name = value; } + } + private int version; + + public int Version + { + get { return version; } + set { version = value; } + } + + + } +} diff --git a/BBWY.1688SDK/GatewayAPIRequest.cs b/BBWY.1688SDK/GatewayAPIRequest.cs new file mode 100644 index 00000000..8d4508a7 --- /dev/null +++ b/BBWY.1688SDK/GatewayAPIRequest.cs @@ -0,0 +1,23 @@ +using com.alibaba.openapi.client.entity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client +{ + public class GatewayAPIRequest + { + [DataMember(Order = 0)] + private APIId apiId; + + public APIId ApiId + { + get { return apiId; } + set { apiId = value; } + } + + } +} diff --git a/BBWY.1688SDK/GatewayAPIResponse.cs b/BBWY.1688SDK/GatewayAPIResponse.cs new file mode 100644 index 00000000..15a3bfe8 --- /dev/null +++ b/BBWY.1688SDK/GatewayAPIResponse.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client +{ + [DataContract(Namespace = "com.alibaba.openapi.client")] + public class GatewayAPIResponse + { + } +} diff --git a/BBWY.1688SDK/Request.cs b/BBWY.1688SDK/Request.cs new file mode 100644 index 00000000..54835073 --- /dev/null +++ b/BBWY.1688SDK/Request.cs @@ -0,0 +1,66 @@ +using com.alibaba.openapi.client.entity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client +{ + [DataContract(Namespace = "com.alibaba.openapi.client")] + public class Request + { + [DataMember(Order = 0)] + private APIId apiId; + + public APIId ApiId + { + get { return apiId; } + set { apiId = value; } + } + private Dictionary addtionalParams = new Dictionary(); + + public Dictionary AddtionalParams + { + get { return addtionalParams; } + set { addtionalParams = value; } + } + private Object requestEntity; + + public Object RequestEntity + { + get { return requestEntity; } + set { requestEntity = value; } + } + private Dictionary attachments; + + public Dictionary Attachments + { + get { return attachments; } + set { attachments = value; } + } + private String authCodeKey; + + public String AuthCodeKey + { + get { return authCodeKey; } + set { authCodeKey = value; } + } + [DataMember(Order = 1)] + private String accessToken; + + public String AccessToken + { + get { return accessToken; } + set { accessToken = value; } + } + private AuthorizationToken authToken; + + internal AuthorizationToken AuthToken + { + get { return authToken; } + set { authToken = value; } + } + } +} diff --git a/BBWY.1688SDK/Response.cs b/BBWY.1688SDK/Response.cs new file mode 100644 index 00000000..5db43fa6 --- /dev/null +++ b/BBWY.1688SDK/Response.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using com.alibaba.openapi.client.entity; + +namespace com.alibaba.openapi.client +{ + public class Response + { + private int statusCode; + + public int StatusCode + { + get { return statusCode; } + set { statusCode = value; } + } + private Object result; + + public Object Result + { + get { return result; } + set { result = value; } + } + private Exception exception; + + public Exception Exception + { + get { return exception; } + set { exception = value; } + } + private String charset = "UTF-8"; + + public String Charset + { + get { return charset; } + set { charset = value; } + } + private String encoding; + + public String Encoding + { + get { return encoding; } + set { encoding = value; } + } + + private ResponseWrapper responseWrapper; + + internal ResponseWrapper ResponseWrapper + { + get { return responseWrapper; } + set { responseWrapper = value; } + } + } +} diff --git a/BBWY.1688SDK/SyncAPIClient.cs b/BBWY.1688SDK/SyncAPIClient.cs new file mode 100644 index 00000000..b0d73c27 --- /dev/null +++ b/BBWY.1688SDK/SyncAPIClient.cs @@ -0,0 +1,99 @@ +using com.alibaba.openapi.client.entity; +using com.alibaba.openapi.client.http; +using com.alibaba.openapi.client.policy; +using System; + +namespace com.alibaba.openapi.client +{ + public class SyncAPIClient + { + private ClientPolicy clientPolicy; + + public SyncAPIClient(String appKey, String appSecret) + { + this.clientPolicy = new ClientPolicy(); + this.clientPolicy.AppKey = appKey; + this.clientPolicy.SecretKey = appSecret; + } + + public SyncAPIClient(String appKey, String appSecret, String gatewayHost) + { + this.clientPolicy = new ClientPolicy(); + this.clientPolicy.AppKey = appKey; + this.clientPolicy.SecretKey = appSecret; + this.clientPolicy.ServerHost = gatewayHost; + } + + public SyncAPIClient(ClientPolicy clientPolicy) + { + this.clientPolicy = clientPolicy; + } + + public T send(Request request, RequestPolicy policy) + { + HttpClient httpClient = new HttpClient(clientPolicy); + T result = httpClient.request(request, policy); + return result; + } + + public Res execute(GatewayAPIRequest gatewayAPIRequest, String accessToken) + { + HttpClient httpClient = new HttpClient(clientPolicy); + RequestPolicy policy = new RequestPolicy(); + policy.UseHttps = true; + Request request = new Request(); + request.ApiId = gatewayAPIRequest.ApiId; + request.RequestEntity = gatewayAPIRequest; + request.AccessToken = accessToken; + Res result = httpClient.request(request, policy); + return result; + } + + public AuthorizationToken getToken(String code) + { + + APIId apiId = new APIId(); + apiId.Name = "getToken"; + apiId.NamespaceValue = "system.oauth2"; + apiId.Version = 1; + + Request request = new Request(); + request.ApiId = apiId; + + request.AddtionalParams["code"] = code; + request.AddtionalParams["grant_type"] = "authorization_code"; + request.AddtionalParams["need_refresh_token"] = true; + request.AddtionalParams["client_id"] = clientPolicy.AppKey; + request.AddtionalParams["client_secret"] = clientPolicy.SecretKey; + request.AddtionalParams["redirect_uri"] = "default"; + RequestPolicy oauthPolicy = new RequestPolicy(); + oauthPolicy.UseHttps = true; + + return this.send(request, oauthPolicy); + } + + public AuthorizationToken refreshToken(String refreshToken) + { + + APIId apiId = new APIId(); + apiId.Name = "getToken"; + apiId.NamespaceValue = "system.oauth2"; + apiId.Version = 1; + + Request request = new Request(); + request.ApiId = apiId; + + request.AddtionalParams["refreshToken"] = refreshToken; + request.AddtionalParams["grant_type"] = "refresh_token"; + request.AddtionalParams["client_id"] = clientPolicy.AppKey; + request.AddtionalParams["client_secret"] = clientPolicy.SecretKey; + request.AddtionalParams["redirect_uri"] = "default"; + RequestPolicy oauthPolicy = new RequestPolicy(); + oauthPolicy.UseHttps = true; + return this.send(request, oauthPolicy); + + + } + } +} + diff --git a/BBWY.1688SDK/entity/AuthorizationToken.cs b/BBWY.1688SDK/entity/AuthorizationToken.cs new file mode 100644 index 00000000..15163a7b --- /dev/null +++ b/BBWY.1688SDK/entity/AuthorizationToken.cs @@ -0,0 +1,159 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client.entity +{ + [DataContract(Namespace = "com.alibaba.openapi.client")] + public class AuthorizationToken + { + [DataMember(Order = 0)] + private String access_token; + [DataMember(Order = 1)] + private String refresh_token; + [DataMember(Order = 2)] + private long expires_in; + [DataMember(Order = 3)] + private DateTime expires_time; + [DataMember(Order = 4)] + private DateTime refresh_token_timeout; + [DataMember(Order = 5)] + private String resource_owner; + [DataMember(Order = 6)] + private String uid; + [DataMember(Order = 7)] + private long aliId; + [DataMember(Order = 8)] + private String memberId; + + /** + * 获取access_token + * + * @return the accessToken + */ + public String getAccess_token() + { + return access_token; + } + + /** + * 获取access_token过期时间 + * + * @return the accessTokenTimeout + */ + public long getExpires_in() + { + return expires_in; + } + + /** + * 获取refresh_token + * + * @return the refreshToken + */ + public String getRefresh_token() + { + return refresh_token; + } + + /** + * 获取refresh_token过期时间 + * + * @return the refreshTokenTimeout + */ + public DateTime getRefresh_token_timeout() + { + return refresh_token_timeout; + } + + public String getMemberId() + { + return memberId; + } + + public void setMemberId(String memberId) + { + this.memberId = memberId; + } + + /** + * 获取resource_owner + * + * @return the resourceOwnerId + */ + public String getResource_owner() + { + return resource_owner; + } + + /** + * 获取uid + * + * @return the uid + */ + public String getUid() + { + return uid; + } + + /** + * 获取aliId + * + * @return the aliId + */ + public long getAliId() + { + return aliId; + } + + public void setAccess_token(String accessToken) + { + this.access_token = accessToken; + } + + public void setRefresh_token(String refreshToken) + { + this.refresh_token = refreshToken; + } + + public void setExpires_in(long accessTokenTimeout) + { + this.expires_in = accessTokenTimeout; + DateTime now = new DateTime(); + this.expires_time = now.AddSeconds(accessTokenTimeout); + } + + public void setRefresh_token_timeout(DateTime refresh_token_timeout) + { + this.refresh_token_timeout = refresh_token_timeout; + } + + public void setResource_owner(String resourceOwnerId) + { + this.resource_owner = resourceOwnerId; + } + + public void setUid(String uid) + { + this.uid = uid; + } + + public void setAliId(long aliId) + { + this.aliId = aliId; + } + + /** + * 获取access_token过期时间,Date格式 + * + * @return the accessTokenTimeout + */ + public DateTime getExpires_time() + { + return expires_time; + } + } +} diff --git a/BBWY.1688SDK/entity/ErrorExceptionDesc.cs b/BBWY.1688SDK/entity/ErrorExceptionDesc.cs new file mode 100644 index 00000000..62fce097 --- /dev/null +++ b/BBWY.1688SDK/entity/ErrorExceptionDesc.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client.entity +{ + [DataContract(Namespace = "com.alibaba.openapi.client")] + public class ErrorExceptionDesc + { + [DataMember(Order = 0)] + private string error_code; + [DataMember(Order = 1)] + private string error_message; + [DataMember(Order = 2)] + private string exception; + + public string getError_code() + { + return this.error_code; + } + + public string getError_message() + { + return this.error_message; + } + + public string getException() + { + return this.exception; + } + } +} diff --git a/BBWY.1688SDK/entity/OrderPreview/CreateOrderPreview.cs b/BBWY.1688SDK/entity/OrderPreview/CreateOrderPreview.cs new file mode 100644 index 00000000..20533221 --- /dev/null +++ b/BBWY.1688SDK/entity/OrderPreview/CreateOrderPreview.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace BBWY._1688SDK.entity.OrderPreview +{ + [DataContract] + public class CreateOrderPreview + { + [DataMember] + public AddressParam addressParam { get; set; } + [DataMember] + public IList cargoParamList { get; set; } + [DataMember] + public string flow { get; set; } + } + [DataContract] + public class AddressParam + { + [DataMember] + public string fullName { get; set; } + [DataMember] + public string mobile { get; set; } + [DataMember] + public string phone { get; set; } + [DataMember] + public string postCode { get; set; } + [DataMember] + public string address { get; set; } + [DataMember] + public string provinceText { get; set; } + [DataMember] + public string cityText { get; set; } + [DataMember] + public string areaText { get; set; } + [DataMember] + public string townText { get; set; } + + } + [DataContract] + public class CargoParam + { + [DataMember] + public long offerId { get; set; } + [DataMember] + public string specId { get; set; } + [DataMember] + public int quantity { get; set; } + } +} diff --git a/BBWY.1688SDK/entity/ResponseStatus.cs b/BBWY.1688SDK/entity/ResponseStatus.cs new file mode 100644 index 00000000..139a9572 --- /dev/null +++ b/BBWY.1688SDK/entity/ResponseStatus.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client.entity +{ + public class ResponseStatus + { + private String code; + + public String Code + { + get { return code; } + set { code = value; } + } + private String message; + + public String Message + { + get { return message; } + set { message = value; } + } + + + } +} diff --git a/BBWY.1688SDK/entity/ResponseWrapper.cs b/BBWY.1688SDK/entity/ResponseWrapper.cs new file mode 100644 index 00000000..2d9f868a --- /dev/null +++ b/BBWY.1688SDK/entity/ResponseWrapper.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client.entity +{ + public class ResponseWrapper + { + private String invokeStartTime; + + public String InvokeStartTime + { + get { return invokeStartTime; } + set { invokeStartTime = value; } + } + private long invokeCostTime; + + public long InvokeCostTime + { + get { return invokeCostTime; } + set { invokeCostTime = value; } + } + private ResponseStatus status; + + internal ResponseStatus Status + { + get { return status; } + set { status = value; } + } + private Object result; + + public Object Result + { + get { return result; } + set { result = value; } + } + } +} diff --git a/BBWY.1688SDK/example/ExampleFacade.cs b/BBWY.1688SDK/example/ExampleFacade.cs new file mode 100644 index 00000000..7cce8ab5 --- /dev/null +++ b/BBWY.1688SDK/example/ExampleFacade.cs @@ -0,0 +1,88 @@ +using com.alibaba.openapi.client; +using com.alibaba.openapi.client.entity; +using com.alibaba.openapi.client.policy; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using com.alibaba.china.openapi.client.example.param.apiexample; + +namespace com.alibaba.china.openapi.client.example +{ + + public class ExampleFacade + { + private ClientPolicy clientPolicy; + + public ExampleFacade(ClientPolicy clientPolicy) + { + this.clientPolicy = clientPolicy; + } + + private SyncAPIClient getAPIClient() + { + return new SyncAPIClient(clientPolicy); + } + + public AuthorizationToken getToken(string code) + { + + return getAPIClient().getToken(code); + + } + + public AuthorizationToken refreshToken(String refreshToken) + { + return getAPIClient().refreshToken(refreshToken); + } + + + + + public ExampleFamilyGetResult exampleFamilyGet(ExampleFamilyGetParam param) { + RequestPolicy reqPolicy = new RequestPolicy(); + reqPolicy.HttpMethod="POST"; + reqPolicy.NeedAuthorization=false; + reqPolicy.RequestSendTimestamp=false; + reqPolicy.UseHttps=false; + reqPolicy.UseSignture=false; + reqPolicy.AccessPrivateApi=false; + + Request request = new Request (); + APIId apiId = new APIId(); + apiId.Name = "example.family.get"; + apiId.NamespaceValue = "api.example"; + apiId.Version = 1; + request.ApiId = apiId; + + request.RequestEntity=param; + + return this.getAPIClient().send(request, reqPolicy); + } + + + + public ExampleFamilyPostResult exampleFamilyPost(ExampleFamilyPostParam param, string accessToken) { + RequestPolicy reqPolicy = new RequestPolicy(); + reqPolicy.HttpMethod="POST"; + reqPolicy.NeedAuthorization=false; + reqPolicy.RequestSendTimestamp=false; + reqPolicy.UseHttps=false; + reqPolicy.UseSignture=true; + reqPolicy.AccessPrivateApi=false; + + Request request = new Request (); + APIId apiId = new APIId(); + apiId.Name = "example.family.post"; + apiId.NamespaceValue = "api.example"; + apiId.Version = 1; + request.ApiId = apiId; + + request.RequestEntity=param; + request.AccessToken=accessToken; + return this.getAPIClient().send(request, reqPolicy); + } + } +} \ No newline at end of file diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleCar.cs b/BBWY.1688SDK/example/param/apiexample/ExampleCar.cs new file mode 100644 index 00000000..4b9fe3b4 --- /dev/null +++ b/BBWY.1688SDK/example/param/apiexample/ExampleCar.cs @@ -0,0 +1,160 @@ +using com.alibaba.openapi.client.primitive; +using com.alibaba.openapi.client.util; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; + + +namespace com.alibaba.china.openapi.client.example.param.apiexample +{ +[DataContract(Namespace = "com.alibaba.openapi.client")] +public class ExampleCar { + + [DataMember(Order = 1)] + private string builtDate; + + /** + * @return + */ + public DateTime? getBuiltDate() { + if (builtDate != null) + { + DateTime datetime = DateUtil.formatFromStr(builtDate); + return datetime; + } + return null; + } + + /** + * 设置 * + * 参数示例:
     
+             * 此参数必填
+          */
+    public void setBuiltDate(DateTime builtDate) {
+     	         	    this.builtDate = DateUtil.format(builtDate);
+     	        }
+    
+        [DataMember(Order = 2)]
+    private string boughtDate;
+    
+        /**
+       * @return 
+    */
+        public DateTime? getBoughtDate() {
+                 if (boughtDate != null)
+          {
+              DateTime datetime = DateUtil.formatFromStr(boughtDate);
+              return datetime;
+          }
+    	  return null;
+    	    }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setBoughtDate(DateTime boughtDate) {
+     	         	    this.boughtDate = DateUtil.format(boughtDate);
+     	        }
+    
+        [DataMember(Order = 3)]
+    private string name;
+    
+        /**
+       * @return 
+    */
+        public string getName() {
+               	return name;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setName(string name) {
+     	         	    this.name = name;
+     	        }
+    
+        [DataMember(Order = 4)]
+    private string builtArea;
+    
+        /**
+       * @return 
+    */
+        public string getBuiltArea() {
+               	return builtArea;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setBuiltArea(string builtArea) {
+     	         	    this.builtArea = builtArea;
+     	        }
+    
+        [DataMember(Order = 5)]
+    private string carNumber;
+    
+        /**
+       * @return 
+    */
+        public string getCarNumber() {
+               	return carNumber;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setCarNumber(string carNumber) {
+     	         	    this.carNumber = carNumber;
+     	        }
+    
+        [DataMember(Order = 6)]
+    private double? price;
+    
+        /**
+       * @return 
+    */
+        public double? getPrice() {
+               	return price;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setPrice(double price) {
+     	         	    this.price = price;
+     	        }
+    
+        [DataMember(Order = 7)]
+    private int? seats;
+    
+        /**
+       * @return 
+    */
+        public int? getSeats() {
+               	return seats;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setSeats(int seats) {
+     	         	    this.seats = seats;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleFamily.cs b/BBWY.1688SDK/example/param/apiexample/ExampleFamily.cs
new file mode 100644
index 00000000..8bcf2c54
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleFamily.cs
@@ -0,0 +1,132 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleFamily
+    {
+
+       [DataMember(Order = 1)]
+    private int? familyNumber;
+    
+        /**
+       * @return 家庭编号
+    */
+        public int? getFamilyNumber() {
+               	return familyNumber;
+            }
+    
+    /**
+     * 设置家庭编号     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setFamilyNumber(int familyNumber) {
+     	         	    this.familyNumber = familyNumber;
+     	        }
+    
+        [DataMember(Order = 2)]
+    private ExamplePerson father;
+    
+        /**
+       * @return 父亲对象,可以为空
+    */
+        public ExamplePerson getFather() {
+               	return father;
+            }
+    
+    /**
+     * 设置父亲对象,可以为空     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setFather(ExamplePerson father) {
+     	         	    this.father = father;
+     	        }
+    
+        [DataMember(Order = 3)]
+    private ExamplePerson mother;
+    
+        /**
+       * @return 母亲对象,可以为空
+    */
+        public ExamplePerson getMother() {
+               	return mother;
+            }
+    
+    /**
+     * 设置母亲对象,可以为空     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setMother(ExamplePerson mother) {
+     	         	    this.mother = mother;
+     	        }
+    
+        [DataMember(Order = 4)]
+    private ExamplePerson[] children;
+    
+        /**
+       * @return 孩子列表
+    */
+        public ExamplePerson[] getChildren() {
+               	return children;
+            }
+    
+    /**
+     * 设置孩子列表     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setChildren(ExamplePerson[] children) {
+     	         	    this.children = children;
+     	        }
+    
+        [DataMember(Order = 5)]
+    private ExampleCar[] ownedCars;
+    
+        /**
+       * @return 拥有的汽车信息
+    */
+        public ExampleCar[] getOwnedCars() {
+               	return ownedCars;
+            }
+    
+    /**
+     * 设置拥有的汽车信息     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setOwnedCars(ExampleCar[] ownedCars) {
+     	         	    this.ownedCars = ownedCars;
+     	        }
+    
+        [DataMember(Order = 6)]
+    private ExampleHouse myHouse;
+    
+        /**
+       * @return 所住的房屋信息
+    */
+        public ExampleHouse getMyHouse() {
+               	return myHouse;
+            }
+    
+    /**
+     * 设置所住的房屋信息     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setMyHouse(ExampleHouse myHouse) {
+     	         	    this.myHouse = myHouse;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetParam.cs b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetParam.cs
new file mode 100644
index 00000000..f2318237
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetParam.cs
@@ -0,0 +1,41 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using com.alibaba.openapi.client;
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleFamilyGetParam : GatewayAPIRequest
+    {
+    public ExampleFamilyGetParam()
+    {
+        this.ApiId = new APIId("api.example", "example.family.get",1);
+    }
+
+    [DataMember(Order = 1)]
+    private int? familyNumber;
+    
+    /**
+       * @return 可接受参数1或者2,其余参数无法找到family对象
+    */
+    public int? getFamilyNumber() {
+        return familyNumber;
+    }
+    
+    /**
+     * 设置可接受参数1或者2,其余参数无法找到family对象     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setFamilyNumber(int familyNumber) {
+     	 this.familyNumber = familyNumber;
+    }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetResult.cs b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetResult.cs
new file mode 100644
index 00000000..36d53bab
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetResult.cs
@@ -0,0 +1,37 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using com.alibaba.openapi.client;
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleFamilyGetResult : GatewayAPIResponse
+    {
+
+       [DataMember(Order = 1)]
+    private ExampleFamily result;
+    
+        /**
+       * @return 
+    */
+        public ExampleFamily getResult() {
+               	return result;
+            }
+    
+    /**
+     * 设置     *
+          
+             * 此参数必填
+          */
+    public void setResult(ExampleFamily result) {
+     	         	    this.result = result;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostParam.cs b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostParam.cs
new file mode 100644
index 00000000..355cd1e1
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostParam.cs
@@ -0,0 +1,75 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleFamilyPostParam
+    {
+
+       [DataMember(Order = 1)]
+    private ExampleFamily family;
+    
+        /**
+       * @return 上传Family对象信息
+    */
+        public ExampleFamily getFamily() {
+               	return family;
+            }
+    
+    /**
+     * 设置上传Family对象信息     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setFamily(ExampleFamily family) {
+     	         	    this.family = family;
+     	        }
+    
+        [DataMember(Order = 2)]
+    private string comments;
+    
+        /**
+       * @return 备注信息
+    */
+        public string getComments() {
+               	return comments;
+            }
+    
+    /**
+     * 设置备注信息     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setComments(string comments) {
+     	         	    this.comments = comments;
+     	        }
+    
+        [DataMember(Order = 3)]
+    private byte[] houseImg;
+    
+        /**
+       * @return 房屋信息
+    */
+        public byte[] getHouseImg() {
+               	return houseImg;
+            }
+    
+    /**
+     * 设置房屋信息     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setHouseImg(byte[] houseImg) {
+     	         	    this.houseImg = houseImg;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostResult.cs b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostResult.cs
new file mode 100644
index 00000000..7ef81163
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostResult.cs
@@ -0,0 +1,56 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleFamilyPostResult
+    {
+
+       [DataMember(Order = 1)]
+    private ExampleFamily result;
+    
+        /**
+       * @return 返回的接听信息
+    */
+        public ExampleFamily getResult() {
+               	return result;
+            }
+    
+    /**
+     * 设置返回的接听信息     *
+          
+             * 此参数必填
+          */
+    public void setResult(ExampleFamily result) {
+     	         	    this.result = result;
+     	        }
+    
+        [DataMember(Order = 2)]
+    private string resultDesc;
+    
+        /**
+       * @return 返回结果描述
+    */
+        public string getResultDesc() {
+               	return resultDesc;
+            }
+    
+    /**
+     * 设置返回结果描述     *
+          
+             * 此参数必填
+          */
+    public void setResultDesc(string resultDesc) {
+     	         	    this.resultDesc = resultDesc;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleHouse.cs b/BBWY.1688SDK/example/param/apiexample/ExampleHouse.cs
new file mode 100644
index 00000000..d865cd9b
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleHouse.cs
@@ -0,0 +1,94 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleHouse
+    {
+
+       [DataMember(Order = 1)]
+    private string location;
+    
+        /**
+       * @return 
+    */
+        public string getLocation() {
+               	return location;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setLocation(string location) {
+     	         	    this.location = location;
+     	        }
+    
+        [DataMember(Order = 2)]
+    private int? areaSize;
+    
+        /**
+       * @return 
+    */
+        public int? getAreaSize() {
+               	return areaSize;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setAreaSize(int areaSize) {
+     	         	    this.areaSize = areaSize;
+     	        }
+    
+        [DataMember(Order = 3)]
+    private bool? rent;
+    
+        /**
+       * @return 
+    */
+        public bool? getRent() {
+               	return rent;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setRent(bool rent) {
+     	         	    this.rent = rent;
+     	        }
+    
+        [DataMember(Order = 4)]
+    private int? rooms;
+    
+        /**
+       * @return 
+    */
+        public int? getRooms() {
+               	return rooms;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setRooms(int rooms) {
+     	         	    this.rooms = rooms;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExamplePerson.cs b/BBWY.1688SDK/example/param/apiexample/ExamplePerson.cs
new file mode 100644
index 00000000..636baff1
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExamplePerson.cs
@@ -0,0 +1,99 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExamplePerson
+    {
+
+       [DataMember(Order = 1)]
+    private string name;
+    
+        /**
+       * @return 
+    */
+        public string getName() {
+               	return name;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setName(string name) {
+     	         	    this.name = name;
+     	        }
+    
+        [DataMember(Order = 2)]
+    private int? age;
+    
+        /**
+       * @return 
+    */
+        public int? getAge() {
+               	return age;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setAge(int age) {
+     	         	    this.age = age;
+     	        }
+    
+        [DataMember(Order = 3)]
+    private string birthday;
+    
+        /**
+       * @return 
+    */
+        public DateTime? getBirthday() {
+                 if (birthday != null)
+          {
+              DateTime datetime = DateUtil.formatFromStr(birthday);
+              return datetime;
+          }
+    	  return null;
+    	    }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setBirthday(DateTime birthday) {
+     	         	    this.birthday = DateUtil.format(birthday);
+     	        }
+    
+        [DataMember(Order = 4)]
+    private string mobileNumber;
+    
+        /**
+       * @return 
+    */
+        public string getMobileNumber() {
+               	return mobileNumber;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setMobileNumber(string mobileNumber) {
+     	         	    this.mobileNumber = mobileNumber;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/exception/OceanException.cs b/BBWY.1688SDK/exception/OceanException.cs
new file mode 100644
index 00000000..fcf0d9a3
--- /dev/null
+++ b/BBWY.1688SDK/exception/OceanException.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.exception
+{
+    public class OceanException : Exception
+    {
+        public OceanException(string mess)
+            : base(mess)
+        {
+            
+        }
+         public OceanException()
+        {
+
+        }
+        private string error_code;
+
+        private string error_message;
+
+        private string exception;
+
+        public string getError_code()
+        {
+            return this.error_code;
+        }
+
+        public void setError_code(string error_code)
+        {
+            this.error_code = error_code;
+        }
+
+        public string getError_message()
+        {
+            return this.error_message;
+        }
+
+        public void setError_message(string error_message)
+        {
+            this.error_message = error_message;
+        }
+
+        public string getException()
+        {
+            return this.exception;
+        }
+
+        public void setException(String exception)
+        {
+            this.exception = exception;
+        }
+
+    }
+}
diff --git a/BBWY.1688SDK/http/HttpClient.cs b/BBWY.1688SDK/http/HttpClient.cs
new file mode 100644
index 00000000..e6e7971c
--- /dev/null
+++ b/BBWY.1688SDK/http/HttpClient.cs
@@ -0,0 +1,213 @@
+using com.alibaba.openapi.client.policy;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+using System.Runtime.Serialization.Json;
+using System.IO;
+using com.alibaba.openapi.client.serialize;
+using com.alibaba.openapi.client.entity;
+using System.Collections;
+using System.Web;
+
+namespace com.alibaba.openapi.client.http
+{
+    public class HttpClient
+    {
+        private ClientPolicy clientPolicy;
+
+        public HttpClient(ClientPolicy clientPolicy)
+        {
+            this.clientPolicy = clientPolicy;
+        }
+
+        public T request(Request request, RequestPolicy requestPolicy)
+        {
+            StringBuilder path = createProtocolRequestPath(requestPolicy, request);
+            Dictionary parameters = createParameterDictionary(requestPolicy, request);
+            StringBuilder queryBuilder = new StringBuilder();
+            signature(path.ToString(), parameters, requestPolicy, clientPolicy);
+            if ("GET".Equals(requestPolicy.HttpMethod))
+            {
+
+                String queryString = createParameterStr(parameters);
+                String uriStr = buildRequestUri(requestPolicy, request);
+                uriStr = uriStr + "?" + queryString;
+                Uri uri = new Uri(uriStr);
+                HttpWebRequest httpWebRequest = WebRequest.Create(uri) as HttpWebRequest;
+
+                httpWebRequest.Method = "GET";
+                httpWebRequest.KeepAlive = false;
+                httpWebRequest.AllowAutoRedirect = true;
+                httpWebRequest.ContentType = "application/x-www-form-urlencoded";
+                httpWebRequest.UserAgent = "Ocean/NET-SDKClient";
+
+                HttpWebResponse response = httpWebRequest.GetResponse() as HttpWebResponse;
+                Stream responseStream = response.GetResponseStream();
+
+                DeSerializer deSerializer = SerializerProvider.getInstance().getDeSerializer(requestPolicy.ResponseProtocol);
+                ResponseWrapper rw = deSerializer.deSerialize(responseStream, typeof(T), Encoding.UTF8.EncodingName);
+                return (T)rw.Result;
+            }
+            else
+            {
+                String postString = createParameterStr(parameters);
+                byte[] postData = Encoding.UTF8.GetBytes(postString);
+                String uriStr = buildRequestUri(requestPolicy, request);
+                Uri uri = new Uri(uriStr);
+                HttpWebRequest httpWebRequest = WebRequest.Create(uri) as HttpWebRequest;
+
+                httpWebRequest.Method = "POST";
+                httpWebRequest.KeepAlive = false;
+                httpWebRequest.AllowAutoRedirect = true;
+                httpWebRequest.ContentType = "application/x-www-form-urlencoded";
+                httpWebRequest.UserAgent = "Ocean/NET-SDKClient";
+                httpWebRequest.ContentLength = postData.Length;
+
+                System.IO.Stream outputStream = httpWebRequest.GetRequestStream();
+                outputStream.Write(postData, 0, postData.Length);
+                outputStream.Close();
+                try
+                {
+                    HttpWebResponse response = httpWebRequest.GetResponse() as HttpWebResponse;
+                    Stream responseStream = response.GetResponseStream();
+
+                    
+                    DeSerializer deSerializer = SerializerProvider.getInstance().getDeSerializer(requestPolicy.ResponseProtocol);
+                    ResponseWrapper rw = deSerializer.deSerialize(responseStream, typeof(T), Encoding.UTF8.EncodingName);
+                    return (T)rw.Result;
+                }
+                catch (System.Net.WebException webException)
+                {
+                    HttpWebResponse response = webException.Response as HttpWebResponse;
+                    Stream responseStream = response.GetResponseStream();
+                    DeSerializer deSerializer = SerializerProvider.getInstance().getDeSerializer(requestPolicy.ResponseProtocol);
+                    Exception rw = deSerializer.buildException(responseStream,500, Encoding.UTF8.EncodingName);
+                    throw rw;
+                }
+            }
+        }
+
+        private String buildRequestUri(RequestPolicy requestPolicy, Request request)
+        {
+            String schema = "http";
+            int port = clientPolicy.HttpPort;
+            if (requestPolicy.UseHttps)
+            {
+                schema = "https";
+                port = clientPolicy.HttpsPort;
+            }
+            StringBuilder relativeBuilder = new StringBuilder(schema);
+            relativeBuilder.Append("://");
+            relativeBuilder.Append(clientPolicy.ServerHost);
+            if (port != 80 && port != 443)
+            {
+                relativeBuilder.Append(":");
+                relativeBuilder.Append(port);
+            }
+
+            if (requestPolicy.AccessPrivateApi)
+            {
+                relativeBuilder.Append("/api");
+            }
+            else
+            {
+                relativeBuilder.Append("/openapi");
+            }
+
+            relativeBuilder.Append("/");
+            relativeBuilder.Append(createProtocolRequestPath(requestPolicy, request));
+            return relativeBuilder.ToString();
+        }
+
+        private StringBuilder createProtocolRequestPath(RequestPolicy requestPolicy, Request request)
+        {
+
+            StringBuilder relativeBuilder = new StringBuilder();
+
+            relativeBuilder.Append(requestPolicy.RequestProtocol);
+            relativeBuilder.Append("/").Append(request.ApiId.Version);
+            relativeBuilder.Append("/").Append(request.ApiId.NamespaceValue);
+            relativeBuilder.Append("/").Append(request.ApiId.Name);
+            relativeBuilder.Append("/").Append(clientPolicy.AppKey);
+            return relativeBuilder;
+
+        }
+
+        private String createParameterStr(Dictionary parameters)
+        {
+            StringBuilder paramBuilder = new StringBuilder();
+            foreach (KeyValuePair kvp in parameters)
+            {
+                String encodedValue = null;
+                if (kvp.Value != null)
+                {
+                    String tempValue = kvp.Value.ToString();
+                    byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(tempValue);
+                    encodedValue = HttpUtility.UrlEncode(byteArray, 0, byteArray.Length);   
+                }
+                paramBuilder.Append(kvp.Key).Append("=").Append(encodedValue);
+                paramBuilder.Append("&");
+            }
+            return paramBuilder.ToString();
+        }
+
+        private Dictionary createParameterDictionary(RequestPolicy requestPolicy, Request request)
+        {
+
+            Serializer serializer = SerializerProvider.getInstance().getSerializer(requestPolicy.RequestProtocol);
+
+            Dictionary parameters = serializer.serialize(request.RequestEntity);
+            if (!requestPolicy.RequestProtocol.Equals(requestPolicy.ResponseProtocol))
+            {
+                parameters.Add("_aop_responseFormat", requestPolicy.ResponseProtocol);
+            }
+            if (requestPolicy.RequestSendTimestamp)
+            {
+                parameters.Add("_aop_timestamp", DateUtil.currentTimeMillis());
+            }
+            parameters.Add("_aop_datePattern", DateUtil.getDatePattern());
+            foreach (KeyValuePair kvp in request.AddtionalParams)
+            {
+                parameters.Add(kvp.Key, kvp.Value);
+            }
+            if (request.AccessToken != null)
+            {
+                parameters.Add("access_token", request.AccessToken);
+            }
+            return parameters;
+        }
+
+        private void signature(String path, Dictionary parameters, RequestPolicy requestPolicy, ClientPolicy clientPolicy)
+        {
+            if (!requestPolicy.UseSignture)
+            {
+                return;
+            }
+            if (clientPolicy.AppKey == null
+                    || clientPolicy.SecretKey == null)
+            {
+                return;
+            }
+            byte[] sign = SignatureUtil.hmacSha1(path, parameters, clientPolicy.SecretKey);
+            String signStr = SignatureUtil.toHex(sign);
+            if (signStr != null)
+            {
+                parameters.Add("_aop_signature", signStr);
+            }
+        }
+
+
+        private WebClient createWebClient()
+        {
+
+            WebClient client = new WebClient();
+            client.Headers.Add("user-agent", "Ocean/SDK Client");
+
+            return client;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/policy/ClientPolicy.cs b/BBWY.1688SDK/policy/ClientPolicy.cs
new file mode 100644
index 00000000..15a98f55
--- /dev/null
+++ b/BBWY.1688SDK/policy/ClientPolicy.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.policy
+{
+    public class ClientPolicy
+    {
+        private string serverHost = "gw.open.1688.com";
+
+        public string ServerHost
+        {
+            get { return serverHost; }
+            set { serverHost = value; }
+        }
+        private int httpPort = 80;
+
+        public int HttpPort
+        {
+            get { return httpPort; }
+            set { httpPort = value; }
+        }
+        private int httpsPort = 443;
+
+        public int HttpsPort
+        {
+            get { return httpsPort; }
+            set { httpsPort = value; }
+        }
+        private string appKey;
+
+        public string AppKey
+        {
+            get { return appKey; }
+            set { appKey = value; }
+        }
+        private string secretKey;
+
+        public string SecretKey
+        {
+            get { return secretKey; }
+            set { secretKey = value; }
+        }
+        private int defaultTimeout = 5000;
+
+        public int DefaultTimeout
+        {
+            get { return defaultTimeout; }
+            set { defaultTimeout = value; }
+        }
+        private string defaultContentCharset = "UTF-8";
+
+        public string DefaultContentCharset
+        {
+            get { return defaultContentCharset; }
+            set { defaultContentCharset = value; }
+        }
+        private bool defaultUseHttps = true;
+
+        public bool DefaultUseHttps
+        {
+            get { return defaultUseHttps; }
+            set { defaultUseHttps = value; }
+        }
+
+
+    }
+}
diff --git a/BBWY.1688SDK/policy/GrantType.cs b/BBWY.1688SDK/policy/GrantType.cs
new file mode 100644
index 00000000..4f4e0397
--- /dev/null
+++ b/BBWY.1688SDK/policy/GrantType.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.policy
+{
+    public class GrantType
+    {
+       public  const string  refresh_token="refresh_token";
+        /**
+         * 请求参数通过json串的方式传递,默认格式_data_={"key":"value"}
+         */
+       public  const string get_token = "get_token";
+    }
+}
diff --git a/BBWY.1688SDK/policy/Protocol.cs b/BBWY.1688SDK/policy/Protocol.cs
new file mode 100644
index 00000000..3b7a5a4c
--- /dev/null
+++ b/BBWY.1688SDK/policy/Protocol.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.policy
+{
+    public class Protocol
+    {
+        public  const string param2 = "param2";
+        /**
+         * 请求参数通过json串的方式传递,默认格式_data_={"key":"value"}
+         */
+        public  const string json2 = "json2";
+        /**
+         * 
+         * 请求参数通过xml的方式传递,默认格式_data_=<test>data</test>
+         */
+        public  const string xml2 = "xml2";
+        public  const string param = "param";
+        public  const string json = "json";
+        public  const string xml = "xml";
+        public  const string http = "http";
+    }
+}
diff --git a/BBWY.1688SDK/policy/RequestPolicy.cs b/BBWY.1688SDK/policy/RequestPolicy.cs
new file mode 100644
index 00000000..762226e7
--- /dev/null
+++ b/BBWY.1688SDK/policy/RequestPolicy.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.policy
+{
+    public class RequestPolicy
+    {
+        private bool requestSendTimestamp = false;
+
+        public bool RequestSendTimestamp
+        {
+            get { return requestSendTimestamp; }
+            set { requestSendTimestamp = value; }
+        }
+        private bool useHttps = false;
+
+        public bool UseHttps
+        {
+            get { return useHttps; }
+            set { useHttps = value; }
+        }
+        private string requestProtocol = Protocol.param2;
+
+        internal string RequestProtocol
+        {
+            get { return requestProtocol; }
+            set { requestProtocol = value; }
+        }
+        private string responseProtocol = Protocol.json2;
+
+        internal string ResponseProtocol
+        {
+            get { return responseProtocol; }
+            set { responseProtocol = value; }
+        }
+        private bool responseCompress = true;
+
+        public bool ResponseCompress
+        {
+            get { return responseCompress; }
+            set { responseCompress = value; }
+        }
+        private int requestCompressThreshold = -1;
+
+        public int RequestCompressThreshold
+        {
+            get { return requestCompressThreshold; }
+            set { requestCompressThreshold = value; }
+        }
+        private int timeout = 5000;
+
+        public int Timeout
+        {
+            get { return timeout; }
+            set { timeout = value; }
+        }
+        private string httpMethod = "POST";
+
+        public string HttpMethod
+        {
+            get { return httpMethod; }
+            set { httpMethod = value; }
+        }
+        private String queryStringCharset = "GB18030";
+
+        public String QueryStringCharset
+        {
+            get { return queryStringCharset; }
+            set { queryStringCharset = value; }
+        }
+        private String contentCharset = "UTF-8";
+
+        public String ContentCharset
+        {
+            get { return contentCharset; }
+            set { contentCharset = value; }
+        }
+        private bool useSignture = true;
+
+        public bool UseSignture
+        {
+            get { return useSignture; }
+            set { useSignture = value; }
+        }
+        private bool needAuthorization = false;
+
+        public bool NeedAuthorization
+        {
+            get { return needAuthorization; }
+            set { needAuthorization = value; }
+        }
+        private bool accessPrivateApi = false;
+
+        public bool AccessPrivateApi
+        {
+            get { return accessPrivateApi; }
+            set { accessPrivateApi = value; }
+        }
+        private int defaultApiVersion = 1;
+
+        public int DefaultApiVersion
+        {
+            get { return defaultApiVersion; }
+            set { defaultApiVersion = value; }
+        }
+
+
+
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableBool.cs b/BBWY.1688SDK/primitive/NullableBool.cs
new file mode 100644
index 00000000..63caafdb
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableBool.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableBool : NullablePrimitiveObject
+    {
+        public NullableBool(bool value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        bool value;
+        private Boolean isNull = true;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(bool value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public bool getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableByte.cs b/BBWY.1688SDK/primitive/NullableByte.cs
new file mode 100644
index 00000000..4d73775d
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableByte.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableByte : NullablePrimitiveObject
+    {
+        public NullableByte(byte value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        byte value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(byte value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public byte getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableChar.cs b/BBWY.1688SDK/primitive/NullableChar.cs
new file mode 100644
index 00000000..f7375045
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableChar.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableChar : NullablePrimitiveObject
+    {
+        public NullableChar(char value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        char value;
+        private Boolean isNull = true;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(char value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public char getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableDateTime.cs b/BBWY.1688SDK/primitive/NullableDateTime.cs
new file mode 100644
index 00000000..1b621c05
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableDateTime.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableDateTime : NullablePrimitiveObject
+    {
+        public NullableDateTime(DateTime value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        DateTime value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(DateTime value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public DateTime getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableDouble.cs b/BBWY.1688SDK/primitive/NullableDouble.cs
new file mode 100644
index 00000000..2bd5c3cf
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableDouble.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableDouble : NullablePrimitiveObject
+    {
+        public NullableDouble(double value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        double value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(double value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public double getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableFloat.cs b/BBWY.1688SDK/primitive/NullableFloat.cs
new file mode 100644
index 00000000..8a294cf3
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableFloat.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableFloat : NullablePrimitiveObject
+    {
+        public NullableFloat(float value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        float value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(float value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public float getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableInt.cs b/BBWY.1688SDK/primitive/NullableInt.cs
new file mode 100644
index 00000000..a9fd6def
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableInt.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableInt : NullablePrimitiveObject
+    {
+        public NullableInt(int value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        int value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(int value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public int getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableLong.cs b/BBWY.1688SDK/primitive/NullableLong.cs
new file mode 100644
index 00000000..1dfd55ac
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableLong.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableLong : NullablePrimitiveObject
+    {
+        public NullableLong(long value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        long value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(long value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public long getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullablePrimitiveObject.cs b/BBWY.1688SDK/primitive/NullablePrimitiveObject.cs
new file mode 100644
index 00000000..e9a4ef41
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullablePrimitiveObject.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullablePrimitiveObject
+    {
+    }
+}
diff --git a/BBWY.1688SDK/serialize/DeSerializer.cs b/BBWY.1688SDK/serialize/DeSerializer.cs
new file mode 100644
index 00000000..332ed39f
--- /dev/null
+++ b/BBWY.1688SDK/serialize/DeSerializer.cs
@@ -0,0 +1,21 @@
+using com.alibaba.openapi.client.entity;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.serialize
+{
+    public interface DeSerializer
+    {
+        //返回该反序列化接口支持的数据协议.
+         String supportedContentType();
+
+         ResponseWrapper deSerialize(Stream istream, Type resultType, String charSet);
+
+         Exception buildException(Stream inputStream, int statusCode, String charSet);
+
+    }
+}
diff --git a/BBWY.1688SDK/serialize/Json2Deserializer.cs b/BBWY.1688SDK/serialize/Json2Deserializer.cs
new file mode 100644
index 00000000..79b9dbe5
--- /dev/null
+++ b/BBWY.1688SDK/serialize/Json2Deserializer.cs
@@ -0,0 +1,56 @@
+using com.alibaba.openapi.client.entity;
+using com.alibaba.openapi.client.exception;
+using com.alibaba.openapi.client.policy;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.Serialization.Json;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.serialize
+{
+    public class Json2Deserializer : DeSerializer
+    {
+        //返回该反序列化接口支持的数据协议.
+        public String supportedContentType()
+        {
+            return Protocol.json2;
+        }
+
+        public ResponseWrapper deSerialize(Stream istream, Type resultType, String charSet)
+        {
+            StreamReader sr = new StreamReader(istream, Encoding.UTF8);
+            string strhtml = sr.ReadToEnd();
+            using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(strhtml)))
+            {
+                DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(resultType);
+                object result = jsonSerializer.ReadObject(ms);
+                ResponseWrapper responseWrapper = new ResponseWrapper();
+                responseWrapper.Result = result;
+
+                return responseWrapper;
+            }
+        }
+
+        public Exception buildException(Stream istream, int statusCode, String charSet)
+        {
+
+
+            istream.Position = 0;
+            DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(ErrorExceptionDesc));
+            object resultObj = jsonSerializer.ReadObject(istream);
+            ErrorExceptionDesc result = (ErrorExceptionDesc)resultObj;
+            String errorCodeStr = result.getError_code();
+            String errorMesage = result.getError_message();
+
+            OceanException oceanException = new OceanException(errorMesage);
+            oceanException.setError_code(errorCodeStr);
+            oceanException.setError_message(errorMesage);
+            return oceanException;
+
+
+        }
+    }
+}
diff --git a/BBWY.1688SDK/serialize/Param2RequestSerializer.cs b/BBWY.1688SDK/serialize/Param2RequestSerializer.cs
new file mode 100644
index 00000000..2812bdc8
--- /dev/null
+++ b/BBWY.1688SDK/serialize/Param2RequestSerializer.cs
@@ -0,0 +1,109 @@
+using com.alibaba.openapi.client.policy;
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.Serialization.Json;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.serialize
+{
+    public class Param2RequestSerializer : Serializer
+    {
+        public String supportedContentType()
+        {
+            return Protocol.param2;
+        }
+
+        public Dictionary serialize(Object serializer)
+        {
+            Dictionary result = serializeNest(serializer);
+            return result;
+        }
+
+        private Dictionary serializeNest(Object serializer)
+        {
+            Dictionary result = new Dictionary();
+            if (serializer == null)
+            {
+                return result;
+            }
+            Type type = serializer.GetType();
+
+            IEnumerable fis = type.GetRuntimeFields();
+            TextInfo tInfo = Thread.CurrentThread.CurrentCulture.TextInfo;
+
+            foreach (FieldInfo fi in fis)
+            {
+                Type fieldType = fi.FieldType;
+
+                String piName = fi.Name;
+                String firstCharacter = piName.Substring(0, 1);
+                String upperFirstCharacter = firstCharacter.ToUpper(Thread.CurrentThread.CurrentCulture);
+                String tempName = upperFirstCharacter + piName.Substring(1);
+                if (!"ApiId".Equals(tempName))
+                {
+                MethodInfo mi = type.GetMethod("get" + tempName);
+                object value = mi.Invoke(serializer, null);
+                if (value != null)
+                {
+                    object trueValue = null;
+                    if (fieldType.IsAssignableFrom(typeof(bool?))
+                        ||fieldType.IsAssignableFrom(typeof(byte?))
+                        ||fieldType.IsAssignableFrom(typeof(char?))
+                        ||fieldType.IsAssignableFrom(typeof(double?))
+                        ||fieldType.IsAssignableFrom(typeof(float?))
+                        ||fieldType.IsAssignableFrom(typeof(int?))
+                        ||fieldType.IsAssignableFrom(typeof(long?)))
+                    {
+                        trueValue = value;
+                    }
+                    else if (fieldType.IsAssignableFrom(typeof(String)))
+                    {
+                        if (value.GetType().IsAssignableFrom(typeof(DateTime)))
+                        {
+                            DateTime dateTime = (DateTime)value;
+                            trueValue = DateUtil.formatForOcean(dateTime);
+                        }
+                        else
+                        {
+                            trueValue = value;
+                        }
+                    }
+                    else if (fieldType.IsAssignableFrom(typeof(DateTime?)))
+                    {
+                        DateTime dateTime = (DateTime)value;
+                        trueValue = DateUtil.format(dateTime);
+                    }
+                    else if (fieldType.IsAssignableFrom(typeof(Byte[])) || fieldType.IsAssignableFrom(typeof(byte[])))
+                    {
+                        trueValue = Convert.ToBase64String((byte[])value);
+                    }
+                    else
+                    {
+                        DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(fieldType);
+                        MemoryStream stream = new MemoryStream();
+                        dataContractJsonSerializer.WriteObject(stream, value);
+                        byte[] dataBytes = new byte[stream.Length];
+                        stream.Position = 0;
+                        stream.Read(dataBytes, 0, (int)stream.Length);
+
+                        string dataString = Encoding.UTF8.GetString(dataBytes);
+                        trueValue = dataString;
+                    }
+                    result.Add(piName, trueValue);
+                }
+
+                }
+            }
+            return result;
+        }
+
+    }
+}
diff --git a/BBWY.1688SDK/serialize/Serializer.cs b/BBWY.1688SDK/serialize/Serializer.cs
new file mode 100644
index 00000000..7dfba74c
--- /dev/null
+++ b/BBWY.1688SDK/serialize/Serializer.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.serialize
+{
+    public interface Serializer
+    {
+
+        //返回该反序列化接口支持的数据协议.
+         String supportedContentType();
+
+        //序列化方法
+         Dictionary serialize(Object serializer);
+    }
+}
diff --git a/BBWY.1688SDK/serialize/SerializerProvider.cs b/BBWY.1688SDK/serialize/SerializerProvider.cs
new file mode 100644
index 00000000..86249f53
--- /dev/null
+++ b/BBWY.1688SDK/serialize/SerializerProvider.cs
@@ -0,0 +1,60 @@
+using com.alibaba.openapi.client.policy;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.serialize
+{
+    public class SerializerProvider
+    {
+        private static SerializerProvider instance;
+        private static Object lockObject=new Object();
+        public static SerializerProvider getInstance()
+        {
+            if (instance == null)
+            {
+                lock (lockObject)
+                {
+                    if (instance == null)
+                    {
+                        instance = new SerializerProvider();
+                        instance.initial();
+                    }
+                }
+            }
+            return instance;
+        }
+
+        private SerializerProvider()
+        {
+
+        }
+
+        private void initial()
+        {
+            serializerStore.Add(Protocol.param2, new Param2RequestSerializer());
+            deSerializerStore.Add(Protocol.param2, new Json2Deserializer());
+            deSerializerStore.Add(Protocol.json2, new Json2Deserializer());
+        }
+    
+        private  Dictionary serializerStore = new Dictionary();
+
+        public  Serializer getSerializer(String contentType)
+        {
+            return serializerStore[contentType];
+        }
+
+        private  Dictionary deSerializerStore = new Dictionary();
+
+        public  DeSerializer getDeSerializer(String contentType)
+        {
+            return deSerializerStore[contentType];
+        }
+
+        
+
+
+    }
+}
diff --git a/BBWY.1688SDK/util/DateUtil.cs b/BBWY.1688SDK/util/DateUtil.cs
new file mode 100644
index 00000000..242fd011
--- /dev/null
+++ b/BBWY.1688SDK/util/DateUtil.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.util
+{
+    public class DateUtil
+    {
+        //这里定义两个日期格式,由于.Net平台的毫秒格式用fff表示,Ocean平台(Java)的毫秒格式用SSS表示。
+        private static string Date_Pattern = "yyyyMMddHHmmssfff";
+     
+        private static string Date_PatternForOcean = "yyyyMMddHHmmssSSS";
+
+
+        public static String getDatePattern()
+        {
+            return Date_PatternForOcean;
+        }
+
+        public static String format(DateTime date)
+        {
+            return date.ToString(Date_Pattern);
+        }
+
+        public static String formatForOcean(DateTime date)
+        {
+            String value = date.ToString("yyyyMMddHHmmssfffzzz");
+            String newValue = value.Replace(":", "");
+            return newValue;
+        }
+
+        public static DateTime formatFromStr(String dateDesc)
+        {
+            if (dateDesc.Contains("+") || dateDesc.Contains("-"))
+            {
+                try
+                {
+                    IFormatProvider culture = new CultureInfo("zh-CN", true);
+                    DateTime datetime = DateTime.ParseExact(dateDesc, "yyyyMMddHHmmssfffzzz", culture);
+                    return datetime;
+                }
+                catch (Exception x)
+                {
+                    String message = x.Message;
+                }
+            }
+                IFormatProvider newculture = new CultureInfo("zh-CN", true);
+                DateTime newdatetime = DateTime.ParseExact(dateDesc, Date_Pattern, newculture);
+                return newdatetime;
+        }
+
+
+
+        public static long currentTimeMillis()
+        {
+            System.DateTime current = new DateTime();
+            System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
+            double ms = (current - startTime).TotalMilliseconds;
+            long b = Convert.ToInt64(ms);
+            return b;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/util/SignatureUtil.cs b/BBWY.1688SDK/util/SignatureUtil.cs
new file mode 100644
index 00000000..ceb22a28
--- /dev/null
+++ b/BBWY.1688SDK/util/SignatureUtil.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Security.Cryptography;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.util
+{
+    public class SignatureUtil
+    {
+        public static byte[] hmacSha1(String path, Dictionary parameters, String signingKey)
+        {
+            List lists = new List();
+            foreach (KeyValuePair kvp in parameters)
+            {
+                lists.Add(kvp.Key + kvp.Value);
+            }
+            lists.Sort(StringComparer.Ordinal);
+            StringBuilder sb = new StringBuilder();
+            sb.Append(path);
+            foreach (String param in lists)
+            {
+                sb.Append(param);
+            }
+            String contentToHmac = sb.ToString();
+            byte[] byteToHmac = System.Text.Encoding.UTF8.GetBytes(contentToHmac);
+            byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(signingKey);
+            HMACSHA1 hmac = new HMACSHA1(byteArray);
+            byte[] hashValue = hmac.ComputeHash(byteToHmac, 0, byteToHmac.Length);
+            return hashValue;
+        }
+
+        public static string toHex( byte[] bytes)
+        {
+            char[] c = new char[bytes.Length * 2];
+
+            byte b;
+
+            for (int bx = 0, cx = 0; bx < bytes.Length; ++bx, ++cx)
+            {
+                b = ((byte)(bytes[bx] >> 4));
+                c[cx] = (char)(b > 9 ? b + 0x37 + 0x20 : b + 0x30);
+
+                b = ((byte)(bytes[bx] & 0x0F));
+                c[++cx] = (char)(b > 9 ? b + 0x37 + 0x20 : b + 0x30);
+            }
+
+            return new string(c).ToUpper();
+        }
+
+        public static byte[] hexToBytes( string str)
+        {
+            if (str.Length == 0 || str.Length % 2 != 0)
+                return new byte[0];
+
+            byte[] buffer = new byte[str.Length / 2];
+            char c;
+            for (int bx = 0, sx = 0; bx < buffer.Length; ++bx, ++sx)
+            {
+                // Convert first half of byte
+                c = str[sx];
+                buffer[bx] = (byte)((c > '9' ? (c > 'Z' ? (c - 'a' + 10) : (c - 'A' + 10)) : (c - '0')) << 4);
+
+                // Convert second half of byte
+                c = str[++sx];
+                buffer[bx] |= (byte)(c > '9' ? (c > 'Z' ? (c - 'a' + 10) : (c - 'A' + 10)) : (c - '0'));
+            }
+
+            return buffer;
+        }
+    }
+}
diff --git a/BBWY.Server.API/Controllers/PlatformSDKController.cs b/BBWY.Server.API/Controllers/PlatformSDKController.cs
index 3caea906..c7821abf 100644
--- a/BBWY.Server.API/Controllers/PlatformSDKController.cs
+++ b/BBWY.Server.API/Controllers/PlatformSDKController.cs
@@ -119,5 +119,16 @@ namespace BBWY.Server.API.Controllers
         {
             platformSDKBusinessList.FirstOrDefault(p => p.Platform == outStockRequest.Platform).OutStock(outStockRequest);
         }
+
+        /// 
+        /// 订单预览
+        /// 
+        /// 
+        /// 
+        [HttpPost]
+        public PreviewOrderResponse PreviewOrder(PreviewOrderReuqest previewOrderReuqest)
+        {
+            return platformSDKBusinessList.FirstOrDefault(p => p.Platform == previewOrderReuqest.Platform).PreviewOrder(previewOrderReuqest);
+        }
     }
 }
diff --git a/BBWY.Server.API/Startup.cs b/BBWY.Server.API/Startup.cs
index 4f7b4508..20570bbe 100644
--- a/BBWY.Server.API/Startup.cs
+++ b/BBWY.Server.API/Startup.cs
@@ -67,6 +67,7 @@ namespace BBWY.Server.API
             });
             services.BatchRegisterServices(new Assembly[] { Assembly.Load("BBWY.Server.Business") }, typeof(IDenpendency));
             services.AddSingleton();
+            services.AddSingleton();
 
             //var stores = Configuration.GetSection("Stores").Get>();
 
diff --git a/BBWY.Server.Business/BBWY.Server.Business.csproj b/BBWY.Server.Business/BBWY.Server.Business.csproj
index 1c50ffda..c9937f02 100644
--- a/BBWY.Server.Business/BBWY.Server.Business.csproj
+++ b/BBWY.Server.Business/BBWY.Server.Business.csproj
@@ -15,6 +15,7 @@
   
 
   
+    
     
     
     
diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs
index 0aac43f0..1e22c310 100644
--- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs
+++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs
@@ -34,7 +34,7 @@ namespace BBWY.Server.Business
         };
 
 
-        public JDBusiness(IMemoryCache memoryCache, ILogger logger) : base(memoryCache) { this.logger = logger; }
+        public JDBusiness(IMemoryCache memoryCache, ILogger logger) : base(memoryCache, logger) { }
 
         private IJdClient GetJdClient(string appKey, string appSecret)
         {
diff --git a/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs b/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs
index 6f1f0e4f..e2e26e5d 100644
--- a/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs
+++ b/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs
@@ -1,4 +1,6 @@
-using Microsoft.Extensions.Caching.Memory;
+using BBWY.Server.Model;
+using Microsoft.Extensions.Caching.Memory;
+using NLog;
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -7,7 +9,8 @@ namespace BBWY.Server.Business
 {
     public class PDDBusiness : PlatformSDKBusiness
     {
-        public PDDBusiness(IMemoryCache memoryCache) : base(memoryCache)
+        public override Enums.Platform Platform => Enums.Platform.拼多多;
+        public PDDBusiness(IMemoryCache memoryCache, ILogger logger) : base(memoryCache, logger)
         {
         }
     }
diff --git a/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs b/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs
index 8c969ddb..0b452351 100644
--- a/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs
+++ b/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs
@@ -2,6 +2,7 @@
 using BBWY.Server.Model.Dto;
 using Microsoft.Extensions.Caching.Memory;
 using Newtonsoft.Json.Linq;
+using NLog;
 using System;
 using System.Collections.Generic;
 
@@ -11,16 +12,20 @@ namespace BBWY.Server.Business
     {
         protected IMemoryCache memoryCache;
 
-        protected TimeSpan expirationTimeSpan = TimeSpan.FromMinutes(60);
+        protected TimeSpan expirationTimeSpan;
 
         /// 
         /// 产品平台
         /// 
         public virtual Enums.Platform Platform { get; }
 
-        public PlatformSDKBusiness(IMemoryCache memoryCache)
+        protected ILogger logger;
+
+        public PlatformSDKBusiness(IMemoryCache memoryCache, ILogger logger)
         {
             this.memoryCache = memoryCache;
+            this.logger = logger;
+            this.expirationTimeSpan = TimeSpan.FromMinutes(60);
         }
 
         public virtual ProductListResponse GetProductList(SearchProductRequest searchProductRequest)
@@ -67,5 +72,10 @@ namespace BBWY.Server.Business
         {
             throw new NotImplementedException();
         }
+
+        public virtual PreviewOrderResponse PreviewOrder(PreviewOrderReuqest previewOrderReuqest)
+        {
+            throw new NotImplementedException();
+        }
     }
 }
diff --git a/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs b/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs
index c143488c..b5873afb 100644
--- a/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs
+++ b/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs
@@ -1,5 +1,6 @@
 using BBWY.Server.Model;
 using Microsoft.Extensions.Caching.Memory;
+using NLog;
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -8,10 +9,10 @@ namespace BBWY.Server.Business
 {
     public class TaoBaoBusiness : PlatformSDKBusiness
     {
-        public override Enums.Platform Platform => Enums.Platform.淘宝;
-
-        public TaoBaoBusiness(IMemoryCache memoryCache) : base(memoryCache)
+        public TaoBaoBusiness(IMemoryCache memoryCache, ILogger logger) : base(memoryCache, logger)
         {
         }
+
+        public override Enums.Platform Platform => Enums.Platform.淘宝;
     }
 }
diff --git a/BBWY.Server.Business/PlatformSDK/_1688Business.cs b/BBWY.Server.Business/PlatformSDK/_1688Business.cs
new file mode 100644
index 00000000..459d9c24
--- /dev/null
+++ b/BBWY.Server.Business/PlatformSDK/_1688Business.cs
@@ -0,0 +1,85 @@
+using BBWY._1688SDK.entity.OrderPreview;
+using BBWY.Server.Model;
+using BBWY.Server.Model.Dto;
+using com.alibaba.openapi.client;
+using com.alibaba.openapi.client.policy;
+using Microsoft.Extensions.Caching.Memory;
+using Newtonsoft.Json.Linq;
+using NLog;
+using System.Collections.Generic;
+
+namespace BBWY.Server.Business
+{
+    public class _1688Business : PlatformSDKBusiness
+    {
+        public override Enums.Platform Platform => Enums.Platform.阿里巴巴;
+
+        public _1688Business(IMemoryCache memoryCache, ILogger logger) : base(memoryCache, logger)
+        {
+
+        }
+
+        private SyncAPIClient GetSyncAPIClient(string appKey, string appSecret)
+        {
+            if (!memoryCache.TryGetValue(appKey, out SyncAPIClient syncAPIClient))
+            {
+                syncAPIClient = new SyncAPIClient(appKey, appSecret);
+                memoryCache.Set(appKey, syncAPIClient, expirationTimeSpan);
+            }
+            return syncAPIClient;
+        }
+
+        public override PreviewOrderResponse PreviewOrder(PreviewOrderReuqest previewOrderReuqest)
+        {
+            var client = GetSyncAPIClient(previewOrderReuqest.AppKey, previewOrderReuqest.AppSecret);
+            RequestPolicy reqPolicy = new RequestPolicy();
+            reqPolicy.HttpMethod = "POST";
+            reqPolicy.NeedAuthorization = false;
+            reqPolicy.RequestSendTimestamp = true;
+            reqPolicy.UseHttps = false;
+            reqPolicy.UseSignture = true;
+            reqPolicy.AccessPrivateApi = false;
+
+            Request request = new Request();
+            APIId apiId = new APIId();
+            apiId.Name = "alibaba.createOrder.preview";
+            apiId.NamespaceValue = "com.alibaba.trade";
+            apiId.Version = 1;
+            request.ApiId = apiId;
+
+            var param = new CreateOrderPreview()
+            {
+                addressParam = new AddressParam()
+                {
+                    fullName = previewOrderReuqest.ConsigneeRequest.ContactName,
+                    mobile = previewOrderReuqest.ConsigneeRequest.Mobile,
+                    phone = previewOrderReuqest.ConsigneeRequest.TelePhone,
+                    postCode = "000000",
+                    address = previewOrderReuqest.ConsigneeRequest.Address,
+                    provinceText = previewOrderReuqest.ConsigneeRequest.Province,
+                    cityText = previewOrderReuqest.ConsigneeRequest.City,
+                    areaText = previewOrderReuqest.ConsigneeRequest.County,
+                    townText = previewOrderReuqest.ConsigneeRequest.Town
+                },
+                cargoParamList = new List(),
+                flow = "general"
+            };
+            foreach (var cargo in previewOrderReuqest.CargoParamList)
+            {
+                param.cargoParamList.Add(new CargoParam()
+                {
+                    offerId = long.Parse(cargo.SkuId),
+                    specId = cargo.SpecId,
+                    quantity = cargo.Quantity
+                });
+            }
+            request.RequestEntity = param;
+            var result = client.send(request, reqPolicy);
+
+            return new PreviewOrderResponse()
+            {
+
+            };
+        }
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CargoParamRequest.cs b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CargoParamRequest.cs
new file mode 100644
index 00000000..6f6f13df
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CargoParamRequest.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace BBWY.Server.Model.Dto
+{
+    public class CargoParamRequest
+    {
+        public string ProductId { get; set; }
+        public string SkuId { get; set; }
+        public string SpecId { get; set; }
+        public int Quantity { get; set; }
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/ConsigneeRequest.cs b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/ConsigneeRequest.cs
new file mode 100644
index 00000000..320e8ef5
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/ConsigneeRequest.cs
@@ -0,0 +1,43 @@
+namespace BBWY.Server.Model.Dto
+{
+    public class ConsigneeRequest
+    {
+        /// 
+        /// 联系人名称
+        /// 
+        public string ContactName { get; set; }
+
+        /// 
+        /// 座机
+        /// 
+        public string TelePhone { get; set; }
+
+        /// 
+        /// 手机
+        /// 
+        public string Mobile { get; set; }
+
+        public string Address { get; set; }
+
+        /// 
+        /// 省
+        /// 
+        public string Province { get; set; }
+
+        /// 
+        /// 市
+        /// 
+        public string City { get; set; }
+
+        /// 
+        /// 县
+        /// 
+        public string County { get; set; }
+
+        /// 
+        /// 镇
+        /// 
+        public string Town { get; set; }
+
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/PreviewOrderReuqest.cs b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/PreviewOrderReuqest.cs
new file mode 100644
index 00000000..b74f31ef
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/PreviewOrderReuqest.cs
@@ -0,0 +1,11 @@
+using System.Collections.Generic;
+
+namespace BBWY.Server.Model.Dto
+{
+    public class PreviewOrderReuqest: PlatformRequest
+    {
+        public ConsigneeRequest ConsigneeRequest { get; set; }
+
+        public IList CargoParamList { get; set; }
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs b/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs
new file mode 100644
index 00000000..5fff9c2a
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs
@@ -0,0 +1,20 @@
+namespace BBWY.Server.Model.Dto
+{
+    public class PreviewOrderResponse
+    {
+        /// 
+        /// 总额
+        /// 
+        public decimal TotalAmount { get; set; }
+
+        /// 
+        /// 货款总额
+        /// 
+        public decimal ProductAmount { get; set; }
+
+        /// 
+        /// 运费
+        /// 
+        public decimal FreightAmount { get; set; }
+    }
+}