Commit ad561ab9 authored by ysongq's avatar ysongq

commit

parent 1e9b3f69
...@@ -201,7 +201,7 @@ public final class WebUtils { ...@@ -201,7 +201,7 @@ public final class WebUtils {
* @param data * @param data
* @return * @return
*/ */
public static String postJSON(String uri, Object data) { public static String postJSON(String uri, Object data) throws Exception{
log.info("向银行发起参数:{}", JSONObject.toJSONString(data)); log.info("向银行发起参数:{}", JSONObject.toJSONString(data));
CloseableHttpClient httpClient = getHttpClient(uri); CloseableHttpClient httpClient = getHttpClient(uri);
HttpPost method = new HttpPost(uri); HttpPost method = new HttpPost(uri);
...@@ -240,6 +240,7 @@ public final class WebUtils { ...@@ -240,6 +240,7 @@ public final class WebUtils {
log.info("Get Response Content():\n {}", readContent); log.info("Get Response Content():\n {}", readContent);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
throw e;
} finally { } finally {
try { try {
httpClient.close(); httpClient.close();
......
...@@ -85,13 +85,9 @@ public class DataGoodsController extends BaseController { ...@@ -85,13 +85,9 @@ public class DataGoodsController extends BaseController {
Result result = new Result(); Result result = new Result();
try{ try{
result = dataGoodsService.uploadApi(dataApiUpReq); result = dataGoodsService.uploadApi(dataApiUpReq);
result.getMessage();
result.getCode();
result.getData();
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
result.getMessage(); result = new Result(false, "api上传失败");
result.getCode();
} }
return result; return result;
} }
......
...@@ -66,4 +66,7 @@ public class MakeDataBankApiReq implements Serializable { ...@@ -66,4 +66,7 @@ public class MakeDataBankApiReq implements Serializable {
@ApiModelProperty(value = "api样例",required = false) @ApiModelProperty(value = "api样例",required = false)
public String apiExample; public String apiExample;
@ApiModelProperty(value = "文件id")
public Long fileId;
} }
...@@ -200,7 +200,7 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -200,7 +200,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result uploadApi(DataApiUpReq dataApiUpReq) { public Result uploadApi(DataApiUpReq dataApiUpReq) throws Exception {
// 获取当前用户 // 获取当前用户
SysUserDto user = (SysUserDto) redisTemplate.opsForValue().get("user_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS); SysUserDto user = (SysUserDto) redisTemplate.opsForValue().get("user_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
...@@ -259,6 +259,9 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -259,6 +259,9 @@ public class DataGoodsServiceImpl implements DataGoodsService {
apiReq.setRequestParam("sdadasdd"); apiReq.setRequestParam("sdadasdd");
apiReq.setResponseParam("fklfhklfhlh"); apiReq.setResponseParam("fklfhklfhlh");
apiReq.setRespCode("sdkadlahlf"); apiReq.setRespCode("sdkadlahlf");
// apiReq.setFileId(1L);
// 赋值params // 赋值params
Long goodsApi = dataGoodsApi.getGoodsApi(); Long goodsApi = dataGoodsApi.getGoodsApi();
if (goodsApi != null) { if (goodsApi != null) {
...@@ -281,6 +284,7 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -281,6 +284,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
WebUtils.postJSON(url, apiReq); WebUtils.postJSON(url, apiReq);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw e;
} }
......
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