This commit is contained in:
tanghc
2019-07-28 10:55:43 +08:00
parent 33f00bbc62
commit 17de022e3c
50 changed files with 217 additions and 66 deletions

View File

@@ -1,5 +1,11 @@
# changelog
## 1.13.4
- 修复admin服务列表最后更新时间不显示问题
- 优化上传路由配置逻辑
- 微服务可获得access_token, notify_url参数
## 1.13.3
- 优化参数绑定

View File

@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>

View File

@@ -5,11 +5,11 @@
<parent>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>sop-gateway-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
<packaging>jar</packaging>
<name>sop-gateway-common</name>

View File

@@ -6,7 +6,7 @@ import java.util.Collections;
import java.util.List;
/**
* @author thc
* @author tanghc
*/
@Data
public class BaseServiceRouteInfo<T extends BaseRouteDefinition> {

View File

@@ -14,7 +14,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
/**
* @author thc
* @author tanghc
*/
@Data
public class ConfigLimitDto {

View File

@@ -7,7 +7,7 @@ import lombok.ToString;
import java.util.Objects;
/**
* @author thc
* @author tanghc
*/
@Getter
@Setter

View File

@@ -28,7 +28,7 @@ import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.O
/**
* 修改返回结果
* @author thc
* @author tanghc
*/
public class GatewayModifyResponseGatewayFilter implements GlobalFilter, Ordered {

View File

@@ -25,7 +25,7 @@ import java.util.List;
/**
* 统一异常处理
*
* @author thc
* @author tanghc
*/
public class GatewayExceptionHandler implements ErrorWebExceptionHandler {

View File

@@ -24,7 +24,7 @@ import static java.util.Collections.synchronizedMap;
/**
* 路由存储管理,负责动态更新路由
*
* @author thc
* @author tanghc
*/
@Slf4j
public class GatewayRouteRepository implements ApplicationEventPublisherAware,

View File

@@ -1,12 +1,9 @@
package com.gitee.sop.gatewaycommon.gateway.route;
import com.gitee.sop.gatewaycommon.bean.BaseServiceRouteInfo;
import lombok.Data;
import java.util.List;
/**
* @author thc
* @author tanghc
*/
public class GatewayServiceRouteInfo extends BaseServiceRouteInfo<GatewayRouteDefinition> {
}

View File

@@ -3,7 +3,7 @@ package com.gitee.sop.gatewaycommon.message;
import lombok.Data;
/**
* @author thc
* @author tanghc
*/
@Data
public class ErrorImpl implements Error {

View File

@@ -39,7 +39,7 @@ public class ParamNames {
/** 请求参数的集合,最大长度不限,除公共参数外所有请求参数都必须放在这个参数中传递,具体参照各产品快速接入文档 */
public static String BIZ_CONTENT_NAME = "biz_content";
/** */
/** 时间戳格式 */
public static String TIMESTAMP_PATTERN = "yyyy-MM-dd HH:mm:ss";
/** 返回sign名称 */

View File

@@ -11,7 +11,6 @@ import com.gitee.sop.gatewaycommon.result.CustomDataNameBuilder;
public class WebappZuulConfiguration extends BaseZuulConfiguration {
static {
ApiConfig.getInstance().setIgnoreValidate(true);
ApiConfig.getInstance().setDataNameBuilder(new CustomDataNameBuilder());
ApiConfig.getInstance().setShowReturnSign(false);
}

View File

@@ -3,7 +3,7 @@ package com.gitee.sop.gatewaycommon.zuul.route;
import com.gitee.sop.gatewaycommon.bean.BaseServiceRouteInfo;
/**
* @author thc
* @author tanghc
*/
public class ZuulServiceRouteInfo extends BaseServiceRouteInfo<ZuulRouteDefinition> {
}

View File

@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-registry-api</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@@ -3,7 +3,7 @@ package com.gitee.sop.registryapi.bean;
import lombok.Data;
/**
* @author thc
* @author tanghc
*/
@Data
public class ServiceInstance {
@@ -32,4 +32,9 @@ public class ServiceInstance {
*/
private String status;
/**
* 更新时间
*/
private String updateTime;
}

View File

@@ -9,6 +9,8 @@ import java.util.List;
* @author tanghc
*/
public interface RegistryService {
String TIMESTAMP_PATTERN = "yyyy-MM-dd HH:mm:ss";
/**
* 获取所有服务列表
*

View File

@@ -13,12 +13,14 @@ import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
@@ -28,7 +30,7 @@ import java.util.List;
@Slf4j
public class RegistryServiceEureka implements RegistryService {
OkHttpClient client = new OkHttpClient();
private OkHttpClient client = new OkHttpClient();
@Value("${registry.eureka-server-addr:}")
private String eurekaUrl;
@@ -56,6 +58,8 @@ public class RegistryServiceEureka implements RegistryService {
serviceInstance.setIp(eurekaInstance.getIpAddr());
serviceInstance.setPort(Integer.valueOf(eurekaInstance.fetchPort()));
serviceInstance.setStatus(eurekaInstance.getStatus());
Date updateTime = new Date(Long.valueOf(eurekaInstance.getLastUpdatedTimestamp()));
serviceInstance.setUpdateTime(DateFormatUtils.format(updateTime, TIMESTAMP_PATTERN));
serviceInfo.getInstances().add(serviceInstance);
}
}

View File

@@ -6,11 +6,11 @@
<parent>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>sop-service-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
<packaging>jar</packaging>
<name>sop-service-common</name>

View File

@@ -71,4 +71,16 @@ public interface OpenContext<T> {
*/
Date getTimestamp();
/**
* 返回token即access_token
* @return 返回token
*/
String appAuthToken();
/**
* 返回回调地址
* @return 返回回调地址
*/
String getNotifyUrl();
}

View File

@@ -1,16 +1,21 @@
package com.gitee.sop.servercommon.bean;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import java.text.ParseException;
import java.util.Date;
import static com.gitee.sop.servercommon.bean.ParamNames.API_NAME;
import static com.gitee.sop.servercommon.bean.ParamNames.APP_AUTH_TOKEN_NAME;
import static com.gitee.sop.servercommon.bean.ParamNames.APP_KEY_NAME;
import static com.gitee.sop.servercommon.bean.ParamNames.BIZ_CONTENT_NAME;
import static com.gitee.sop.servercommon.bean.ParamNames.CHARSET_NAME;
import static com.gitee.sop.servercommon.bean.ParamNames.FORMAT_NAME;
import static com.gitee.sop.servercommon.bean.ParamNames.NOTIFY_URL_NAME;
import static com.gitee.sop.servercommon.bean.ParamNames.SIGN_TYPE_NAME;
import static com.gitee.sop.servercommon.bean.ParamNames.TIMESTAMP_NAME;
import static com.gitee.sop.servercommon.bean.ParamNames.TIMESTAMP_PATTERN;
import static com.gitee.sop.servercommon.bean.ParamNames.VERSION_NAME;
/**
@@ -73,6 +78,21 @@ public class OpenContextImpl<T> implements OpenContext<T> {
@Override
public Date getTimestamp() {
return rootJsonObject.getDate(TIMESTAMP_NAME);
String timestampStr = rootJsonObject.getString(TIMESTAMP_NAME);
try {
return DateUtils.parseDate(timestampStr, TIMESTAMP_PATTERN);
} catch (ParseException e) {
return null;
}
}
@Override
public String appAuthToken() {
return rootJsonObject.getString(APP_AUTH_TOKEN_NAME);
}
@Override
public String getNotifyUrl() {
return rootJsonObject.getString(NOTIFY_URL_NAME);
}
}

View File

@@ -12,6 +12,7 @@ package com.gitee.sop.servercommon.bean;
* sign String 是 344 商户请求参数的签名串,详见签名 详见示例
* timestamp String 是 19 发送请求的时间,格式"yyyy-MM-dd HH:mm:ss" 2014-07-24 03:07:50
* version String 是 3 调用的接口版本固定为1.0 1.0
* notify_url String 否 256 支付宝服务器主动通知商户服务器里指定的页面http/https路径。 http://api.test.alipay.net/atinterface/receive_notify.htm
* app_auth_token String 否 40 详见应用授权概述
* biz_content String 是 请求参数的集合,最大长度不限,除公共参数外所有请求参数都必须放在这个参数中传递,具体参照各产品快速接入文档
*
@@ -34,12 +35,14 @@ public class ParamNames {
public static String TIMESTAMP_NAME = "timestamp";
/** 调用的接口版本 */
public static String VERSION_NAME = "version";
/** 开放平台主动通知商户服务器里指定的页面http/https路径 */
public static String NOTIFY_URL_NAME = "notify_url";
/** OAuth 2.0授权token */
public static String APP_AUTH_TOKEN_NAME = "app_auth_token";
/** 请求参数的集合,最大长度不限,除公共参数外所有请求参数都必须放在这个参数中传递,具体参照各产品快速接入文档 */
public static String BIZ_CONTENT_NAME = "biz_content";
/** */
/** 时间戳格式 */
public static String TIMESTAMP_PATTERN = "yyyy-MM-dd HH:mm:ss";

View File

@@ -1,5 +1,7 @@
package com.gitee.sop.servercommon.bean;
import com.gitee.sop.servercommon.exception.ZookeeperOperationException;
import com.gitee.sop.servercommon.exception.ZookeeperPathNotExistException;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
@@ -47,6 +49,25 @@ public class ZookeeperTool implements Closeable {
this.client = client;
}
/**
* 获取节点内容
*
* @param path
* @return 返回节点内容
* @throws ZookeeperPathNotExistException 节点不存在,抛出异常
*/
public String getData(String path) throws ZookeeperPathNotExistException {
if (!isPathExist(path)) {
throw new ZookeeperPathNotExistException("path 不存在, path=" + path);
}
try {
byte[] data = getClient().getData().forPath(path);
return new String(data);
} catch (Exception e) {
throw new ZookeeperOperationException("getData error path=" + path, e);
}
}
public boolean isPathExist(String path) {
try {
return client.checkExists().forPath(path) != null;

View File

@@ -13,7 +13,7 @@ import java.util.Map;
/**
* 文档支持
* @author thc
* @author tanghc
*/
public abstract class EasyopenDocSupportController {

View File

@@ -10,6 +10,7 @@ public class WebappServiceConfiguration extends BaseServiceConfiguration {
static {
// 默认版本号为1.0
ServiceConfig.getInstance().setDefaultVersion("1.0");
ServiceConfig.getInstance().setIgnoreValidate(true);
ServiceConfig.getInstance().setWebappMode(true);
}
}

View File

@@ -0,0 +1,26 @@
package com.gitee.sop.servercommon.exception;
/**
* @author tanghc
*/
public class ZookeeperOperationException extends RuntimeException {
public ZookeeperOperationException() {
}
public ZookeeperOperationException(String message) {
super(message);
}
public ZookeeperOperationException(String message, Throwable cause) {
super(message, cause);
}
public ZookeeperOperationException(Throwable cause) {
super(cause);
}
public ZookeeperOperationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}

View File

@@ -0,0 +1,10 @@
package com.gitee.sop.servercommon.exception;
/**
* @author tanghc
*/
public class ZookeeperPathNotExistException extends Exception {
public ZookeeperPathNotExistException(String message) {
super(message);
}
}

View File

@@ -2,8 +2,8 @@ package com.gitee.sop.servercommon.manager;
import com.alibaba.fastjson.JSON;
import com.gitee.sop.servercommon.bean.ServiceApiInfo;
import com.gitee.sop.servercommon.bean.ServiceConstants;
import com.gitee.sop.servercommon.bean.ZookeeperTool;
import com.gitee.sop.servercommon.exception.ZookeeperPathNotExistException;
import com.gitee.sop.servercommon.route.GatewayRouteDefinition;
import com.gitee.sop.servercommon.route.ServiceRouteInfo;
import lombok.Getter;
@@ -12,11 +12,15 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.core.env.Environment;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 上传路由到zookeeper
@@ -28,13 +32,10 @@ import java.util.List;
@Setter
public class ServiceZookeeperApiMetaManager implements ApiMetaManager {
/**
* zookeeper存放接口路由信息的根目录
*/
public static final String SOP_SERVICE_ROUTE_PATH = ServiceConstants.SOP_SERVICE_ROUTE_PATH;
public static final String PATH_SPLIT = "/";
/** 网关对应的LoadBalance协议 */
private static final String PROTOCOL_LOAD_BALANCE = "lb://";
private final String routeRootPath = SOP_SERVICE_ROUTE_PATH;
private static final String PATH_SPLIT = "/";
private Environment environment;
@@ -56,16 +57,16 @@ public class ServiceZookeeperApiMetaManager implements ApiMetaManager {
/**
* 上传serviceId目录
*
* @param environment
* @param environment environment
*/
protected void uploadServiceId(Environment environment) {
try {
this.checkZookeeperNode(serviceId, "serviceId" + serviceId + ")不能有斜杠字符'/'");
ServiceRouteInfo serviceRouteInfo = this.buildServiceRouteInfo();
// 保存路径
String savePath = routeRootPath + "/" + serviceId;
String savePath = serviceRouteInfo.getZookeeperPath();
String nodeData = JSON.toJSONString(serviceRouteInfo);
log.info("zookeeper创建serviceId路径path:{}, nodeData:{}", savePath, nodeData);
log.info("serviceId:{}, zookeeper保存路径:{}", serviceId, savePath);
this.zookeeperTool.createPath(savePath, nodeData);
} catch (Exception e) {
throw new IllegalStateException("zookeeper操作失败");
@@ -85,7 +86,7 @@ public class ServiceZookeeperApiMetaManager implements ApiMetaManager {
/**
* 构建接口信息符合spring cloud gateway的格式
*
* @param serviceApiInfo
* @param serviceApiInfo 服务接口信息
* @return 返回服务路由信息
*/
protected ServiceRouteInfo buildServiceGatewayInfo(ServiceApiInfo serviceApiInfo) {
@@ -97,9 +98,26 @@ public class ServiceZookeeperApiMetaManager implements ApiMetaManager {
}
ServiceRouteInfo serviceRouteInfo = this.buildServiceRouteInfo();
serviceRouteInfo.setRouteDefinitionList(routeDefinitionList);
String md5 = buildMd5(routeDefinitionList);
serviceRouteInfo.setMd5(md5);
return serviceRouteInfo;
}
/**
* 构建路由id MD5
*
* @param routeDefinitionList 路由列表
* @return 返回MD5
*/
protected String buildMd5(List<GatewayRouteDefinition> routeDefinitionList) {
List<String> routeIdList = routeDefinitionList.stream()
.map(GatewayRouteDefinition::toString)
.sorted()
.collect(Collectors.toList());
String md5Source = org.apache.commons.lang3.StringUtils.join(routeIdList, "");
return DigestUtils.md5DigestAsHex(md5Source.getBytes(StandardCharsets.UTF_8));
}
protected ServiceRouteInfo buildServiceRouteInfo() {
ServiceRouteInfo serviceRouteInfo = new ServiceRouteInfo();
serviceRouteInfo.setServiceId(serviceId);
@@ -110,9 +128,9 @@ public class ServiceZookeeperApiMetaManager implements ApiMetaManager {
protected GatewayRouteDefinition buildGatewayRouteDefinition(ServiceApiInfo serviceApiInfo, ServiceApiInfo.ApiMeta apiMeta) {
GatewayRouteDefinition gatewayRouteDefinition = new GatewayRouteDefinition();
// 唯一id规则接口名 + 版本号
String routeId = apiMeta.fetchNameVersion();
this.checkZookeeperNode(routeId, "接口定义(" + routeId + ")不能有斜杠字符'/'");
// 唯一id规则接口名 + 版本号
BeanUtils.copyProperties(apiMeta, gatewayRouteDefinition);
gatewayRouteDefinition.setId(routeId);
gatewayRouteDefinition.setFilters(Collections.emptyList());
@@ -124,7 +142,7 @@ public class ServiceZookeeperApiMetaManager implements ApiMetaManager {
}
protected String buildUri(ServiceApiInfo serviceApiInfo, ServiceApiInfo.ApiMeta apiMeta) {
return "lb://" + serviceApiInfo.getServiceId();
return PROTOCOL_LOAD_BALANCE + serviceApiInfo.getServiceId();
}
protected String buildServletPath(ServiceApiInfo serviceApiInfo, ServiceApiInfo.ApiMeta apiMeta) {
@@ -141,12 +159,23 @@ public class ServiceZookeeperApiMetaManager implements ApiMetaManager {
/**
* 上传接口信息到zookeeper
*
* @param serviceRouteInfo
* @param serviceRouteInfo 路由服务信息
*/
protected void uploadServiceRouteInfoToZookeeper(ServiceRouteInfo serviceRouteInfo) {
String savePath = serviceRouteInfo.getZookeeperPath();
try {
String existServiceRouteInfoData = zookeeperTool.getData(savePath);
ServiceRouteInfo serviceRouteInfoExist = JSON.parseObject(existServiceRouteInfoData, ServiceRouteInfo.class);
String oldMD5 = serviceRouteInfoExist.getMd5();
String newMD5 = serviceRouteInfo.getMd5();
if (Objects.equals(oldMD5, newMD5)) {
log.info("接口没有改变,无需上传路由信息");
return;
}
} catch (ZookeeperPathNotExistException e) {
log.warn("服务路径不存在path:{}", savePath);
}
try {
// 保存路径
String savePath = routeRootPath + "/" + serviceRouteInfo.getServiceId();
log.info("上传接口信息到zookeeperpath:{}, serviceId{}, 接口数量:{}",
savePath,
serviceRouteInfo.getServiceId(),
@@ -162,12 +191,12 @@ public class ServiceZookeeperApiMetaManager implements ApiMetaManager {
/**
* 上传文件夹内容
*
* @param serviceRouteInfo
* @param serviceRouteInfo 路由服务信息
* @return 返回文件夹路径
*/
protected String uploadFolder(ServiceRouteInfo serviceRouteInfo) throws Exception {
// 保存路径
String savePath = routeRootPath + "/" + serviceRouteInfo.getServiceId();
String savePath = serviceRouteInfo.getZookeeperPath();
String serviceRouteInfoJson = JSON.toJSONString(serviceRouteInfo);
log.info("上传service目录到zookeeper路径:{},内容:{}", savePath, serviceRouteInfoJson);
this.zookeeperTool.createOrUpdateData(savePath, serviceRouteInfoJson);
@@ -177,7 +206,8 @@ public class ServiceZookeeperApiMetaManager implements ApiMetaManager {
/**
* 上传路由信息
*
* @param serviceRouteInfo
* @param serviceRouteInfo 路由服务
* @param parentPath 父节点
* @throws Exception
*/
protected void uploadRouteItems(ServiceRouteInfo serviceRouteInfo, String parentPath) throws Exception {

View File

@@ -8,7 +8,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
/**
* @author thc
* @author tanghc
*/
@Data
public class GatewayPredicateDefinition {

View File

@@ -1,16 +1,19 @@
package com.gitee.sop.servercommon.route;
import com.alibaba.fastjson.annotation.JSONField;
import com.gitee.sop.servercommon.bean.ServiceConstants;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author thc
* @author tanghc
*/
@Data
public class ServiceRouteInfo {
private static final String SOP_SERVICE_ROUTE_PATH = ServiceConstants.SOP_SERVICE_ROUTE_PATH;
/** 服务名称对应spring.application.name */
private String serviceId;
@@ -22,6 +25,18 @@ public class ServiceRouteInfo {
private String description;
/** 路由信息md5md5(sort(routeIdList)) */
private String md5;
@JSONField(serialize = false)
private List<GatewayRouteDefinition> routeDefinitionList;
/**
* 返回zookeeper路径
* @return 返回zookeeper路径
*/
@JSONField(serialize = false)
public String getZookeeperPath() {
return SOP_SERVICE_ROUTE_PATH + '/' + serviceId;
}
}

View File

@@ -11,7 +11,7 @@ import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
/**
* @author thc
* @author tanghc
*/
public abstract class SwaggerSupport {

View File

@@ -26,7 +26,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>

View File

@@ -24,7 +24,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.gitee.sop</groupId>

View File

@@ -29,7 +29,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>

View File

@@ -20,7 +20,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
</dependency>
<!-- eureka 服务发现 -->
<dependency>

View File

@@ -16,7 +16,7 @@ import java.net.UnknownHostException;
/**
* 初始化Eureka Client
* @author thc
* @author tanghc
*/
@Slf4j
public class EurekaInitAndRegisterListener implements ServletContextListener {

View File

@@ -24,7 +24,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.gitee.sop</groupId>

View File

@@ -23,7 +23,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-gateway-common</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
</dependency>
<!-- ↓↓↓ 使用spring cloud zuul ↓↓↓ -->

View File

@@ -14,7 +14,7 @@ import java.io.IOException;
/**
* 传统web开发入口
* @author thc
* @author tanghc
*/
@WebServlet(urlPatterns = "/rest/*")
public class RestServlet extends HttpServlet {

View File

@@ -8,7 +8,7 @@ import java.util.Map;
/**
* 请求form
* @author thc
* @author tanghc
*/
@Getter
@Setter

View File

@@ -2,7 +2,7 @@ package com.gitee.sop.sdk.common;
/**
* 请求方法枚举
* @author thc
* @author tanghc
*/
public enum RequestMethod {

View File

@@ -2,7 +2,7 @@ package com.gitee.sop.sdk.common;
/**
* @deprecated 已废弃使用com.gitee.sop.sdk.common.OpenConfig
* @author thc
* @author tanghc
*/
@Deprecated
public class SdkConfig {

View File

@@ -1,7 +1,7 @@
package com.gitee.sop.sdk.common;
/**
* @author thc
* @author tanghc
*/
public class SopSdkConstants {
public static String DATA_SUFFIX = "_response";

View File

@@ -1,7 +1,7 @@
package com.gitee.sop.sdk.exception;
/**
* @author thc
* @author tanghc
*/
public class SdkException extends RuntimeException {

View File

@@ -32,7 +32,7 @@ import java.util.Map;
*
* @param <T> 对应的Response对象
*
* @author thc
* @author tanghc
*/
public abstract class BaseRequest<T extends BaseResponse> {

View File

@@ -16,7 +16,7 @@ import lombok.Setter;
* },
* "sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
* }
* @author thc
* @author tanghc
*/
@Setter
@Getter

View File

@@ -9,7 +9,7 @@ import java.io.InputStream;
/**
* 文件工具类
* @author thc
* @author tanghc
*/
public class FileUtil {

View File

@@ -2,7 +2,7 @@ package com.gitee.sop.sdk.util;
/**
* hex工具类
* @author thc
* @author tanghc
*/
public class HexUtil {
private static final String ZERO = "0";

View File

@@ -4,7 +4,7 @@ import java.security.MessageDigest;
/**
* MD5工具类
* @author thc
* @author tanghc
*/
public class MD5Util {

View File

@@ -25,7 +25,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-registry-api</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.13.4-SNAPSHOT</version>
</dependency>
<dependency>