Commit ae0d95a2 authored by ysongq's avatar ysongq

commit

parents a1813bf4 e3e340bf
...@@ -8,18 +8,18 @@ CREATE TABLE `t_api_interface` ( ...@@ -8,18 +8,18 @@ CREATE TABLE `t_api_interface` (
`api_protocl` varchar(32) DEFAULT NULL COMMENT 'api请求协议:http,https', `api_protocl` varchar(32) DEFAULT NULL COMMENT 'api请求协议:http,https',
`api_path` varchar(100) DEFAULT NULL COMMENT '请求地址', `api_path` varchar(100) DEFAULT NULL COMMENT '请求地址',
`target_url` varchar(100) DEFAULT NULL COMMENT '目标url', `target_url` varchar(100) DEFAULT NULL COMMENT '目标url',
`api_type` varchar(50) NULL DEFAULT '' COMMENT 'api类型:1 数据银行制作API 2 数据银行制作数据包, 3 API实时接入 6 标签查询 9自定义', `api_type` varchar(50) NULL DEFAULT '' COMMENT 'api类型:1 数据银行制作大数据表 2 数据银行制作数据包,3,数据银行制作自定义API 4 API实时接入 6 标签查询 9自定义',
`api_function` varchar(200) DEFAULT NULL COMMENT '接口功能', `api_function` varchar(200) DEFAULT NULL COMMENT '接口功能',
`join_type` varchar(50) NULL DEFAULT NULL COMMENT '接入类型:字典表对应key值', `join_type` varchar(50) NULL DEFAULT NULL COMMENT '接入类型:字典表对应key值',
`test_example` varchar(255) NULL DEFAULT NULL COMMENT '测试实例', `test_example` varchar(255) NULL DEFAULT NULL COMMENT '测试实例',
`status` varchar(50) NOT NULL COMMENT '状态(DRAFT-草稿 ISSUE-发布 OUTMODED-过时 4FREEZE-冻结 EXPIRY-失效)', `status` varchar(50) NOT NULL COMMENT '状态(DRAFT-草稿 ISSUE-发布 OUTMODED-过时 4FREEZE-冻结 EXPIRY-失效)',
`output_type` varchar(50) NULL DEFAULT 'JSON' COMMENT '输出类型:flow 流形式输出, json格式输出', `output_type` varchar(50) NULL DEFAULT 'JSON' COMMENT '输出类型:flow 流形式输出, json格式输出',
`page` tinyint(2) NULL DEFAULT '0' COMMENT '是否分页:0 false ,1 true', `page` tinyint(2) NULL DEFAULT '0' COMMENT '是否分页:0 false ,1 true',
`version` varchar(20) DEFAULT '1.0' COMMENT '版本号', `version` varchar(20) DEFAULT 'v1.0' COMMENT '版本号',
`sign_type` varchar(50) DEFAULT NULL COMMENT '加密方式: MD5 RSA', `sign_type` varchar(50) DEFAULT NULL COMMENT '加密方式: MD5 RSA',
`timeout` varchar(50) DEFAULT NULL COMMENT '超时时间', `timeout` varchar(50) DEFAULT NULL COMMENT '超时时间',
`file_id` bigint(20) NOT NULL COMMENT '文件夹id', `file_id` bigint(20) NOT NULL COMMENT '文件夹id',
`req_type` varchar(20) DEFAULT NULL COMMENT '限类型:DAY 按天,MONTH 按月, YEAR 按年', `req_type` varchar(20) DEFAULT NULL COMMENT '限类型:DAY 按天,MONTH 按月, YEAR 按年',
`req_frequency` bigint(20) DEFAULT '100' COMMENT '限制次数', `req_frequency` bigint(20) DEFAULT '100' COMMENT '限制次数',
`is_test` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否测试数据:0 否,1 是', `is_test` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否测试数据:0 否,1 是',
`remark` varchar(500) DEFAULT NULL COMMENT '备注', `remark` varchar(500) DEFAULT NULL COMMENT '备注',
...@@ -38,7 +38,11 @@ CREATE TABLE `t_api_interface_custom` ( ...@@ -38,7 +38,11 @@ CREATE TABLE `t_api_interface_custom` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'api 信息表自增ID', `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'api 信息表自增ID',
`api_key` varchar(200) NOT NULL COMMENT 'api唯一标识', `api_key` varchar(200) NOT NULL COMMENT 'api唯一标识',
`api_interface_id` bigint(20) NOT NULL COMMENT 'api表自增id', `api_interface_id` bigint(20) NOT NULL COMMENT 'api表自增id',
`api_type` varchar(50) DEFAULT '' COMMENT 'api类型:1 实时接入 2 数据银行制作API, 3 数据银行制作数据包 6标签查询 9自定义', `api_type` varchar(50) DEFAULT '' COMMENT 'api类型:1 数据银行制作大数据表 2 数据银行制作数据包,3,数据银行制作自定义API 4 API实时接入 5 DMP标签查询 6.DMP大数据表查询 7 DMP自定义',
`es_data_source` varchar(100) DEFAULT NULL COMMENT '数据源id',
`es_data_base` varchar(100) DEFAULT NULL COMMENT '源数据库名称',
`es_table` varchar(100) DEFAULT NULL COMMENT '源数据表名称',
`handle_type` varchar(50) DEFAULT NULL COMMENT '处理类型',
`request_param` varchar(300) DEFAULT NULL COMMENT '请求参数', `request_param` varchar(300) DEFAULT NULL COMMENT '请求参数',
`response_param` varchar(300) DEFAULT NULL COMMENT '响应参数', `response_param` varchar(300) DEFAULT NULL COMMENT '响应参数',
`req_headers` varchar(300) DEFAULT NULL COMMENT '请求头', `req_headers` varchar(300) DEFAULT NULL COMMENT '请求头',
...@@ -105,7 +109,7 @@ CREATE TABLE `t_api_auth` ( ...@@ -105,7 +109,7 @@ CREATE TABLE `t_api_auth` (
`api_interface_id` bigint(20) NOT NULL COMMENT 'api信息表id', `api_interface_id` bigint(20) NOT NULL COMMENT 'api信息表id',
`api_org_id` bigint(20) NOT NULL COMMENT 'api组织id', `api_org_id` bigint(20) NOT NULL COMMENT 'api组织id',
`auth_type` varchar(20) DEFAULT NULL COMMENT '授权类型:DATA_BANK_AUTH 数据银行购买 DMP_AUTH dmp授权', `auth_type` varchar(20) DEFAULT NULL COMMENT '授权类型:DATA_BANK_AUTH 数据银行购买 DMP_AUTH dmp授权',
`req_type` varchar(20) DEFAULT NULL COMMENT '限类型:DAY 按天,MONTH 按月, YEAR 按年', `req_type` varchar(20) DEFAULT NULL COMMENT '限类型:DAY 按天,MONTH 按月, YEAR 按年',
`req_frequency` bigint(20) DEFAULT '100' COMMENT '限制次数', `req_frequency` bigint(20) DEFAULT '100' COMMENT '限制次数',
`auth_code` varchar(100) DEFAULT NULL COMMENT '授权码', `auth_code` varchar(100) DEFAULT NULL COMMENT '授权码',
`salt` varchar(200) DEFAULT NULL COMMENT '盐值', `salt` varchar(200) DEFAULT NULL COMMENT '盐值',
......
...@@ -25,4 +25,5 @@ public class ApiGatewayApplication { ...@@ -25,4 +25,5 @@ public class ApiGatewayApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(ApiGatewayApplication.class, args); SpringApplication.run(ApiGatewayApplication.class, args);
} }
} }
package com.jz.dm.common.base;
import com.jz.common.bean.SysUserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.common.base
* @PROJECT_NAME: jz-dm-parent
* @NAME: BaseCurrentUserObject
* @DATE: 2020-12-30/16:05
* @DAY_NAME_SHORT: 周三
* @Description: 获取当前登录用户
**/
@Component
public class BaseCurrentUserObject {
@Autowired
private RedisTemplate redisTemplate;
/**
* 获取登录用户
*
* @return
*/
public SysUserDto getUserInfo() {
SysUserDto sysUserDto = (SysUserDto) redisTemplate.opsForValue().get("USER" + "004");//RedisMessageConstant.SENDTYPE_LOGIN_SYS);
return sysUserDto;
}
//SysUserDto currentUser = (SysUserDto)
// redisTemplate.opsForValue().get("user" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
/*public static void main(String[] args) {
System.out.println(new BaseCurrentUserObject().getUserInfo());
}*/
}
...@@ -48,4 +48,13 @@ public enum GeneralStatusTypeEnum { ...@@ -48,4 +48,13 @@ public enum GeneralStatusTypeEnum {
public String getText() { public String getText() {
return text; return text;
} }
public static GeneralStatusTypeEnum fromGeneralStatus(String typeName) {
for (GeneralStatusTypeEnum type : GeneralStatusTypeEnum.values()) {
if (type.name().equals(typeName)) {
return type;
}
}
return null;
}
} }
...@@ -26,15 +26,13 @@ public class MapUtil { ...@@ -26,15 +26,13 @@ public class MapUtil {
* @param apiKey * @param apiKey
* @param method * @param method
* @param signType * @param signType
* @param timestamp
* @return * @return
*/ */
public static String getSignValue(String apiKey,String method,String signType,String timestamp){ public static String getSignValue(String apiKey,String method,String signType){
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("apiKey=").append(apiKey).append(LoggingConstants.AND_SPILT) builder.append("apiKey=").append(apiKey).append(LoggingConstants.AND_SPILT)
.append("method=").append(method).append(LoggingConstants.AND_SPILT) .append("method=").append(method).append(LoggingConstants.AND_SPILT)
.append("signType=").append(signType).append(LoggingConstants.AND_SPILT) .append("signType=").append(signType);
.append("timestamp=").append(timestamp);
return builder.toString(); return builder.toString();
} }
......
package com.jz.dm.common.util;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.common.util
* @PROJECT_NAME: jz-dm-parent
* @NAME: RedisSerializableUtil
* @DATE: 2021-1-12/18:26
* @DAY_NAME_SHORT: 周二
* @Description:
**/
public class RedisSerializableUtil {
/**
* 序列化
* @param object
*/
public static byte[] serialize(Object object) {
ObjectOutputStream oos = null;
ByteArrayOutputStream baos = null;
try {
// 序列化
baos = new ByteArrayOutputStream();
oos = new ObjectOutputStream(baos);
oos.writeObject(object);
byte[] bytes = baos.toByteArray();
return bytes;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 反序列化
* @param bytes
*/
public static Object unserialize(byte[] bytes) {
ByteArrayInputStream bais = null;
try {
// 反序列化
bais = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(bais);
return ois.readObject();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
...@@ -25,7 +25,6 @@ import java.util.Map; ...@@ -25,7 +25,6 @@ import java.util.Map;
* @author zc * @author zc
*/ */
@RestController @RestController
@RequestMapping("api")
@Api(tags = {"api请求controller"}) @Api(tags = {"api请求controller"})
public class GatewayController { public class GatewayController {
......
...@@ -74,13 +74,13 @@ public class OrganizationManageController { ...@@ -74,13 +74,13 @@ public class OrganizationManageController {
return Mono.fromSupplier(() -> organizationManageService.update(req)); return Mono.fromSupplier(() -> organizationManageService.update(req));
} }
/** /**
* @Description:删除组织 * @Description:注销组织
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-24 * @Date: 2020-12-24
*/ */
@ApiOperation("删除组织") @ApiOperation("注销组织")
@GetMapping(value = "/deleted") @GetMapping(value = "/logoutOrg")
public Mono<Result> delete(@RequestParam(name = "id")Long id) { public Mono<Result> delete(@RequestParam(name = "id")Long id) {
return Mono.fromSupplier(() -> organizationManageService.delete(id)); return Mono.fromSupplier(() -> organizationManageService.logoutOrg(id));
} }
} }
...@@ -30,11 +30,11 @@ public class ProducerController { ...@@ -30,11 +30,11 @@ public class ProducerController {
/** /**
* @Description:Api制作(自定义) * @Description:获取文件夹列表
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
*/ */
@ApiOperation("Api制作(获取文件夹列表)") @ApiOperation("获取文件夹列表")
@GetMapping(value = "/getFileCatalog") @GetMapping(value = "/getFileCatalog")
public Mono<Result> getFileCatalog(@RequestParam(name = "projectId")Long projectId, public Mono<Result> getFileCatalog(@RequestParam(name = "projectId")Long projectId,
@RequestParam(name = "pageNum",defaultValue = "1",required = false)String pageNum, @RequestParam(name = "pageNum",defaultValue = "1",required = false)String pageNum,
...@@ -42,11 +42,23 @@ public class ProducerController { ...@@ -42,11 +42,23 @@ public class ProducerController {
return Mono.fromSupplier(() -> Result.of_success(producerService.getFileCatalog(projectId,pageNum,pageSize))); return Mono.fromSupplier(() -> Result.of_success(producerService.getFileCatalog(projectId,pageNum,pageSize)));
} }
/** /**
* @Description:Api制作(自定义) * @Description:创建文件夹
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
*/ */
@ApiOperation("Api制作(自定义)") @ApiOperation("创建项目文件夹")
@PostMapping(value = "/createProjectFolder")
public Mono<Result> createProjectFolder(@RequestParam(name = "projectId")Long projectId,
@RequestParam(name = "parentId")Long parentId,
@RequestParam(name = "currentUser") String currentUser ) {
return Mono.fromSupplier(() -> producerService.createProjectFolder(projectId,parentId,currentUser));
}
/**
* @Description:Api制作(自定义DMP)
* @Author: Mr.zhang
* @Date: 2020-12-26
*/
@ApiOperation("Api制作(自定义DMP)")
@PostMapping(value = "/addCustomApi") @PostMapping(value = "/addCustomApi")
public Mono<Result> makeCustomApi(@RequestBody @Valid ApiInterfaceReq req) { public Mono<Result> makeCustomApi(@RequestBody @Valid ApiInterfaceReq req) {
return Mono.fromSupplier(() -> Result.of_success(producerService.addCustomApi(req))); return Mono.fromSupplier(() -> Result.of_success(producerService.addCustomApi(req)));
...@@ -86,7 +98,7 @@ public class ProducerController { ...@@ -86,7 +98,7 @@ public class ProducerController {
} }
/** /**
* @Description:保存API基本信息 * @Description:保存API基本信息/自定义API
* @return: (保存API基本信息) * @return: (保存API基本信息)
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
...@@ -152,4 +164,17 @@ public class ProducerController { ...@@ -152,4 +164,17 @@ public class ProducerController {
@RequestParam(name = "id") Long id) { @RequestParam(name = "id") Long id) {
return Mono.fromSupplier(() -> producerService.getIndicesTypesFields(indices,type,id)); return Mono.fromSupplier(() -> producerService.getIndicesTypesFields(indices,type,id));
} }
@ApiOperation("保存数据到redis中")
@GetMapping(value = "/saveRedis")
public Result saveObjOnRedis() {
return producerService.saveObjOnRedis();
}
@ApiOperation("获取redis中的数据")
@GetMapping(value = "/getRedisObj")
public Result getObjOnRedis() {
return producerService.getObjOnRedis();
}
} }
...@@ -21,6 +21,7 @@ import com.jz.dm.service.ApiInterfaceService; ...@@ -21,6 +21,7 @@ import com.jz.dm.service.ApiInterfaceService;
import com.jz.dm.service.AuthService; import com.jz.dm.service.AuthService;
import com.jz.dm.service.OrganizationManageService; import com.jz.dm.service.OrganizationManageService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -82,7 +83,7 @@ public class AuthFilter extends AbstractFilter { ...@@ -82,7 +83,7 @@ public class AuthFilter extends AbstractFilter {
JSONObject parameter = JSONObject.parseObject(request.getParams()); JSONObject parameter = JSONObject.parseObject(request.getParams());
if (null != parameter) { if (null != parameter) {
String authCode = parameter.getString("authCode"); String authCode = parameter.getString("authCode");
ApiAuth authAuth = authService.getAuthUser(authCode,apiInterface.getId()); ApiAuth authAuth = authService.getAuthUser(authCode, apiInterface.getId());
if (null == authAuth) { if (null == authAuth) {
throw new GatewayException(GatewayResultCode.REQUEST_NOT_AUTH); throw new GatewayException(GatewayResultCode.REQUEST_NOT_AUTH);
} }
...@@ -95,8 +96,8 @@ public class AuthFilter extends AbstractFilter { ...@@ -95,8 +96,8 @@ public class AuthFilter extends AbstractFilter {
} }
chain.doFilter(request, response); chain.doFilter(request, response);
} catch (Exception e) { } catch (Exception e) {
if (e instanceof GatewayException){ if (e instanceof GatewayException) {
throw(GatewayException) e; throw (GatewayException) e;
} }
log.error("~~~~~~~~~~~~~~~~认证过滤异常~~~~~~~~~~~~~~~~~"); log.error("~~~~~~~~~~~~~~~~认证过滤异常~~~~~~~~~~~~~~~~~");
log.error("异常信息:{}", e.getMessage()); log.error("异常信息:{}", e.getMessage());
...@@ -112,6 +113,7 @@ public class AuthFilter extends AbstractFilter { ...@@ -112,6 +113,7 @@ public class AuthFilter extends AbstractFilter {
/** /**
* 校验计费信息 * 校验计费信息
*
* @param request * @param request
* @param authCode * @param authCode
* @param authAuth * @param authAuth
...@@ -127,24 +129,24 @@ public class AuthFilter extends AbstractFilter { ...@@ -127,24 +129,24 @@ public class AuthFilter extends AbstractFilter {
throw new GatewayException(GatewayResultCode.ORG_STATE_EXCEPTION); throw new GatewayException(GatewayResultCode.ORG_STATE_EXCEPTION);
} }
//查询数据银行银行余额是否充足 //查询数据银行银行余额是否充足
getDataAmountResult(request); //getDataAmountResult(request);
try { //记录请求次数(每天限制请求次数) try { //记录请求次数(每天限制请求次数)
String limitKey = request.getApiKey() + LoggingConstants.AND_SPILT + authCode; String limitKey = request.getApiKey() + LoggingConstants.AND_SPILT + authCode;
String reqKey = redisUtils.get(limitKey); Integer reqValue = (Integer)redisUtils.getObj(limitKey);
long timeOut =0; long timeOut = 0;
if (AuthReqTypeEnum.DAY.name().equals(authAuth.getReqType())){ //按天 if (AuthReqTypeEnum.DAY.name().equals(authAuth.getReqType())) { //按天
timeOut = DateUtil.calculateNowResidueTime(); timeOut = DateUtil.calculateNowResidueTime();
}else if (AuthReqTypeEnum.MONTH.name().equals(authAuth.getReqType())){//按月 } else if (AuthReqTypeEnum.MONTH.name().equals(authAuth.getReqType())) {//按月
timeOut=DateUtil.calculateNowMonthTime(); timeOut = DateUtil.calculateNowMonthTime();
}else if (AuthReqTypeEnum.YEAR.name().equals(authAuth.getReqType())){//按年 } else if (AuthReqTypeEnum.YEAR.name().equals(authAuth.getReqType())) {//按年
//暂时不支持年 //暂时不支持年
} }
if (null != reqKey) { if (null != reqValue && reqValue != 0) {
Integer value = Integer.valueOf(reqKey); // Integer value = Integer.valueOf(reqKey);
if (value > authAuth.getReqFrequency()) {//超出最大请求次数 if (reqValue > authAuth.getReqFrequency()) {//超出最大请求次数
throw new GatewayException(GatewayResultCode.REQUEST_LIMIT_EXCEPTION); throw new GatewayException(GatewayResultCode.REQUEST_LIMIT_EXCEPTION);
} else if (value <= authAuth.getReqFrequency()) { } else if (reqValue <= authAuth.getReqFrequency()) {
redisUtils.delAndAdd(limitKey, limitKey, value + 1, timeOut); redisUtils.delAndAdd(limitKey, limitKey, reqValue + 1, timeOut);
} }
} else { } else {
redisUtils.set(limitKey, 1, timeOut); redisUtils.set(limitKey, 1, timeOut);
...@@ -174,20 +176,27 @@ public class AuthFilter extends AbstractFilter { ...@@ -174,20 +176,27 @@ public class AuthFilter extends AbstractFilter {
/** /**
* 按次调用检查余额是否充足 * 按次调用检查余额是否充足
*
* @param request * @param request
*/ */
private void getDataAmountResult(GatewayRequest request) { private void getDataAmountResult(GatewayRequest request) {
JSONObject params = JSONObject.parseObject(request.getParams()); JSONObject params = JSONObject.parseObject(request.getParams());
if (null != params){ Integer assetsId = params.getInteger("assetsId");
Integer userId = params.getInteger("userId");
String dataPrice = params.getString("dataPrice");
if (null == assetsId || null == userId || StringUtils.isBlank(dataPrice)) {
throw new GatewayException(GatewayResultCode.ILLEGAL_ARGUMENT);
}
if (null != params) {
JSONObject pObject = new JSONObject(); JSONObject pObject = new JSONObject();
pObject.put("assetsId",params.getInteger("assetsId")); pObject.put("assetsId", assetsId);
pObject.put("userId",params.getInteger("userId")); pObject.put("userId", userId);
pObject.put("dataPrice",params.getString("dataPrice")); pObject.put("dataPrice", dataPrice);
String respResult = httpUtils.submitPost(balanceUrl, pObject.toString()); String respResult = httpUtils.submitPost(balanceUrl, pObject.toString());
JSONObject result = JSONObject.parseObject(respResult); JSONObject result = JSONObject.parseObject(respResult);
if (null != result){ if (null != result) {
if (200 !=result.getInteger("code")){ if (200 != result.getInteger("code")) {
log.info("~~~~~~~~~~~~~~~~~~异常信息为:{}",result.getString("message")); log.info("~~~~~~~~~~~~~~~~~~异常信息为:{}", result.getString("message"));
throw new GatewayException(GatewayResultCode.CALL_AMOUNT_NOT_ENOUGH); throw new GatewayException(GatewayResultCode.CALL_AMOUNT_NOT_ENOUGH);
} }
} }
......
package com.jz.dm.filter; package com.jz.dm.filter;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jz.common.utils.Md5;
import com.jz.dm.common.constant.Constants; import com.jz.dm.common.constant.Constants;
import com.jz.dm.common.enums.GatewayResultCode; import com.jz.dm.common.enums.GatewayResultCode;
import com.jz.dm.common.exception.GatewayException; import com.jz.dm.common.exception.GatewayException;
import com.jz.dm.common.exception.SignatureException; import com.jz.dm.common.exception.SignatureException;
import com.jz.dm.common.util.LogUtil; import com.jz.dm.common.util.LogUtil;
import com.jz.dm.common.util.MapUtil; import com.jz.dm.common.util.MapUtil;
import com.jz.dm.common.util.Md5;
import com.jz.dm.models.domian.ApiAuth; import com.jz.dm.models.domian.ApiAuth;
import com.jz.dm.models.enity.GatewayRequest; import com.jz.dm.models.enity.GatewayRequest;
import com.jz.dm.models.enity.GatewayResponse; import com.jz.dm.models.enity.GatewayResponse;
...@@ -42,8 +42,7 @@ public class VerifySignFilter extends AbstractFilter { ...@@ -42,8 +42,7 @@ public class VerifySignFilter extends AbstractFilter {
FilterChain chain) { FilterChain chain) {
try { try {
//对签约参数进行字典排序 //对签约参数进行字典排序
String signParams = MapUtil.getSignValue(request.getApiKey(),request.getMethod(), String signParams = MapUtil.getSignValue(request.getApiKey(),request.getMethod(),request.getSignType());
request.getSignType(),String.valueOf(request.getTimestamp()));
if (StringUtils.isNotBlank(signParams)){ if (StringUtils.isNotBlank(signParams)){
JSONObject jsonObject = JSONObject.parseObject(request.getParams()); JSONObject jsonObject = JSONObject.parseObject(request.getParams());
String authCode = jsonObject.getString("authCode"); String authCode = jsonObject.getString("authCode");
......
...@@ -44,7 +44,7 @@ public class ApiAuth extends BaseObject implements Serializable { ...@@ -44,7 +44,7 @@ public class ApiAuth extends BaseObject implements Serializable {
@TableField("auth_type") @TableField("auth_type")
private String authType; private String authType;
/** /**
* 限类型:DAY 按天,MONTH 按月, YEAR 按年 * 限类型:DAY 按天,MONTH 按月, YEAR 按年
*/ */
@TableField("req_type") @TableField("req_type")
private String reqType; private String reqType;
......
...@@ -49,7 +49,7 @@ public class ApiInterface extends BaseObject implements Serializable { ...@@ -49,7 +49,7 @@ public class ApiInterface extends BaseObject implements Serializable {
private String apiProtocl; private String apiProtocl;
/** /**
* api类型:1 数据银行制作API 2 数据银行制作数据包, 3 API实时接入 6 标签查询 9自定义' * api类型:1 数据银行制作大数据表 2 数据银行制作数据包,3,数据银行制作自定义API 4 API实时接入 5 DMP标签查询 6.DMP大数据表查询 7 DMP自定义'
*/ */
@TableField("api_type") @TableField("api_type")
private String apiType; private String apiType;
...@@ -109,7 +109,7 @@ public class ApiInterface extends BaseObject implements Serializable { ...@@ -109,7 +109,7 @@ public class ApiInterface extends BaseObject implements Serializable {
private String signType; private String signType;
/** /**
* 限类型:DAY 按天,MONTH 按月, YEAR 按年 * 限类型:DAY 按天,MONTH 按月, YEAR 按年
*/ */
@TableField("req_type") @TableField("req_type")
private String reqType; private String reqType;
......
...@@ -37,6 +37,30 @@ public class ApiInterfaceCustom extends BaseObject implements Serializable { ...@@ -37,6 +37,30 @@ public class ApiInterfaceCustom extends BaseObject implements Serializable {
private Long apiInterfaceId; private Long apiInterfaceId;
/**
* 数据源id
*/
@TableField("es_data_source")
private String esDataSource;
/**
* 源数据库名称
*/
@TableField("es_data_base")
private String esDataBase;
/**
* 源数据表名称
*/
@TableField("es_table")
private String esTable;
/**
* 处理类型
*/
@TableField("handle_type")
private String handleType;
/** /**
* api请求参数 * api请求参数
*/ */
......
...@@ -52,7 +52,7 @@ public class ApiInterfaceFile extends BaseObject implements Serializable { ...@@ -52,7 +52,7 @@ public class ApiInterfaceFile extends BaseObject implements Serializable {
* 父类id * 父类id
*/ */
@TableField("parent_id") @TableField("parent_id")
private String parentId; private Long parentId;
/** /**
* 文件英文名称 * 文件英文名称
*/ */
......
...@@ -2,6 +2,7 @@ package com.jz.dm.models.req; ...@@ -2,6 +2,7 @@ package com.jz.dm.models.req;
import com.jz.common.bean.BasePageBean; import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -18,4 +19,9 @@ import java.io.Serializable; ...@@ -18,4 +19,9 @@ import java.io.Serializable;
@Data @Data
@ApiModel("日志信息列表") @ApiModel("日志信息列表")
public class LogInfoListReq extends BasePageBean implements Serializable { public class LogInfoListReq extends BasePageBean implements Serializable {
@ApiModelProperty(value = "状态:SUCCEED 请求成功, FAIL 请求失败")
private String status;
@ApiModelProperty(value = "ApiKey")
private String apiKey;
} }
...@@ -19,9 +19,7 @@ import java.io.Serializable; ...@@ -19,9 +19,7 @@ import java.io.Serializable;
@Data @Data
@ApiModel(value = "api基本信息") @ApiModel(value = "api基本信息")
public class ApiInterfaceReq implements Serializable { public class ApiInterfaceReq implements Serializable {
@ApiModelProperty(value = "api类型:1 实时接入 2 数据银行制作API, 3 数据银行制作数据包 6标签查询 9自定义",required = true)
@NotNull(message = "api类型不能为空")
public String apiType;
@ApiModelProperty(value = "接口描述",required = false) @ApiModelProperty(value = "接口描述",required = false)
public String apiDesc; public String apiDesc;
...@@ -46,19 +44,22 @@ public class ApiInterfaceReq implements Serializable { ...@@ -46,19 +44,22 @@ public class ApiInterfaceReq implements Serializable {
@NotNull(message="超时时间不能为空") @NotNull(message="超时时间不能为空")
public String timeout; public String timeout;
@ApiModelProperty(value = "限类型:DAY 按天,MONTH 按月, YEAR 按年",required = true) @ApiModelProperty(value = "限类型:DAY 按天,MONTH 按月, YEAR 按年",required = true)
@NotNull(message = "限类型不能为空") @NotNull(message = "限类型不能为空")
public String reqType; public String reqType;
@ApiModelProperty(value = "限制次数",required = true) @ApiModelProperty(value = "限制次数",required = false)
public Long reqFrequency; public Long reqFrequency;
@ApiModelProperty(value = "api描述",required = false) @ApiModelProperty(value = "api描述",required = false)
public String apiFunction; public String apiFunction;
@ApiModelProperty(value = "父类文件id,一级文件夹传入0",required = true) @ApiModelProperty(value = "父类文件id,一级文件夹传入0",required = false)
@NotNull(message="父类id文件id不能为空")
public Long parentId; public Long parentId;
@ApiModelProperty(value = "文件id",required = false)
public Long fileId;
@ApiModelProperty(value = "项目id",required = true) @ApiModelProperty(value = "项目id",required = true)
@NotNull(message="项目id不能为空") @NotNull(message="项目id不能为空")
public Long projectId; public Long projectId;
...@@ -69,5 +70,12 @@ public class ApiInterfaceReq implements Serializable { ...@@ -69,5 +70,12 @@ public class ApiInterfaceReq implements Serializable {
@ApiModelProperty(value = "更新时传入api自增id",required = false) @ApiModelProperty(value = "更新时传入api自增id",required = false)
public Long id; public Long id;
@ApiModelProperty(value = "创建用户",hidden = true)
public String createUser;
@ApiModelProperty(value = "api类型:1.数据银行制作大数据表 " +
"2 数据银行制作数据包,3,数据银行制作自定义API " +
"4 API实时接入 6 标签查询 9自定义",hidden = true)
public String apiType;
} }
...@@ -27,12 +27,12 @@ public class MakeBigDataApiReq implements Serializable { ...@@ -27,12 +27,12 @@ public class MakeBigDataApiReq implements Serializable {
@NotNull(message = "apiType不能为空") @NotNull(message = "apiType不能为空")
private String apiType;*/ private String apiType;*/
@ApiModelProperty(value = "接入类型:对应字典表key",required = true) @ApiModelProperty(value = "apiKey",required = true)
@NotNull(message = "接入类型不能为空") @NotNull(message = "apiKey不能为空")
public String joinType; public String apiKey;
@ApiModelProperty(value = "是否分页",required = false) //@ApiModelProperty(value = "是否分页",required = false)
public Integer page; //public Boolean page;
@ApiModelProperty(value = "数据源Id",required = true) @ApiModelProperty(value = "数据源Id",required = true)
@NotNull(message = "数据源Id不能为空") @NotNull(message = "数据源Id不能为空")
...@@ -40,7 +40,7 @@ public class MakeBigDataApiReq implements Serializable { ...@@ -40,7 +40,7 @@ public class MakeBigDataApiReq implements Serializable {
@ApiModelProperty(value = "源库名称",required = true) @ApiModelProperty(value = "源库名称",required = true)
@NotNull(message = "源库名称不能为空") @NotNull(message = "源库名称不能为空")
private String esDatabase; private String esDataBase;
@ApiModelProperty(value = "源表名称",required = true) @ApiModelProperty(value = "源表名称",required = true)
@NotNull(message = "源表名称不能为空") @NotNull(message = "源表名称不能为空")
...@@ -57,12 +57,24 @@ public class MakeBigDataApiReq implements Serializable { ...@@ -57,12 +57,24 @@ public class MakeBigDataApiReq implements Serializable {
@ApiModelProperty(value = "返回参数",required = true) @ApiModelProperty(value = "返回参数",required = true)
@NotNull(message = "返回参数不能为空") @NotNull(message = "返回参数不能为空")
private String resultParam; private String responseParam;
@ApiModelProperty(value = "段列表",required = true) @ApiModelProperty(value = "段列表",required = true)
@NotNull(message = "字段列表不能为空") @NotNull(message = "字段列表不能为空")
private String tableFields; private String tableFields;
//@ApiModelProperty(value = "项目id",required = true)
//@NotNull(message="项目id不能为空")
//public Long projectId;
//@ApiModelProperty(value = "父类文件id,一级文件夹传入0",required = false)
//public Long parentId;
//
//@ApiModelProperty(value = "文件id",required = false)
//public Long fileId;
} }
...@@ -20,13 +20,13 @@ import java.io.Serializable; ...@@ -20,13 +20,13 @@ import java.io.Serializable;
@ApiModel("数据银行api制作") @ApiModel("数据银行api制作")
public class MakeDataBankApiReq implements Serializable { public class MakeDataBankApiReq implements Serializable {
//@ApiModelProperty(value = "api类型:1 数据银行制作API 2 数据银行制作数据包, 3 API实时接入 6 标签查询 9自定义",required = true) //@ApiModelProperty(value = "api类型:1 数据银行制作大数据表 2 数据银行制作数据包,3,数据银行制作自定义API 4 API实时接入 6 标签查询 9自定义",required = true)
//@NotNull(message = "api类型不能为空") //@NotNull(message = "api类型不能为空")
//public String apiType; //public String apiType;
@ApiModelProperty(value = "传输方式(1为HTTPS,2为HTTP)",required = true) @ApiModelProperty(value = "传输方式(1为HTTPS,2为HTTP)",required = true)
@NotNull(message = "传输方式不能为空") @NotNull(message = "传输方式不能为空")
public String apiProtocl; public String transMode;
@ApiModelProperty(value = "加密方式0 无,1:MD5 2:RSA",required = true) @ApiModelProperty(value = "加密方式0 无,1:MD5 2:RSA",required = true)
@NotNull(message = "加密方式不能为空") @NotNull(message = "加密方式不能为空")
...@@ -44,15 +44,23 @@ public class MakeDataBankApiReq implements Serializable { ...@@ -44,15 +44,23 @@ public class MakeDataBankApiReq implements Serializable {
@NotNull(message = "是否分页不能为空") @NotNull(message = "是否分页不能为空")
public Boolean page; public Boolean page;
@ApiModelProperty(value = "限类型:DAY 按天,MONTH 按月",required = true) @ApiModelProperty(value = "限类型:DAY 按天,MONTH 按月",required = true)
@NotNull(message = "限类型不能为空") @NotNull(message = "限类型不能为空")
public String reqType; public String reqType;
@ApiModelProperty(value = "目标地址",required = true)
@NotNull(message = "目标地址不能为空")
public String targetUrl;
@ApiModelProperty(value = "文件id",required = true) @ApiModelProperty(value = "文件id",required = true)
@NotNull(message = "文件id不能为空") @NotNull(message = "文件id不能为空")
public Long fileId; public Long fileId;
@ApiModelProperty(value = "限制次数",required = true) @ApiModelProperty(value = "签名",required = true)
@NotNull(message = "签名不能为空")
public String sign;
@ApiModelProperty(value = "限制次数",required = false)
public Long reqFrequency; public Long reqFrequency;
@ApiModelProperty(value = "请求地址",required = false) @ApiModelProperty(value = "请求地址",required = false)
...@@ -61,8 +69,7 @@ public class MakeDataBankApiReq implements Serializable { ...@@ -61,8 +69,7 @@ public class MakeDataBankApiReq implements Serializable {
@ApiModelProperty(value = "接口描述",required = false) @ApiModelProperty(value = "接口描述",required = false)
public String apiDesc; public String apiDesc;
@ApiModelProperty(value = "目标地址",required = false)
public String targetUrl;
@ApiModelProperty(value = "超时时间",required = false) @ApiModelProperty(value = "超时时间",required = false)
public String timeout; public String timeout;
...@@ -85,13 +92,12 @@ public class MakeDataBankApiReq implements Serializable { ...@@ -85,13 +92,12 @@ public class MakeDataBankApiReq implements Serializable {
@ApiModelProperty(value = "api样例",required = false) @ApiModelProperty(value = "api样例",required = false)
public String apiExample; public String apiExample;
@ApiModelProperty(value = "创建用户",required = false)
public String createUser;
//-------------------------前端无效传参---------------------- //-------------------------前端无效传参----------------------
//@ApiModelProperty(value = "状态",hidden = true) //@ApiModelProperty(value = "状态",hidden = true)
//public String status; //public String status;
//
//@ApiModelProperty(value = "创建用户",hidden = true)
//public String createUser;
} }
...@@ -42,4 +42,7 @@ public class OrganizationManageAddReq implements Serializable { ...@@ -42,4 +42,7 @@ public class OrganizationManageAddReq implements Serializable {
@ApiModelProperty(value = "备注",required = false) @ApiModelProperty(value = "备注",required = false)
private String remark; private String remark;
@ApiModelProperty(value = "创建用户",required = false)
private String createUser;
} }
...@@ -2,6 +2,7 @@ package com.jz.dm.models.req.organizationManage; ...@@ -2,6 +2,7 @@ package com.jz.dm.models.req.organizationManage;
import com.jz.common.bean.BasePageBean; import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -18,4 +19,11 @@ import java.io.Serializable; ...@@ -18,4 +19,11 @@ import java.io.Serializable;
@Data @Data
@ApiModel("组织管理查询请求体") @ApiModel("组织管理查询请求体")
public class OrganizationManageListQueryReq extends BasePageBean implements Serializable { public class OrganizationManageListQueryReq extends BasePageBean implements Serializable {
@ApiModelProperty(value = "组织名称")
private String orgName;
@ApiModelProperty(value = "组织编码(组织唯一标识)")
private String orgCode;
} }
...@@ -45,4 +45,9 @@ public class OrganizationManageUpdateReq implements Serializable { ...@@ -45,4 +45,9 @@ public class OrganizationManageUpdateReq implements Serializable {
@ApiModelProperty(value = "备注",required = false) @ApiModelProperty(value = "备注",required = false)
private String remark; private String remark;
@ApiModelProperty(value = "创建用户",required = false)
private String updateUser;
} }
...@@ -47,11 +47,11 @@ public interface OrganizationManageService { ...@@ -47,11 +47,11 @@ public interface OrganizationManageService {
Result update(OrganizationManageUpdateReq req); Result update(OrganizationManageUpdateReq req);
/** /**
* 根据id删除组织 * 根据id注销组织
* @param id * @param id
* @return * @return
*/ */
Result delete(Long id); Result logoutOrg(Long id);
/** /**
* 获取认证组织信息 * 获取认证组织信息
......
...@@ -97,4 +97,18 @@ public interface ProducerService { ...@@ -97,4 +97,18 @@ public interface ProducerService {
* @return * @return
*/ */
IPage<ApiInterfaceFile> getFileCatalog(Long projectId ,String pageNum, String pageSize); IPage<ApiInterfaceFile> getFileCatalog(Long projectId ,String pageNum, String pageSize);
/**
* 创建文件夹
* @param projectId
* @param parentId
* @param currentUser
* @return
*/
Result createProjectFolder(Long projectId, Long parentId,String currentUser);
Result saveObjOnRedis();
Result getObjOnRedis();
} }
...@@ -14,6 +14,7 @@ import com.jz.dm.models.req.LogInfoListReq; ...@@ -14,6 +14,7 @@ import com.jz.dm.models.req.LogInfoListReq;
import com.jz.dm.service.ApiLogService; import com.jz.dm.service.ApiLogService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -47,6 +48,12 @@ public class ApiLogServiceImpl implements ApiLogService { ...@@ -47,6 +48,12 @@ public class ApiLogServiceImpl implements ApiLogService {
public IPage<ApiReqLog> listApiLog(LogInfoListReq req) { public IPage<ApiReqLog> listApiLog(LogInfoListReq req) {
IPage<ApiReqLog> page = new Page<>(req.getPageNum(), req.getPageSize()); IPage<ApiReqLog> page = new Page<>(req.getPageNum(), req.getPageSize());
QueryWrapper<ApiReqLog> query = new QueryWrapper<>(); QueryWrapper<ApiReqLog> query = new QueryWrapper<>();
if (StringUtils.isNotBlank(req.getApiKey())){
query.eq("api_key",req.getApiKey());
}
if (StringUtils.isNotBlank(req.getStatus())){
query.eq("status",req.getStatus());
}
query.eq("is_deleted",0); query.eq("is_deleted",0);
query.orderByDesc("create_date"); query.orderByDesc("create_date");
return apiReqLogMapper.selectPage(page, query); return apiReqLogMapper.selectPage(page, query);
......
...@@ -19,7 +19,6 @@ import com.jz.dm.service.OrganizationManageService; ...@@ -19,7 +19,6 @@ import com.jz.dm.service.OrganizationManageService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -42,8 +41,6 @@ public class OrganizationManageImpl implements OrganizationManageService { ...@@ -42,8 +41,6 @@ public class OrganizationManageImpl implements OrganizationManageService {
@Resource @Resource
private ApiOrgMapper apiOrgMapper; private ApiOrgMapper apiOrgMapper;
@Resource
private RedisTemplate redisTemplate;
/** /**
* 组织列表信息查询 * 组织列表信息查询
...@@ -55,7 +52,14 @@ public class OrganizationManageImpl implements OrganizationManageService { ...@@ -55,7 +52,14 @@ public class OrganizationManageImpl implements OrganizationManageService {
public IPage<ApiOrg> listOrganization(OrganizationManageListQueryReq req) { public IPage<ApiOrg> listOrganization(OrganizationManageListQueryReq req) {
IPage<ApiOrg> page = new Page<>(req.getPageNum(), req.getPageSize()); IPage<ApiOrg> page = new Page<>(req.getPageNum(), req.getPageSize());
QueryWrapper<ApiOrg> query = new QueryWrapper<>(); QueryWrapper<ApiOrg> query = new QueryWrapper<>();
if (StringUtils.isNotBlank(req.getOrgName())){
query.eq("org_name",req.getOrgName());
}
if (StringUtils.isNotBlank(req.getOrgCode())){
query.eq("org_code",req.getOrgCode());
}
query.eq("is_deleted", 0); query.eq("is_deleted", 0);
query.ne("status",OrgStatusEnum.CANCEL);
query.orderByDesc("create_date"); query.orderByDesc("create_date");
return apiOrgMapper.selectPage(page, query); return apiOrgMapper.selectPage(page, query);
} }
...@@ -71,6 +75,7 @@ public class OrganizationManageImpl implements OrganizationManageService { ...@@ -71,6 +75,7 @@ public class OrganizationManageImpl implements OrganizationManageService {
QueryWrapper<ApiOrg> query = new QueryWrapper<>(); QueryWrapper<ApiOrg> query = new QueryWrapper<>();
query.eq("is_deleted", 0); query.eq("is_deleted", 0);
query.eq("id", req.getId()); query.eq("id", req.getId());
query.ne("status",OrgStatusEnum.CANCEL);
return Result.of_success(apiOrgMapper.selectOne(query)); return Result.of_success(apiOrgMapper.selectOne(query));
} }
...@@ -82,16 +87,18 @@ public class OrganizationManageImpl implements OrganizationManageService { ...@@ -82,16 +87,18 @@ public class OrganizationManageImpl implements OrganizationManageService {
*/ */
@Override @Override
public Result add(OrganizationManageAddReq req) { public Result add(OrganizationManageAddReq req) {
/* SysUserDto currentUser = (SysUserDto)redisTemplate.opsForValue().get("user"+ RedisMessageConstant.SENDTYPE_LOGIN_SYS);
if (null == currentUser){
return Result.of_error(ResultMsg.USER_NOT_EXIST);
}*/
if (StringUtils.isNotBlank(req.getOrgName())) { if (StringUtils.isNotBlank(req.getOrgName())) {
ApiOrg orgNameInfo = getOrgNameInfo(req.getOrgName()); ApiOrg orgNameInfo = getOrgNameInfo(req.getOrgName());
if (null != orgNameInfo) { if (null != orgNameInfo) {
return Result.of_error("组织名称已存在!"); return Result.of_error("组织名称已存在!");
} }
} }
if (StringUtils.isNotBlank(req.getOrgType())) {
if (!Constants.AUTH_INT.equals(req.getOrgType()) ||
!Constants.AUTH_OUT.equals(req.getOrgType())) {
return Result.of_error("组织类型不存在!");
}
}
String coding = ""; String coding = "";
ApiOrg apiOrg = new ApiOrg(); ApiOrg apiOrg = new ApiOrg();
BeanUtils.copyProperties(req, apiOrg); BeanUtils.copyProperties(req, apiOrg);
...@@ -106,7 +113,6 @@ public class OrganizationManageImpl implements OrganizationManageService { ...@@ -106,7 +113,6 @@ public class OrganizationManageImpl implements OrganizationManageService {
} }
apiOrg.setOrgCode(coding);//组织编码 apiOrg.setOrgCode(coding);//组织编码
apiOrg.setStatus(OrgStatusEnum.NORMAL.name());//正常 apiOrg.setStatus(OrgStatusEnum.NORMAL.name());//正常
//apiOrg.setCreateUser(currentUser.getUserName());
if (apiOrgMapper.insert(apiOrg) > 0) { if (apiOrgMapper.insert(apiOrg) > 0) {
return Result.of_success(ResultMsg.INSERT_SUCCESS); return Result.of_success(ResultMsg.INSERT_SUCCESS);
} }
...@@ -140,23 +146,22 @@ public class OrganizationManageImpl implements OrganizationManageService { ...@@ -140,23 +146,22 @@ public class OrganizationManageImpl implements OrganizationManageService {
*/ */
@Override @Override
public Result update(OrganizationManageUpdateReq req) { public Result update(OrganizationManageUpdateReq req) {
/* SysUserDto currentUser = (SysUserDto) redisTemplate.opsForValue().get("user" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
if (null == currentUser) {
return Result.of_error(ResultMsg.USER_NOT_EXIST);
}*/
ApiOrg apiOrg = apiOrgMapper.selectById(req.getId()); ApiOrg apiOrg = apiOrgMapper.selectById(req.getId());
if (null == apiOrg) { if (null == apiOrg) {
return Result.of_error("组织信息不存在!"); return Result.of_error("组织信息不存在!");
} }
if (StringUtils.isNotBlank(req.getStatus())) { if (StringUtils.isNotBlank(req.getStatus())) {
if (null == fromTypeName(req.getStatus())){ if (null == fromTypeName(req.getStatus())) {
return Result.of_error("更新组织状态不存在!"); return Result.of_error("更新组织状态不存在!");
} }
} }
//原状态为注销状态不可复原
if (OrgStatusEnum.CANCEL.equals(apiOrg.getStatus())){
return Result.of_error("注销状态不可修改");
}
ApiOrg apiOrgUpdate = new ApiOrg(); ApiOrg apiOrgUpdate = new ApiOrg();
BeanUtils.copyProperties(req, apiOrgUpdate); BeanUtils.copyProperties(req, apiOrgUpdate);
apiOrgUpdate.setUpdateDate(new Date()); apiOrgUpdate.setUpdateDate(new Date());
//apiOrgUpdate.setUpdateUser(currentUser.getUserName());
if (apiOrgMapper.updateById(apiOrgUpdate) > 0) { if (apiOrgMapper.updateById(apiOrgUpdate) > 0) {
return Result.of_success(ResultMsg.UPDATE_SUCCESS); return Result.of_success(ResultMsg.UPDATE_SUCCESS);
} }
...@@ -164,37 +169,39 @@ public class OrganizationManageImpl implements OrganizationManageService { ...@@ -164,37 +169,39 @@ public class OrganizationManageImpl implements OrganizationManageService {
} }
/** /**
* 删除组织 * 注销组织
* *
* @param id * @param id
* @return * @return
*/ */
@Override @Override
public Result delete(Long id) { public Result logoutOrg(Long id) {
ApiOrg apiOrg = apiOrgMapper.selectById(id); ApiOrg apiOrg = apiOrgMapper.selectById(id);
if (null == apiOrg) { if (null == apiOrg) {
return Result.of_error(ResultMsg.DATA_NOT_EXIST); return Result.of_error(ResultMsg.DATA_NOT_EXIST);
} }
UpdateWrapper<ApiOrg> delete = new UpdateWrapper<>(); UpdateWrapper<ApiOrg> delete = new UpdateWrapper<>();
delete.set("is_deleted", 1); delete.set("is_deleted", 1);
delete.set("status",OrgStatusEnum.CANCEL);
delete.eq("id", id); delete.eq("id", id);
if (apiOrgMapper.update(null, delete) > 0) { if (apiOrgMapper.update(null, delete) > 0) {
return Result.of_success(ResultMsg.DELETE_SUCCESS); return Result.of_success(ResultMsg.UPDATE_SUCCESS);
} }
return Result.of_success(ResultMsg.DELETE_FAIL); return Result.of_success(ResultMsg.UPDATE_FAIL);
} }
/** /**
* 获取认证组织信息 * 获取认证组织信息
*
* @param apiOrgId * @param apiOrgId
* @return * @return
*/ */
@Override @Override
public ApiOrg getAuthOrganization(Long apiOrgId) { public ApiOrg getAuthOrganization(Long apiOrgId) {
QueryWrapper<ApiOrg> query = new QueryWrapper<>(); QueryWrapper<ApiOrg> query = new QueryWrapper<>();
query.eq("id",apiOrgId); query.eq("id", apiOrgId);
query.eq("status", OrgStatusEnum.NORMAL.name()); query.eq("status", OrgStatusEnum.NORMAL.name());
query.eq("is_deleted",0); query.eq("is_deleted", 0);
return apiOrgMapper.selectOne(query); return apiOrgMapper.selectOne(query);
} }
......
...@@ -18,7 +18,6 @@ import com.jz.dm.models.domian.ApiInterface; ...@@ -18,7 +18,6 @@ import com.jz.dm.models.domian.ApiInterface;
import com.jz.dm.service.ApiInterfaceService; import com.jz.dm.service.ApiInterfaceService;
import com.jz.dm.service.AuthService; import com.jz.dm.service.AuthService;
import com.jz.dm.web.annotation.AccessLimit; import com.jz.dm.web.annotation.AccessLimit;
import com.jz.dm.web.annotation.ApiLogAspect;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -71,7 +70,7 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService { ...@@ -71,7 +70,7 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
* @param response * @param response
*/ */
@Override @Override
@ApiLogAspect(description = "API请求日志") // @ApiLogAspect(description = "API请求日志")
@AccessLimit(limit = 10000, sec = 1) @AccessLimit(limit = 10000, sec = 1)
@SentinelResource(value = "api.gateway", fallback = "fallbackGateway") @SentinelResource(value = "api.gateway", fallback = "fallbackGateway")
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
...@@ -114,6 +113,10 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService { ...@@ -114,6 +113,10 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
} }
} catch (Exception ex) { } catch (Exception ex) {
if (ex instanceof GatewayException) { if (ex instanceof GatewayException) {
//调用失败回调数据银行解冻
if (AuthModeEnum.POWER_CALL_MODE.name().equals(apiAuth.getAuthMode())){
notifierMinusMoney(parameter, bResult);
}
throw (GatewayException) ex; throw (GatewayException) ex;
} }
log.error("~~~~~~~~~~~~~~~请求api信息异常~~~~~~~~~~~~~"); log.error("~~~~~~~~~~~~~~~请求api信息异常~~~~~~~~~~~~~");
...@@ -186,7 +189,7 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService { ...@@ -186,7 +189,7 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
jsonReq.put("assetsId",assetsId); jsonReq.put("assetsId",assetsId);
jsonReq.put("userId",userId); jsonReq.put("userId",userId);
jsonReq.put("dataPrice",dataPrice); jsonReq.put("dataPrice",dataPrice);
jsonReq.put("callStatus",bResult);//调用成功 扣款 false 调用失败,解冻金额 jsonReq.put("callStatus",bResult);//true 调用成功 扣款 false 调用失败,解冻金额
String responseResult = httpsUtils.submitPost(withholdUrl, jsonReq.toString()); String responseResult = httpsUtils.submitPost(withholdUrl, jsonReq.toString());
JSONObject paramsResult = JSONObject.parseObject(responseResult); JSONObject paramsResult = JSONObject.parseObject(responseResult);
if (null != paramsResult){ if (null != paramsResult){
......
...@@ -83,7 +83,7 @@ public class SystemLogAspect { ...@@ -83,7 +83,7 @@ public class SystemLogAspect {
String url = UrlUtil.getServerUrl(request); String url = UrlUtil.getServerUrl(request);
// 访问项目名 // 访问项目名
String contextPath = request.getContextPath(); String contextPath = request.getContextPath();
log.info("around请求参数为{}", joinPoint.getArgs()); log.info("around请求参数为{}", params);
//动态修改其参数 //动态修改其参数
//注意,如果调用joinPoint.proceed()方法,则修改的参数值不会生效,必须调用joinPoint.proceed(Object[] args) //注意,如果调用joinPoint.proceed()方法,则修改的参数值不会生效,必须调用joinPoint.proceed(Object[] args)
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(params); com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(params);
......
...@@ -92,7 +92,8 @@ sentinel: #sentinel每秒中最大的请求个数 ...@@ -92,7 +92,8 @@ sentinel: #sentinel每秒中最大的请求个数
#数据银行调用配置 #数据银行调用配置
data: data:
bank: bank:
balanceUrl: http://localhost:8081/mall/financeCustomerAssets/findAssets #余额信息url balanceUrl: http://192.168.1.139:8081/mall/financeCustomerAssets/findAssets #余额信息url
withholdUrl: http://localhost:8081/mall/financeCustomerAssets/unfreezeMoney #扣款信通知url withholdUrl: http://192.168.1.139:8081/mall/financeCustomerAssets/unfreezeMoney #扣款信通知url
token: #dataBank 制作验签
dataBank: dataBank123
...@@ -2,8 +2,8 @@ package com.jz.dm.gateway.api; ...@@ -2,8 +2,8 @@ package com.jz.dm.gateway.api;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jz.common.utils.HttpsUtils; import com.jz.common.utils.HttpsUtils;
import com.jz.common.utils.Md5;
import com.jz.dm.common.util.MapUtil; import com.jz.dm.common.util.MapUtil;
import com.jz.dm.common.util.Md5;
import com.jz.dm.gateway.SpringTestCase; import com.jz.dm.gateway.SpringTestCase;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -27,14 +27,14 @@ public class ApiReqTest extends SpringTestCase { ...@@ -27,14 +27,14 @@ public class ApiReqTest extends SpringTestCase {
public void TestGatewayReq() { public void TestGatewayReq() {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("apiKey", "9jNA1W5Ydn7Stp12"); jsonObject.put("apiKey", "sE862E97j7Yzo049");
jsonObject.put("method", "query"); jsonObject.put("method", "query");
jsonObject.put("signType", "MD5"); jsonObject.put("signType", "MD5");
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
jsonObject.put("timestamp", "1609919983045"); jsonObject.put("timestamp", String.valueOf(time));
JSONObject params = new JSONObject(); JSONObject params = new JSONObject();
params.put("authCode", "20200000000221231111455Jg8ug1621"); params.put("authCode", "202100000001118191258T718d78591J");
params.put("selectType", "10006"); params.put("selectType", "10006");
params.put("reqParams", new JSONObject()); params.put("reqParams", new JSONObject());
jsonObject.put("params",params); jsonObject.put("params",params);
...@@ -42,10 +42,9 @@ public class ApiReqTest extends SpringTestCase { ...@@ -42,10 +42,9 @@ public class ApiReqTest extends SpringTestCase {
String apiKey = jsonObject.getString("apiKey"); String apiKey = jsonObject.getString("apiKey");
String method = jsonObject.getString("method"); String method = jsonObject.getString("method");
String signType = jsonObject.getString("signType"); String signType = jsonObject.getString("signType");
String timestamp= jsonObject.getString("timestamp");
String signature = MapUtil.getSignValue(apiKey, method, signType, timestamp); String signature = MapUtil.getSignValue(apiKey, method, signType);
String salt = Md5.encrypt(signature, "OOmeF1gh"); String salt = Md5.encrypt(signature, "33tgT3g2");
jsonObject.put("sign", salt); jsonObject.put("sign", salt);
String response = httpsUtils.submitPost(url, jsonObject.toString()); String response = httpsUtils.submitPost(url, jsonObject.toString());
System.out.println(response); System.out.println(response);
......
package com.jz.dm.gateway.orther; package com.jz.dm.gateway.orther;
import com.jz.dm.common.base.BaseCurrentUserObject; import com.jz.dm.common.util.RedisSerializableUtil;
import com.jz.dm.gateway.SpringTestCase; import com.jz.dm.gateway.SpringTestCase;
import com.jz.dm.models.req.make.MakeDataBankApiReq;
import net.sf.json.JSONObject;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
...@@ -19,17 +21,49 @@ import org.springframework.data.redis.core.RedisTemplate; ...@@ -19,17 +21,49 @@ import org.springframework.data.redis.core.RedisTemplate;
public class TestRedisUserSave extends SpringTestCase { public class TestRedisUserSave extends SpringTestCase {
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate<String, Object> redisTemplate;
/*@Autowired
private RedisUtils redisUtils;*/
@Test @Test
public void saveUser(){ public void saveUser(){
redisTemplate.opsForValue().set("USER004","USER9999"); RedisTemplate template = new RedisTemplate();
template.opsForValue().set("USER004","USER9999");
// this.redisTemplate.opsForValue().set("USER004","USER9999");
} }
@Test @Test
public void getUser(){ public void getUser(){
//String str= (String)redisTemplate.opsForValue().get("USER"+"_99999"); redisTemplate.opsForValue().get("USER004");
//System.out.println("获取到的用户:"+str); }
System.out.println(new BaseCurrentUserObject().getUserInfo());
@Test
public void saveObject(){
MakeDataBankApiReq bankApiReq = new MakeDataBankApiReq();
bankApiReq.setTransMode("HTTPS");
bankApiReq.setSignType("MD5");
bankApiReq.setJoinType("10004");
bankApiReq.setOutputType("JSON");
bankApiReq.setPage(false);
bankApiReq.setReqType("DAY");
bankApiReq.setTargetUrl("www.baidu.com");
bankApiReq.setFileId(1L);
bankApiReq.setSign("F2A8E3CFE528D6AE5C5B075046653F3E");
bankApiReq.setReqFrequency(0L);
bankApiReq.setApiDesc("4444");
bankApiReq.setTimeout("5000");
String value = String.valueOf(bankApiReq);
System.out.println(value);
// JSONObject jsonObject = JSONObject.parseObject(value);
JSONObject jsonObject = JSONObject.fromObject(bankApiReq);
System.out.println(jsonObject);
// redisTemplate.opsForValue().set(bankApiReq,jsonObject,300, TimeUnit.SECONDS);
/*RedisUtils redisUtilsaa = new RedisUtils();*/
RedisTemplate redisTemplate1 = new RedisTemplate();
byte[] serialize = RedisSerializableUtil.serialize(jsonObject);
// redisUtilsaa.set("bankApiReq",jsonObject,300);
redisTemplate1.opsForValue().set("bankApiReq",jsonObject);
redisTemplate1.opsForValue().get(bankApiReq);
} }
} }
...@@ -7,4 +7,11 @@ package com.jz.dm.gateway.orther; ...@@ -7,4 +7,11 @@ package com.jz.dm.gateway.orther;
* @Version: * @Version:
*/ */
public class TestStr { public class TestStr {
public static void main(String[] args) {
String str = "/picture/logo/T6gxlv137nFA555z.jpg";
// String[] split = str.split("\\/");
System.out.println(str.substring(0, str.lastIndexOf("/") + 1));
String substring = str.substring(str.lastIndexOf("."));
System.out.println(substring);
}
} }
...@@ -85,7 +85,11 @@ ...@@ -85,7 +85,11 @@
<version>RELEASE</version> <version>RELEASE</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!--链接FTP服务-->
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
......
package com.jz.dm.common.util; package com.jz.common.utils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
......
...@@ -132,6 +132,15 @@ public class RedisUtils { ...@@ -132,6 +132,15 @@ public class RedisUtils {
return (String) redisTemplate.opsForValue().get(key); return (String) redisTemplate.opsForValue().get(key);
} }
/**
* 实现命令:GET key,返回 key所关联的值。
*
* @param key
* @return obj
*/
public Object getObj(String key) {
return redisTemplate.opsForValue().get(key);
}
/** /**
* Hash(哈希表) * Hash(哈希表)
* 实现命令:HSET key field value,将哈希表 key中的域 field的值设为 value * 实现命令:HSET key field value,将哈希表 key中的域 field的值设为 value
......
...@@ -4,7 +4,6 @@ import com.aliyuncs.DefaultAcsClient; ...@@ -4,7 +4,6 @@ import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient; import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.http.MethodType; import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile; import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile; import com.aliyuncs.profile.IClientProfile;
...@@ -33,9 +32,9 @@ public class SMSUtils { ...@@ -33,9 +32,9 @@ public class SMSUtils {
* @param templateCode * @param templateCode
* @param phoneNumbers * @param phoneNumbers
* @param param * @param param
* @throws ClientException * @throws
*/ */
public static void sendShortMessage(String templateCode,String phoneNumbers,String param) throws ClientException{ public static void sendShortMessage(String templateCode,String phoneNumbers,String param) throws Exception{
// 设置超时时间-可自行调整 // 设置超时时间-可自行调整
System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000"); System.setProperty("sun.net.client.defaultReadTimeout", "10000");
......
...@@ -121,6 +121,10 @@ ...@@ -121,6 +121,10 @@
<groupId>com.github.xiaoymin</groupId> <groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId> <artifactId>swagger-bootstrap-ui</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- common公共模块 --> <!-- common公共模块 -->
<dependency> <dependency>
<groupId>com.jz.common</groupId> <groupId>com.jz.common</groupId>
......
package com.jz.dm.mall.moduls.controller.company; package com.jz.dm.mall.moduls.controller.company;
import com.jz.common.entity.Department;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq; import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq; import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq;
......
package com.jz.dm.mall.moduls.controller.customer; package com.jz.dm.mall.moduls.controller.customer;
import com.aliyuncs.exceptions.ClientException;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.SMSUtils;
import com.jz.common.utils.StatusCode; import com.jz.common.utils.StatusCode;
import com.jz.common.utils.ValidateCodeUtils; import com.jz.common.utils.ValidateCodeUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -12,8 +10,10 @@ import io.swagger.annotations.ApiOperation; ...@@ -12,8 +10,10 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -50,8 +50,8 @@ public class ValidateCodeController { ...@@ -50,8 +50,8 @@ public class ValidateCodeController {
String code = ValidateCodeUtils.generateValidateCode(6) + ""; String code = ValidateCodeUtils.generateValidateCode(6) + "";
// 发送 // 发送
try { try {
SMSUtils.sendShortMessage(SMSUtils.VALIDATE_CODE, telephone, code); // SMSUtils.sendShortMessage(SMSUtils.VALIDATE_CODE, telephone, code);
} catch (ClientException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return new Result(false, "验证码发送失败!", StatusCode.ERROR); return new Result(false, "验证码发送失败!", StatusCode.ERROR);
} }
...@@ -81,8 +81,8 @@ public class ValidateCodeController { ...@@ -81,8 +81,8 @@ public class ValidateCodeController {
String code = ValidateCodeUtils.generateValidateCode(6) + ""; String code = ValidateCodeUtils.generateValidateCode(6) + "";
// 发送 // 发送
try { try {
SMSUtils.sendShortMessage(SMSUtils.VALIDATE_CODE, telephone, code); // SMSUtils.sendShortMessage(SMSUtils.VALIDATE_CODE, telephone, code);
} catch (ClientException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return new Result(false, "验证码发送失败!", StatusCode.ERROR); return new Result(false, "验证码发送失败!", StatusCode.ERROR);
} }
......
...@@ -5,7 +5,6 @@ import com.jz.common.base.BaseController; ...@@ -5,7 +5,6 @@ import com.jz.common.base.BaseController;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode; import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.entity.DataGoodsApi;
import com.jz.dm.mall.moduls.service.DataGoodsApiService; import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
......
package com.jz.manage.moduls.controller.sys; package com.jz.manage.moduls.controller.sys;
import com.aliyuncs.exceptions.ClientException;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.SMSUtils; import com.jz.common.utils.SMSUtils;
...@@ -41,7 +40,7 @@ public class ValidateCodeController { ...@@ -41,7 +40,7 @@ public class ValidateCodeController {
// 发送 // 发送
try { try {
SMSUtils.sendShortMessage(SMSUtils.VALIDATE_CODE, telephone, code); SMSUtils.sendShortMessage(SMSUtils.VALIDATE_CODE, telephone, code);
} catch (ClientException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return new Result(false, "验证码发送失败!"); return new Result(false, "验证码发送失败!");
} }
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<swagger-bootstrap-ui.version>1.9.6</swagger-bootstrap-ui.version> <swagger-bootstrap-ui.version>1.9.6</swagger-bootstrap-ui.version>
<lombok.version>1.18.16</lombok.version> <lombok.version>1.18.16</lombok.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version> <spring-cloud.version>Finchley.SR1</spring-cloud.version>
<commons-net.version>3.5</commons-net.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
...@@ -216,6 +217,11 @@ ...@@ -216,6 +217,11 @@
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>${lombok.version}</version> <version>${lombok.version}</version>
</dependency> </dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>${commons-net.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment