ソースを参照

初始化提交

zhouy 4 年 前
コミット
4c649c3906
25 ファイル変更1377 行追加8 行削除
  1. 16 5
      pom.xml
  2. 23 0
      src/main/java/com/uas/eis/config/LingXingConfig.java
  3. 8 0
      src/main/java/com/uas/eis/sdk/constant/ClientConstants.java
  4. 58 0
      src/main/java/com/uas/eis/sdk/core/Config.java
  5. 5 0
      src/main/java/com/uas/eis/sdk/core/HttpMethod.java
  6. 330 0
      src/main/java/com/uas/eis/sdk/core/HttpRequest.java
  7. 54 0
      src/main/java/com/uas/eis/sdk/core/HttpResponse.java
  8. 102 0
      src/main/java/com/uas/eis/sdk/core/HttpResponseImpl.java
  9. 38 0
      src/main/java/com/uas/eis/sdk/core/ObjectMapperSingleton.java
  10. 33 0
      src/main/java/com/uas/eis/sdk/entity/Result.java
  11. 13 0
      src/main/java/com/uas/eis/sdk/entity/Token.java
  12. 14 0
      src/main/java/com/uas/eis/sdk/logger/HttpLoggingFilter.java
  13. 108 0
      src/main/java/com/uas/eis/sdk/okhttp/AKRestClient.java
  14. 165 0
      src/main/java/com/uas/eis/sdk/okhttp/HttpCommand.java
  15. 38 0
      src/main/java/com/uas/eis/sdk/okhttp/HttpExecutor.java
  16. 17 0
      src/main/java/com/uas/eis/sdk/resp/AccessTokenGetResp.java
  17. 46 0
      src/main/java/com/uas/eis/sdk/samples/AccessTokenDemo.java
  18. 55 0
      src/main/java/com/uas/eis/sdk/samples/OrderDemo.java
  19. 108 0
      src/main/java/com/uas/eis/sdk/sign/AesUtil.java
  20. 36 0
      src/main/java/com/uas/eis/sdk/sign/ApiSign.java
  21. 17 0
      src/main/java/com/uas/eis/service/LingxingService.java
  22. 58 0
      src/main/java/com/uas/eis/serviceImpl/LingxingServiceImpl.java
  23. 22 0
      src/main/java/com/uas/eis/task/LingxingTask.java
  24. 6 1
      src/main/resources/application.yml
  25. 7 2
      src/test/java/com/uas/eis/UasEisApplicationTests.java

+ 16 - 5
pom.xml

@@ -41,11 +41,6 @@
 			<artifactId>spring-boot-starter-jdbc</artifactId>
 		</dependency>
 
-		<!-- <dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-devtools</artifactId>
-		</dependency> -->
-
 		<dependency>  
             <groupId>org.springframework.boot</groupId>  
             <artifactId>spring-boot-starter-data-jpa</artifactId>  
@@ -87,6 +82,22 @@
 		    <artifactId>jackson-mapper-asl</artifactId>
 		    <version>1.9.13</version>
 		</dependency>
+		<dependency>
+			<groupId>com.squareup.okhttp3</groupId>
+			<artifactId>okhttp</artifactId>
+			<version>3.14.9</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>1.3.2</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.projectlombok</groupId>
+			<artifactId>lombok</artifactId>
+			<version>1.18.12</version>
+		</dependency>
 		
 		<dependency>
 		    <groupId>net.sf.flexjson</groupId>

+ 23 - 0
src/main/java/com/uas/eis/config/LingXingConfig.java

@@ -0,0 +1,23 @@
+package com.uas.eis.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @author: zhouy
+ * @date: 2021/9/16 11:04
+ * @desc: 外部资源配置
+ */
+@Component
+@ConfigurationProperties(prefix = "extral.lingxing")
+@Data
+public class LingXingConfig {
+
+    private Map<String,String> apps;
+
+    private String apiUrl;
+}
+

+ 8 - 0
src/main/java/com/uas/eis/sdk/constant/ClientConstants.java

@@ -0,0 +1,8 @@
+package com.uas.eis.sdk.constant;
+
+public final class ClientConstants {
+
+    public static final String CONTENT_TYPE_JSON = "application/json";
+
+    public static final String HEADER_CONTENT_TYPE = "Content-Type";
+}

+ 58 - 0
src/main/java/com/uas/eis/sdk/core/Config.java

@@ -0,0 +1,58 @@
+package com.uas.eis.sdk.core;
+
+public class Config {
+
+    private int connectTimeout;
+
+    private int readTimeout;
+
+    private int maxConnections;
+
+    public static final Config DEFAULT = new Config();
+
+    /**
+     * Sets the connection timeout in milliseconds
+     *
+     * @param connectTimeout timeout in milliseconds
+     * @return Config
+     */
+    public Config withConnectionTimeout(int connectTimeout) {
+        this.connectTimeout = connectTimeout;
+        return this;
+    }
+
+    /**
+     * Sets the read timeout in milliseconds
+     *
+     * @param readTimeout timeout in milliseconds
+     * @return Config
+     */
+    public Config withReadTimeout(int readTimeout) {
+        this.readTimeout = readTimeout;
+        return this;
+    }
+
+    /**
+     * This sets the max allowed connections for connectors who are using a connection pool.  This option if set will be
+     * a no-op to connectors that don't offer this setting.
+     *
+     * @param maxConnections the max connections allowed
+     * @return Config
+     */
+    public Config withMaxConnections(int maxConnections) {
+        this.maxConnections = maxConnections;
+        return this;
+    }
+
+    public int getConnectTimeout() {
+        return connectTimeout;
+    }
+
+    public int getReadTimeout() {
+        return readTimeout;
+    }
+
+    public int getMaxConnections() {
+        return maxConnections;
+    }
+}

+ 5 - 0
src/main/java/com/uas/eis/sdk/core/HttpMethod.java

@@ -0,0 +1,5 @@
+package com.uas.eis.sdk.core;
+
+public enum HttpMethod {
+    HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE
+}

+ 330 - 0
src/main/java/com/uas/eis/sdk/core/HttpRequest.java

@@ -0,0 +1,330 @@
+package com.uas.eis.sdk.core;
+
+import com.uas.eis.sdk.constant.ClientConstants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class HttpRequest<R> {
+
+    String region;
+    String endpoint;
+    String path;
+    Class<R> returnType;
+    Object entity;
+    String contentType = ClientConstants.CONTENT_TYPE_JSON;
+    HttpMethod method = HttpMethod.GET;
+    String json;
+    private Config config;
+    private Map<String, String> queryParams;
+    private final Map<String, Object> headers = new HashMap<>();
+
+    public HttpRequest() {
+    }
+
+    /**
+     * Creates a new HttpRequest
+     *
+     * @param endpoint the endpoint URI
+     * @param path     the path which will be appended to the endpoint URI
+     * @param method   the method the method type to invoke
+     */
+    public HttpRequest(String endpoint, String path, HttpMethod method) {
+        this.endpoint = endpoint;
+        this.path = path;
+        this.method = method;
+    }
+
+    /**
+     * A build for creating HttpRequest objects
+     *
+     * @return the request builder
+     */
+    public static RequestBuilder<Void> builder() {
+        return new RequestBuilder<>(Void.class);
+    }
+
+    /**
+     * A build for creating HttpRequest objects
+     *
+     * @param <R>        the expected return type
+     * @param returnType the return type
+     * @return the request builder
+     */
+    public static <R> RequestBuilder<R> builder(Class<R> returnType) {
+        return new RequestBuilder<>(returnType);
+    }
+
+    /**
+     * @return the method this request will use
+     */
+    public HttpMethod getMethod() {
+        return method;
+    }
+
+    /**
+     * @return the content type for the request
+     */
+    public String getContentType() {
+        return contentType;
+    }
+
+    /**
+     * @return the endpoint URI
+     */
+    public String getEndpoint() {
+        return endpoint;
+    }
+
+    /**
+     * @return the http path
+     */
+    public String getPath() {
+        return path;
+    }
+
+    /**
+     * If JSON is explicitly set vs an entity then this method will return a JSON String otherwise Empty
+     *
+     * @return JSON String form or Empty
+     */
+    public String getJson() {
+        return (json == null) ? "" : json;
+    }
+
+    /**
+     * @return true, if a JSON Object has been set
+     */
+    public boolean hasJson() {
+        return (json != null);
+    }
+
+    /**
+     * @return the return type expected after invocation
+     */
+    public Class<R> getReturnType() {
+        return returnType;
+    }
+
+    /**
+     * @return the entity to post
+     */
+    public Object getEntity() {
+        return entity;
+    }
+
+    /**
+     * @return true, if query params have been added
+     */
+    public boolean hasQueryParams() {
+        return queryParams != null && !queryParams.isEmpty();
+    }
+
+    /**
+     * @return the request query params
+     */
+    public Map<String, String> getQueryParams() {
+        return queryParams;
+    }
+
+    /**
+     * @return the headers to apply
+     */
+    public Map<String, Object> getHeaders() {
+        return headers;
+    }
+
+    /**
+     * @return true, if headers have been added
+     */
+    public boolean hasHeaders() {
+        return !headers.isEmpty();
+    }
+
+    public RequestBuilder<R> toBuilder() {
+        return new RequestBuilder<>(this);
+    }
+
+    /**
+     * @return the client configuration associated with this request
+     */
+    public Config getConfig() {
+        return config != null ? config : Config.DEFAULT;
+    }
+
+    public String getRegion() {
+        return region;
+    }
+
+    public static final class RequestBuilder<R> {
+
+        HttpRequest<R> request;
+
+        public RequestBuilder(HttpRequest<R> request) {
+            this.request = request;
+        }
+
+        public RequestBuilder(Class<R> returnType) {
+            request = new HttpRequest<>();
+            request.returnType = returnType;
+        }
+
+        /**
+         * @see HttpRequest#getEndpoint()
+         */
+        public RequestBuilder<R> endpoint(String endpoint) {
+            request.endpoint = endpoint;
+            return this;
+        }
+
+        /**
+         * @see HttpRequest#getPath()
+         */
+        public RequestBuilder<R> path(String path) {
+            request.path = path;
+            return this;
+        }
+
+        /**
+         * @see HttpRequest#getMethod()
+         */
+        public RequestBuilder<R> method(HttpMethod method) {
+            request.method = method;
+            return this;
+        }
+
+        /**
+         * Flags the request method as PUT
+         *
+         * @return the request builder
+         */
+        public RequestBuilder<R> methodPut() {
+            request.method = HttpMethod.PUT;
+            return this;
+        }
+
+        /**
+         * Flags the request method as GET
+         *
+         * @return the request builder
+         */
+        public RequestBuilder<R> methodGet() {
+            request.method = HttpMethod.GET;
+            return this;
+        }
+
+        /**
+         * Flags the request method as DELETE
+         *
+         * @return the request builder
+         */
+        public RequestBuilder<R> methodDelete() {
+            request.method = HttpMethod.DELETE;
+            return this;
+        }
+
+        /**
+         * Flags the request method as POST
+         *
+         * @return the request builder
+         */
+        public RequestBuilder<R> methodPost() {
+            request.method = HttpMethod.POST;
+            return this;
+        }
+
+        /**
+         * @see HttpRequest#getEntity()
+         */
+        public RequestBuilder<R> entity(Object entity) {
+            request.entity = entity;
+            return this;
+        }
+
+        /**
+         * Sets a client configuration to use with this session
+         */
+        public RequestBuilder<R> config(Config config) {
+            request.config = config;
+            return this;
+        }
+
+        /**
+         * Pushes the Map of Headers into the existing headers for this request
+         *
+         * @param headers the headers to append
+         * @return the request builder
+         */
+        public RequestBuilder<R> headers(Map<String, ? extends Object> headers) {
+            request.getHeaders().putAll(headers);
+            return this;
+        }
+
+        /**
+         * Adds a new Header to the request
+         *
+         * @param name  the header name
+         * @param value the header value
+         * @return the request builder
+         */
+        public RequestBuilder<R> header(String name, Object value) {
+            request.getHeaders().put(name, value);
+            return this;
+        }
+
+        public RequestBuilder<R> queryParams(Map<String, Object> params) {
+            params.forEach(this::queryParam);
+            return this;
+        }
+
+        /**
+         * Adds a Key/Value based Query Param
+         *
+         * @param key   the key
+         * @param value the value
+         * @return the request builder
+         */
+        public RequestBuilder<R> queryParam(String key, Object value) {
+            if (value == null)
+                return this;
+            if (request.queryParams == null) {
+                request.queryParams = new HashMap<>();
+            }
+            request.queryParams.put(key, String.valueOf(value));
+            return this;
+        }
+
+        /**
+         * AdHoc JSON object to Post/Put
+         *
+         * @param json the JSON object in String form
+         * @return the request builder
+         */
+        public RequestBuilder<R> json(String json) {
+            request.json = json;
+            return this;
+        }
+
+        /**
+         * Overrides the default content type for the request
+         *
+         * @param contentType the content type to use in the request
+         * @return the request builder
+         */
+        public RequestBuilder<R> contentType(String contentType) {
+            if (contentType != null)
+                request.contentType = contentType;
+            return this;
+        }
+
+        /**
+         * Builds the HttpRequest
+         *
+         * @return HttpRequest
+         */
+        public HttpRequest<R> build() {
+            return request;
+        }
+
+    }
+}

+ 54 - 0
src/main/java/com/uas/eis/sdk/core/HttpResponse.java

@@ -0,0 +1,54 @@
+package com.uas.eis.sdk.core;
+
+import java.io.Closeable;
+import java.io.InputStream;
+import java.util.Map;
+
+public interface HttpResponse extends Closeable {
+
+    /**
+     * Reads the entity as is into the specified type without any exception mapping
+     *
+     * @param typeToReadAs the type to read the desired entity in as
+     * @return the entity
+     */
+    <T> T readEntity(Class<T> typeToReadAs);
+
+    /**
+     * Gets the status from the previous Request
+     *
+     * @return the status code
+     */
+    int getStatus();
+
+    /**
+     * The current content-type within the response
+     *
+     * @return the response content-type
+     */
+    String getContentType();
+
+    /**
+     * The status message which is associated with the current {@link #getStatus()}
+     * @return the status message or null
+     */
+    String getStatusMessage();
+
+    /**
+     * @return the input stream
+     */
+    InputStream getInputStream();
+
+    /**
+     * Returns a Header value from the specified name key
+     *
+     * @param name the name of the header to query for
+     * @return the header as a String or null if not found
+     */
+    String header(String name);
+
+    /**
+     * @return the a Map of Header Name to Header Value
+     */
+    Map<String, String> headers();
+}

+ 102 - 0
src/main/java/com/uas/eis/sdk/core/HttpResponseImpl.java

@@ -0,0 +1,102 @@
+package com.uas.eis.sdk.core;
+
+import com.uas.eis.sdk.constant.ClientConstants;
+import okhttp3.Headers;
+import okhttp3.Response;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+public class HttpResponseImpl implements HttpResponse {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HttpResponseImpl.class);
+    private final Response response;
+
+    private HttpResponseImpl(Response response) {
+        this.response = response;
+    }
+
+    /**
+     * Wrap the given Response
+     *
+     * @param response the response
+     * @return the HttpResponse
+     */
+    public static HttpResponseImpl wrap(Response response) {
+        return new HttpResponseImpl(response);
+    }
+
+
+    /**
+     * Gets the status from the previous Request
+     *
+     * @return the status code
+     */
+    public int getStatus() {
+        return response.code();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getStatusMessage() {
+        return response.message();
+    }
+
+    /**
+     * @return the input stream
+     */
+    public InputStream getInputStream() {
+        return Objects.requireNonNull(response.body()).byteStream();
+    }
+
+    /**
+     * Returns a Header value from the specified name key
+     *
+     * @param name the name of the header to query for
+     * @return the header as a String or null if not found
+     */
+    public String header(String name) {
+        return response.header(name);
+    }
+
+    /**
+     * @return the a Map of Header Name to Header Value
+     */
+    public Map<String, String> headers() {
+        Map<String, String> retHeaders = new HashMap<>();
+        Headers headers = response.headers();
+
+        for (String name : headers.names()) {
+            retHeaders.put(name, headers.get(name));
+        }
+        return retHeaders;
+    }
+
+    @Override
+    public <T> T readEntity(Class<T> typeToReadAs) {
+        try {
+            return ObjectMapperSingleton.getContext(typeToReadAs).reader(typeToReadAs).readValue(Objects.requireNonNull(response.body()).string());
+        } catch (Exception e) {
+            LOG.error(e.getMessage(), e);
+            throw new RuntimeException(e.getMessage());
+        }
+    }
+
+    @Override
+    public void close() {
+        if (response != null) {
+            Objects.requireNonNull(response.body()).close();
+        }
+    }
+
+    @Override
+    public String getContentType() {
+        return header(ClientConstants.HEADER_CONTENT_TYPE);
+    }
+}

+ 38 - 0
src/main/java/com/uas/eis/sdk/core/ObjectMapperSingleton.java

@@ -0,0 +1,38 @@
+package com.uas.eis.sdk.core;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+
+public class ObjectMapperSingleton {
+
+    private static final ObjectMapperSingleton INSTANCE = new ObjectMapperSingleton();
+
+    ObjectMapper mapper;
+    ObjectMapper rootMapper;
+
+    private ObjectMapperSingleton() {
+
+        mapper = new ObjectMapper();
+
+        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+        mapper.enable(SerializationFeature.INDENT_OUTPUT);
+        mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+        mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+
+        rootMapper = new ObjectMapper();
+        rootMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+        rootMapper.enable(SerializationFeature.INDENT_OUTPUT);
+        rootMapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
+        rootMapper.enable(DeserializationFeature.UNWRAP_ROOT_VALUE);
+        rootMapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+        rootMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+    }
+
+
+    public static ObjectMapper getContext(Class<?> type) {
+        return type.getAnnotation(JsonRootName.class) == null ? INSTANCE.mapper : INSTANCE.rootMapper;
+    }
+}

+ 33 - 0
src/main/java/com/uas/eis/sdk/entity/Result.java

@@ -0,0 +1,33 @@
+package com.uas.eis.sdk.entity;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+public class Result<T> {
+
+    /**
+     * 自定义业务码
+     */
+    private String code;
+
+    /**
+     * 自定义业务提示说明
+     */
+    private String msg;
+
+    /**
+     * 自定义返回 数据结果集
+     */
+    private T data;
+
+    @Override
+    public String toString() {
+        return "Result{" +
+                ", code=" + code +
+                ", msg='" + msg + '\'' +
+                ", data=" + data +
+                '}';
+    }
+}

+ 13 - 0
src/main/java/com/uas/eis/sdk/entity/Token.java

@@ -0,0 +1,13 @@
+package com.uas.eis.sdk.entity;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+public class Token {
+
+    private String accessToken;
+    private String refreshToken;
+    private String expiresIn;
+}

+ 14 - 0
src/main/java/com/uas/eis/sdk/logger/HttpLoggingFilter.java

@@ -0,0 +1,14 @@
+package com.uas.eis.sdk.logger;
+
+public final class HttpLoggingFilter {
+
+    private HttpLoggingFilter() { }
+
+    public static void setHttpLogging(boolean isEnabled) {
+        System.getProperties().setProperty(HttpLoggingFilter.class.getName(), String.valueOf(isEnabled));
+    }
+
+    public static boolean isLoggingEnabled() {
+        return Boolean.getBoolean(HttpLoggingFilter.class.getName());
+    }
+}

+ 108 - 0
src/main/java/com/uas/eis/sdk/okhttp/AKRestClient.java

@@ -0,0 +1,108 @@
+package com.uas.eis.sdk.okhttp;
+
+import com.alibaba.fastjson.JSON;
+import com.uas.eis.sdk.core.HttpMethod;
+import com.uas.eis.sdk.core.HttpRequest;
+import com.uas.eis.sdk.core.HttpResponse;
+import com.uas.eis.sdk.entity.Result;
+import com.uas.eis.sdk.resp.AccessTokenGetResp;
+import com.uas.eis.sdk.sign.ApiSign;
+import lombok.Builder;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.Map;
+@Data
+@Builder
+public class AKRestClient {
+
+    private String endpoint;
+
+    public AKRestClient(String endpoint) {
+        this.endpoint = endpoint;
+    }
+
+    public AccessTokenGetResp getAccessToken(String appId, String appSecret) throws Exception {
+        HttpRequest<Result> build = HttpRequest.builder(Result.class)
+                .method(HttpMethod.POST)
+                .endpoint(this.endpoint)
+                .path("api/auth-server/oauth/access-token")
+                .queryParam("appId", appId)
+                .queryParam("appSecret", appSecret)
+                .build();
+        HttpResponse execute = HttpExecutor.create().execute(build);
+        return execute.readEntity(AccessTokenGetResp.class);
+    }
+
+    public Object refreshToken(String appId, String refreshToken) throws Exception {
+        HttpRequest<Object> build = HttpRequest.builder(Object.class)
+                .method(HttpMethod.POST)
+                .endpoint(this.endpoint)
+                .path("api/auth-server/oauth/refresh")
+                .queryParam("appId", appId)
+                .queryParam("refreshToken", refreshToken)
+                .build();
+        HttpResponse execute = HttpExecutor.create().execute(build);
+        return execute.readEntity(Object.class);
+    }
+
+    public Object sign(Map<String, Object> params) throws Exception {
+        HttpRequest<Object> build = HttpRequest.builder(Object.class)
+                .method(HttpMethod.POST)
+                .endpoint(this.endpoint)
+                .path("api/auth-server/oauth/api/authorize")
+                .queryParams(params)
+                .build();
+        HttpResponse execute = HttpExecutor.create().execute(build);
+        return execute.readEntity(Object.class);
+    }
+
+    public Object getSellers(String appId,  String access_token) throws Exception {
+        Map<String, Object> requestHeaders = defaultHeaders(appId, access_token);
+        String sign = getRequestSign(appId, requestHeaders, new HashMap<>());
+        System.out.println(sign);
+        HttpRequest<Object> build = HttpRequest.builder(Object.class)
+                .method(HttpMethod.GET)
+                .endpoint(this.endpoint)
+                .path("/data/seller/lists")
+                .queryParams(requestHeaders)
+                //.queryParam("sign", sign)
+                //.json(JSON.toJSONString(requestParams))
+                .build();
+        HttpResponse execute = HttpExecutor.create().execute(build);
+        return execute.readEntity(Object.class);
+    }
+    public Object getSellerOrders(String appId,  String access_token, Map<String, Object> requestParams) throws Exception {
+        Map<String, Object> requestHeaders = defaultHeaders(appId, access_token);
+        //String sign = getRequestSign(appId, requestHeaders, new HashMap<>());
+        HttpRequest<Object> build = HttpRequest.builder(Object.class)
+                .method(HttpMethod.POST)
+                .endpoint(this.endpoint)
+                .path("/data/mws/orders")
+                .queryParams(requestHeaders)
+               // .queryParam("sign", sign)
+                .json(JSON.toJSONString(requestParams))
+                .build();
+        HttpResponse execute = HttpExecutor.create().execute(build);
+        return execute.readEntity(Object.class);
+    }
+
+    public Map<String,Object> defaultHeaders(String appId,String access_token) {
+        Map<String, Object> requestHeaders = new HashMap<>();
+        requestHeaders.put("timestamp", System.currentTimeMillis() / 1000 + "");
+        requestHeaders.put("access_token", access_token);
+        requestHeaders.put("app_key", appId);
+        return requestHeaders;
+    }
+
+    public String getRequestSign(String appSecret,  Map<String,Object> requestHeaders, Map<String,Object> requestParams) {
+        Map<String, Object> signMap = new HashMap<>();
+        signMap.putAll(requestHeaders);
+        if(!requestParams.isEmpty()) {
+            signMap.putAll(requestParams);
+        }
+        return ApiSign.sign(signMap, appSecret);
+
+    }
+
+}

+ 165 - 0
src/main/java/com/uas/eis/sdk/okhttp/HttpCommand.java

@@ -0,0 +1,165 @@
+package com.uas.eis.sdk.okhttp;
+
+import com.sun.istack.internal.NotNull;
+import com.uas.eis.sdk.constant.ClientConstants;
+import com.uas.eis.sdk.core.Config;
+import com.uas.eis.sdk.core.HttpMethod;
+import com.uas.eis.sdk.core.HttpRequest;
+import com.uas.eis.sdk.core.ObjectMapperSingleton;
+import com.uas.eis.sdk.logger.HttpLoggingFilter;
+import okhttp3.*;
+import okhttp3.internal.Util;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+public final class HttpCommand<R> {
+
+    private static final Logger logger = LoggerFactory.getLogger(HttpCommand.class);
+
+    private final HttpRequest<R> request;
+    private OkHttpClient client;
+    private Request.Builder clientReq;
+    private int retries;
+
+    private HttpCommand(HttpRequest<R> request) {
+        this.request = request;
+    }
+
+    /**
+     * Creates a new HttpCommand from the given request
+     *
+     * @param request the request
+     * @return the command
+     */
+    public static <R> HttpCommand<R> create(HttpRequest<R> request) {
+        HttpCommand<R> command = new HttpCommand<R>(request);
+        command.initialize();
+        return command;
+    }
+
+    private void initialize() {
+        OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder();
+        Config config = request.getConfig();
+
+        if (config.getConnectTimeout() > 0)
+            okHttpClientBuilder.connectTimeout(config.getConnectTimeout(), TimeUnit.MILLISECONDS);
+
+        if (config.getReadTimeout() > 0)
+            okHttpClientBuilder.readTimeout(config.getReadTimeout(), TimeUnit.MILLISECONDS);
+
+        if (HttpLoggingFilter.isLoggingEnabled()) {
+            okHttpClientBuilder.addInterceptor(new LoggingInterceptor());
+        }
+        client = okHttpClientBuilder.build();
+        clientReq = new Request.Builder();
+        populateHeaders(request);
+        populateQueryParams(request);
+    }
+
+    /**
+     * Executes the command and returns the Response
+     *
+     * @return the response
+     * @throws Exception
+     */
+    public Response execute() throws Exception {
+        RequestBody body = null;
+        if (request.getEntity() != null) {
+            if (InputStream.class.isAssignableFrom(request.getEntity().getClass())) {
+                byte[] content = IOUtils.toByteArray((InputStream) request.getEntity());
+                body = RequestBody.create(MediaType.parse(request.getContentType()), content);
+            } else {
+                String content = ObjectMapperSingleton.getContext(request.getEntity().getClass()).writer().writeValueAsString(request.getEntity());
+                body = RequestBody.create(MediaType.parse(request.getContentType()), content);
+            }
+        } else if (request.hasJson()) {
+            body = RequestBody.create(MediaType.parse(ClientConstants.CONTENT_TYPE_JSON), request.getJson());
+        }
+        if ((request.getMethod() == HttpMethod.POST || request.getMethod() == HttpMethod.PUT) && body == null) {
+            body = RequestBody.create(MediaType.parse(request.getContentType()), Util.EMPTY_BYTE_ARRAY);
+        }
+        clientReq.method(request.getMethod().name(), body);
+        Call call = client.newCall(clientReq.build());
+        return call.execute();
+    }
+
+    /**
+     * @return true if a request entity has been set
+     */
+    public boolean hasEntity() {
+        return request.getEntity() != null;
+    }
+
+    /**
+     * @return current retry execution count for this command
+     */
+    public int getRetries() {
+        return retries;
+    }
+
+    /**
+     * @return incremement's the retry count and returns self
+     */
+    public HttpCommand<R> incrementRetriesAndReturn() {
+        initialize();
+        retries++;
+        return this;
+    }
+
+    public HttpRequest<R> getRequest() {
+        return request;
+    }
+
+    private void populateQueryParams(HttpRequest<R> request) {
+        StringBuilder url = new StringBuilder();
+        url.append(request.getEndpoint()).append("/").append(request.getPath());
+        if (!request.hasQueryParams()) {
+            clientReq.url(url.toString());
+            return;
+        }
+        url.append("?");
+        for (Map.Entry<String, String> entry : request.getQueryParams().entrySet()) {
+            try {
+                url.append(URLEncoder.encode(entry.getKey(), "UTF-8")).append("=").append(URLEncoder.encode(entry.getValue(), "UTF-8"));
+                url.append("&");
+            } catch (UnsupportedEncodingException e) {
+                logger.error(e.getMessage(), e);
+            }
+        }
+        if (url.charAt(url.length() - 1) == '&') {
+            url.deleteCharAt(url.length() - 1);
+        }
+        clientReq.url(url.toString());
+    }
+
+    private void populateHeaders(HttpRequest<R> request) {
+
+        if (!request.hasHeaders()) return;
+
+        for (Map.Entry<String, Object> h : request.getHeaders().entrySet()) {
+            clientReq.addHeader(h.getKey(), String.valueOf(h.getValue()));
+        }
+    }
+
+    static class LoggingInterceptor implements Interceptor {
+        @Override
+        @NotNull
+        public Response intercept(@NotNull Chain chain) throws IOException {
+            Request request = chain.request();
+            long t1 = System.nanoTime();
+            logger.info("Sending request url:{} ,connection:{},headers:{}", request.url(), chain.connection(), request.headers());
+            Response response = chain.proceed(request);
+            long t2 = System.nanoTime();
+            logger.info("Received response url:{} ,cost:{},headers:{}", response.request().url(), (t2 - t1) / 1e6d, response.headers());
+            return response;
+        }
+    }
+}

+ 38 - 0
src/main/java/com/uas/eis/sdk/okhttp/HttpExecutor.java

@@ -0,0 +1,38 @@
+package com.uas.eis.sdk.okhttp;
+
+import com.uas.eis.sdk.core.HttpRequest;
+import com.uas.eis.sdk.core.HttpResponse;
+import com.uas.eis.sdk.core.HttpResponseImpl;
+import okhttp3.Response;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HttpExecutor {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HttpExecutor.class);
+
+    private static final HttpExecutor INSTANCE = new HttpExecutor();
+
+    private HttpExecutor() {
+    }
+
+    public static HttpExecutor create() {
+        return INSTANCE;
+    }
+
+
+    public <R> HttpResponse execute(HttpRequest<R> request) throws Exception {
+        LOG.debug("Executing Request: {} -> {}", request.getEndpoint(), request.getPath());
+        HttpCommand<R> command = HttpCommand.create(request);
+        return invokeRequest(command);
+    }
+
+    private <R> HttpResponse invokeRequest(HttpCommand<R> command) throws Exception {
+        Response response = command.execute();
+        if (command.getRetries() == 0 && response.code() != 200) {
+            return invokeRequest(command.incrementRetriesAndReturn());
+        }
+        return HttpResponseImpl.wrap(response);
+    }
+
+}

+ 17 - 0
src/main/java/com/uas/eis/sdk/resp/AccessTokenGetResp.java

@@ -0,0 +1,17 @@
+package com.uas.eis.sdk.resp;
+
+import lombok.Data;
+
+import java.util.Map;
+
+/**
+ * @author: zhouy
+ * @date: 2021/9/16 17:51
+ * @desc:
+ */
+@Data
+public class AccessTokenGetResp {
+    private String code;
+    private String msg;
+    private Map<String,Object> data;
+}

+ 46 - 0
src/main/java/com/uas/eis/sdk/samples/AccessTokenDemo.java

@@ -0,0 +1,46 @@
+package com.uas.eis.sdk.samples;
+
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+public class AccessTokenDemo {
+
+    /**
+     * <p>
+     *     这个demo之合适 参数是以query-param形式传参的,如果有body形式传参参考orderDemo
+     *     示例中的 appId,appSecret需要替换成客户自己申请的appId,appSecret endpoint
+     * </p>
+     */
+  /*  public static void main(String[] args) throws Exception {
+        String appId = "ak_SSqCZunXgBcSH";
+        // 如果用postman等其他工具调试时,需要将appSecret用urlencode.encode()进行转义
+        String appSecret = "J6g7uASBoe3+IzayLq5PqY1q4dbAzPJZRMloGxRurGiO0zIMcW0xaLjI90PFfxuaBT4TodwXUsPvxH9R/S6CEXkHTlC5i19g1/CE927r44l0qRVC8tnoWAl7r9kjj+zi0kpKCdN1QS649EB9s/VJhAml7utwakQ68t5SjpYuc1vSJqaQfsAjH1z9f+VbpbX0G2s+VRutk1hRfbNlYLRRNR4CbE7k7/50sVIXNWumoTgGohzj04XfwIERpIjMH6X7LRZIfNB1QiyYmTG6qiy9d3zabm18y9Q8QJkDtv90iGV7SswlSryYjl+s6TBqZnniIkds43L8YQsqcNA5/0OMiA==";
+        Result result = AKRestClientBuild.builder().endpoint("https://openapi.lingxing.com").getAccessToken(appId, appSecret);
+        log.info("token:{}", result);
+
+
+        Map<String, String> map = new HashMap<>();
+        map.put("age", "18");
+        map.put("sex", "nan");
+
+        Map<String, Object> param = new HashMap<>();
+        param.put("number", JSON.toJSONString(map));
+        param.put("id", "1");
+        long timestamp = System.currentTimeMillis() / 1000;
+        Object data = result.getData();
+        Map map1 = (Map) data;
+
+        param.put("timestamp", String.valueOf(timestamp));
+        param.put("access_token", map1.get("access_token"));
+        param.put("app_key", appId);
+        String sign = ApiSign.sign(param, appId);
+        param.put("sign", sign);
+        Object sign1 = AKRestClientBuild.builder().endpoint("https://openapi.lingxing.com").sign(param);
+        log.info("sign:{}", sign1);
+    }*/
+
+}

+ 55 - 0
src/main/java/com/uas/eis/sdk/samples/OrderDemo.java

@@ -0,0 +1,55 @@
+package com.uas.eis.sdk.samples;
+
+import com.alibaba.fastjson.JSON;
+/*import com.asinking.com.openapi.sdk.core.HttpMethod;
+import com.asinking.com.openapi.sdk.core.HttpRequest;
+import com.asinking.com.openapi.sdk.core.HttpResponse;
+import com.asinking.com.openapi.sdk.entity.Result;
+import com.asinking.com.openapi.sdk.okhttp.AKRestClientBuild;
+import com.asinking.com.openapi.sdk.okhttp.HttpExecutor;
+import com.asinking.com.openapi.sdk.sign.AesUtil;
+import com.asinking.com.openapi.sdk.sign.ApiSign;*/
+import lombok.extern.slf4j.Slf4j;
+
+import java.net.URLDecoder;
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+public class OrderDemo {
+
+   /* public static void main(String[] args) throws Exception {
+        String appId = "ak_tVrFm2icLt3o0";
+
+        Map<String, Object> queryParam = new HashMap<>();
+        queryParam.put("timestamp", System.currentTimeMillis() / 1000 + "");
+        queryParam.put("access_token", "9faf5449-603c-467f-82d0-49858e49e43c");
+        queryParam.put("app_key", appId);
+
+        Map<String, Object> body = new HashMap<>();
+        body.put("sid", 1);
+        body.put("start_date", "2021-07-03");
+        body.put("end_date", "2021-08-04");
+
+        Map<String, Object> signMap = new HashMap<>();
+        signMap.putAll(queryParam);
+        signMap.putAll(body);
+
+        String sign = ApiSign.sign(signMap, appId);
+        queryParam.put("sign", sign);
+        log.info("sign:{}", sign);
+
+        HttpRequest<Object> build = HttpRequest.builder(Object.class)
+                .method(HttpMethod.POST)
+                .endpoint("https://openapi.lingxing.com")
+                .path("erp/sc/data/mws_report/allOrders")
+                .queryParams(queryParam)
+                .json(JSON.toJSONString(body))
+                .build();
+        HttpResponse execute = HttpExecutor.create().execute(build);
+        log.info("execute:{}", execute.readEntity(Object.class));
+        }
+        */
+
+
+}

+ 108 - 0
src/main/java/com/uas/eis/sdk/sign/AesUtil.java

@@ -0,0 +1,108 @@
+package com.uas.eis.sdk.sign;
+
+import org.apache.commons.codec.binary.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import java.security.SecureRandom;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public class AesUtil {
+
+    private static final Logger logger = LoggerFactory.getLogger(AesUtil.class);
+
+    private AesUtil() {
+    }
+
+    private static final String ECB_MODE = "AES/ECB/PKCS5PADDING";
+
+    private static final String PREFIX = "ak_";
+
+    private static final String[] CHARSET = new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E",
+            "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c",
+            "d", "e", "f", "g", "h", "i", "g", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
+
+    private static final SecureRandom SECURE_RANDOM = new SecureRandom();
+
+    /**
+     * <p>
+     * 生成16位的appKey
+     * </p>
+     *
+     * @return appKey
+     */
+    public static String getAppKey() {
+        List<String> list = Arrays.asList(CHARSET);
+        // 打乱排序
+        Collections.shuffle(list);
+        StringBuilder builder = new StringBuilder();
+        builder.append(PREFIX);
+        for (int index = 0; index < 13; index++) {
+            builder.append(list.get(SECURE_RANDOM.nextInt(list.size())));
+        }
+        return builder.toString();
+    }
+
+    /**
+     * 取4位随机数
+     *
+     * @return random
+     */
+    public static String getRandom(int pos) {
+        List<String> list = Arrays.asList(CHARSET);
+        // 打乱排序
+        Collections.shuffle(list);
+        StringBuilder builder = new StringBuilder();
+        for (int index = 0; index < pos; index++) {
+            builder.append(list.get(SECURE_RANDOM.nextInt(list.size())));
+        }
+        return builder.toString();
+    }
+
+    /**
+     * <p>
+     * aes加密采用ecb模式,填充方式为pkcs5padding
+     * 其中cbc模式需要有向量iv
+     * </p>
+     *
+     * @param password 密码
+     * @param appKey   生成的16位appKey
+     * @return aes加密的密码
+     */
+    public static String encryptEcb(String password, String appKey) {
+        try {
+            SecretKeySpec spec = new SecretKeySpec(appKey.getBytes(), "AES");
+            Cipher cipher = Cipher.getInstance(ECB_MODE);
+            cipher.init(Cipher.ENCRYPT_MODE, spec);
+            byte[] encrypted = cipher.doFinal(password.getBytes());
+            return Base64.encodeBase64String(encrypted);
+        } catch (Exception ex) {
+            logger.error("encrypt ecb error.", ex);
+        }
+        return "";
+    }
+
+    /**
+     * aes ecb解密
+     *
+     * @param encrypted aes ecb加密后的密码
+     * @param appKey    生成的16位appKey
+     * @return password
+     */
+    public static String decryptEcb(String encrypted, String appKey) {
+        try {
+            SecretKeySpec spec = new SecretKeySpec(appKey.getBytes(), "AES");
+            Cipher cipher = Cipher.getInstance(ECB_MODE);
+            cipher.init(Cipher.DECRYPT_MODE, spec);
+            byte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));
+            return new String(original);
+        } catch (Exception ex) {
+            logger.error("decrypt ecb error.", ex);
+        }
+        return "";
+    }
+}

+ 36 - 0
src/main/java/com/uas/eis/sdk/sign/ApiSign.java

@@ -0,0 +1,36 @@
+package com.uas.eis.sdk.sign;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Map;
+
+public class ApiSign {
+
+    private static final Logger logger = LoggerFactory.getLogger(ApiSign.class);
+
+    public static String sign(Map<String, Object> params, String appSecret) {
+        // 参数排序
+        String[] keys = params.keySet().toArray(new String[0]);
+        Arrays.sort(keys);
+        StringBuilder paramNameValue = new StringBuilder();
+        for (String key : keys) {
+            String value = String.valueOf(params.get(key));
+            if (StringUtils.hasText(key) &&  StringUtils.hasText(value)) {
+                paramNameValue.append(key).append("=").append(value.trim()).append("&");
+            }
+        }
+        String paramValue = paramNameValue.toString();
+        if (paramValue.endsWith("&")) {
+            paramValue = paramValue.substring(0, paramValue.length() - 1);
+        }
+        // md5加密
+        String md5Hex = DigestUtils.md5Hex(paramValue.getBytes(StandardCharsets.UTF_8)).toUpperCase();
+        logger.info("params append: {},md5Hex:{}", paramValue, md5Hex);
+        return AesUtil.encryptEcb(md5Hex, appSecret);
+    }
+}

+ 17 - 0
src/main/java/com/uas/eis/service/LingxingService.java

@@ -0,0 +1,17 @@
+package com.uas.eis.service;
+
+/**
+ * @author: zhouy
+ * @date: 2021/9/16 16:39
+ * @desc:
+ * https://csbd.w.eolinker.com/#/share/index?shareCode=YMPaGu
+ * 访问秘钥:nJ5QvgmVRPaCP1My
+ *
+ * https://csbd.w.eolinker.com/#/share/project/api/?groupID=-1&shareCode=4k6NYb&shareToken=$2y$10$gs1s62Vl.tZywl~2F9M.uaMeTc~2FJniR.lLSy4i2OW9vka0N~2FTvibCF2&shareID=215514
+ */
+public interface LingxingService {
+    //获取店铺信息
+    void getSellers(String appId);
+    //获取订单信息
+    void getSellerOrders(String appId);
+}

+ 58 - 0
src/main/java/com/uas/eis/serviceImpl/LingxingServiceImpl.java

@@ -0,0 +1,58 @@
+package com.uas.eis.serviceImpl;
+
+import com.uas.eis.config.LingXingConfig;
+import com.uas.eis.sdk.entity.Result;
+import com.uas.eis.sdk.okhttp.AKRestClient;
+import com.uas.eis.sdk.resp.AccessTokenGetResp;
+import com.uas.eis.service.LingxingService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author: zhouy
+ * @date: 2021/9/16 16:51
+ * @desc:
+ */
+@Service
+public class LingxingServiceImpl implements LingxingService {
+    @Resource
+    private LingXingConfig lingXingConfig;
+
+    @Override
+    public void getSellers(String appId) {
+        String appSecret = lingXingConfig.getApps().get(appId);
+        try {
+            /**
+             * 获取Token
+             * */
+            AccessTokenGetResp accessTokenGetResp = AKRestClient.builder().endpoint(lingXingConfig.getApiUrl()).build().getAccessToken(appId, appSecret);
+            System.out.println(accessTokenGetResp.getData());
+            /**
+             * 获取店铺信息
+             * */
+           /* Object o = AKRestClient.builder().endpoint(lingXingConfig.getApiUrl()).build().getSellers(appId,
+                    String.valueOf(accessTokenGetResp.getData().get("access_token")) );*/
+
+            Map<String ,Object> requestParam = new HashMap<>();
+            requestParam.put("sid", 1);
+            requestParam.put("start_date", "2021-07-03");
+            requestParam.put("end_date", "2021-08-04");
+
+             Object o = AKRestClient.builder().endpoint(lingXingConfig.getApiUrl()).build().getSellerOrders(appId,
+                    String.valueOf(accessTokenGetResp.getData().get("access_token")), requestParam);
+
+            System.out.println(o);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void getSellerOrders(String appId) {
+
+    }
+}

+ 22 - 0
src/main/java/com/uas/eis/task/LingxingTask.java

@@ -0,0 +1,22 @@
+package com.uas.eis.task;
+
+import com.uas.eis.dao.BaseDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author: zhouy
+ * @date: 2021/9/16 9:11
+ * @desc: 亚马逊对接
+ */
+@Component
+public class LingxingTask {
+
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private BaseDao baseDao;
+
+}

+ 6 - 1
src/main/resources/application.yml

@@ -4,7 +4,7 @@ spring:
         driverClassName: oracle.jdbc.OracleDriver
         username: FANT_T
         password: select!#%*(
-        url: jdbc:oracle:thin:@127.0.0.1:1521:orcl
+        url: jdbc:oracle:thin:@usoft.f3322.net:11642:orcl
     http:
         encoding:
             force: true
@@ -21,3 +21,8 @@ server:
 action:
     api_action: /EIS/api
     public_actions: /EIS/logout,/EIS/hello1
+
+extral:
+    lingxing:
+        apps: {'ak_lZl4KJ3zHdBga':'UlmX06g1tl1g9LPvYAfpbH6825rTAnAoihH2NgdEH/kENYPDJjpwTMvC3AmO1EULR3ZsfzigF1AZ+Lcud6V80KlunahhonEZpkGfGNVm6h+FQCNXGGlqU8cbPZeuUqiw0AbTAG94oD3mpQ7OcOjmt9hkCnIMYZidYLPoGvSkPwoH9reK2HgYclAaJp6M6yT5E1NWLW2+f2ynsZCjzapzcUK71jtUPoza2Ty/SOD79SFDbO8HVfnDyAoBmEais/URE8qOJjCSVdxI+4LJBwTOx5ksraI7vGd4Rozda6nez6/kbjTdfenBe7Eb8wit2xqI1Den5pZesDSpSvldhZ3Gvw==', 'ak_YnORczCAW4WXM':'dtWemTK9KCZct9p34WrFj/ver5+mWEtQsIMn+HDRcd8z0dPxvu/irRJBhFpfhvsqW/MjdrIhCs2ymhGSikgOpaNaY/LdZCzzNlQ1rBgt7d3VJgJjAZMNHM2TMEmjo2puLoDPosIbQ7+yCOpK2JP9i04TuFLX/7IfsnR1TYUNchZtYoboHaPkPxOkyFWLOlcGtEXeh6j+ZYbYY2eVQ0LrmPpKJHGKP7Mu5C0cjDo80W1mOCDEA8XB0nIvrMo3F/YWVUt5LiSMluVbUCk08ipe+3MoA/dFGwt+/Ir0WDnZc4Ynp7gay6x+5fvV/gniffumnz7s7fd6cVu2adudK0/xCw=='}
+        apiUrl: 'https://openapi.lingxing.com'

+ 7 - 2
src/test/java/com/uas/eis/UasEisApplicationTests.java

@@ -1,16 +1,21 @@
 package com.uas.eis;
 
+import com.uas.eis.service.LingxingService;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
-@SpringBootTest
+@SpringBootTest(classes = {UasEisApplication.class})
 public class UasEisApplicationTests {
+	@Autowired
+	private LingxingService lingxingService;
 
 	@Test
-	public void contextLoads() {
+	public void Test() {
+		lingxingService.getSellers("ak_lZl4KJ3zHdBga");
 	}
 
 }