Commit 56f8cd39 authored by ysongq's avatar ysongq

commit

parent e5ac3d62
...@@ -5,10 +5,7 @@ import com.jz.dm.service.ApiDirectionService; ...@@ -5,10 +5,7 @@ import com.jz.dm.service.ApiDirectionService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
/** /**
...@@ -35,7 +32,7 @@ public class ApiDirectionController { ...@@ -35,7 +32,7 @@ public class ApiDirectionController {
* @Date: 2020-12-24 * @Date: 2020-12-24
*/ */
@ApiOperation("api类型列表") @ApiOperation("api类型列表")
@PostMapping(value = "/getApiTypeList") @GetMapping(value = "/getApiTypeList")
public Mono<Result> getApiTypeList(@RequestParam(name = "parentKey") String parentKey) { public Mono<Result> getApiTypeList(@RequestParam(name = "parentKey") String parentKey) {
return Mono.fromSupplier(() -> Result.of_success(apiDirectionService.getApiType(parentKey))); return Mono.fromSupplier(() -> Result.of_success(apiDirectionService.getApiType(parentKey)));
} }
......
package com.jz.dm.mall.moduls.controller.pay.dto; package com.jz.dm.mall.moduls.controller.pay.dto;
import com.jz.common.enums.auth.AuthModeEnum;
import com.jz.common.enums.auth.AuthTypeEnum;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
......
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.auth.AuthModeEnum; import com.jz.common.enums.auth.AuthModeEnum;
import com.jz.common.enums.auth.AuthTypeEnum; import com.jz.common.enums.auth.AuthTypeEnum;
...@@ -14,20 +11,18 @@ import com.jz.common.utils.RestTemplateUtils; ...@@ -14,20 +11,18 @@ import com.jz.common.utils.RestTemplateUtils;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.pay.dto.PayDto; import com.jz.dm.mall.moduls.controller.pay.dto.PayDto;
import com.jz.dm.mall.moduls.controller.pay.req.AuthMallUserApiReq; import com.jz.dm.mall.moduls.controller.pay.req.AuthMallUserApiReq;
import com.jz.dm.mall.moduls.controller.pay.req.StatusReq;
import com.jz.dm.mall.moduls.entity.*; import com.jz.dm.mall.moduls.entity.*;
import com.jz.dm.mall.moduls.mapper.*; import com.jz.dm.mall.moduls.mapper.*;
import com.jz.dm.mall.moduls.service.PayService; import com.jz.dm.mall.moduls.service.PayService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
...@@ -131,7 +126,7 @@ public class PayServiceImpl implements PayService { ...@@ -131,7 +126,7 @@ public class PayServiceImpl implements PayService {
} }
BigDecimal subtract = bigDecimal.subtract(bigDecima2); BigDecimal subtract = bigDecimal.subtract(bigDecima2);
String uri = "http://127.0.0.1:8088/api/auth/mall-user-auth-api"; // TODO String uri = "http://47.115.53.1:8088/api/auth/mall-user-auth-api"; // TODO
AuthMallUserApiReq apiReq = new AuthMallUserApiReq(); AuthMallUserApiReq apiReq = new AuthMallUserApiReq();
if ("04".equals(payDto.getPurchaseMethod())) { if ("04".equals(payDto.getPurchaseMethod())) {
apiReq.setAuthMode(AuthModeEnum.RECORD_TIME_MODE); apiReq.setAuthMode(AuthModeEnum.RECORD_TIME_MODE);
...@@ -175,6 +170,7 @@ public class PayServiceImpl implements PayService { ...@@ -175,6 +170,7 @@ public class PayServiceImpl implements PayService {
} }
/** /**
* 制作有效时间 * 制作有效时间
* @param payDto * @param payDto
......
...@@ -92,6 +92,14 @@ public class DataGoodsController extends BaseController { ...@@ -92,6 +92,14 @@ public class DataGoodsController extends BaseController {
return result; return result;
} }
// @PostMapping("/getJoinType")
// @ApiOperation(value = "调用gateway获取joinType")
// public Result getJoinType(@RequestParam(name = "parentKey") String parentKey) {
// Result result = dataGoodsService.getJoinType(parentKey);
// return null;
// }
/**删除数据商品 /**删除数据商品
* @param DataGoodsRequest * @param DataGoodsRequest
* @return * @return
......
...@@ -34,6 +34,7 @@ public class DataApiUpReq implements Serializable { ...@@ -34,6 +34,7 @@ public class DataApiUpReq implements Serializable {
private String apiUrl; private String apiUrl;
@ApiModelProperty(value = "api请求协议 HTTP/HTTPS") @ApiModelProperty(value = "api请求协议 HTTP/HTTPS")
@NotNull()
private String apiProtocl; private String apiProtocl;
@ApiModelProperty(value = "api返回数据样例") @ApiModelProperty(value = "api返回数据样例")
...@@ -48,8 +49,6 @@ public class DataApiUpReq implements Serializable { ...@@ -48,8 +49,6 @@ public class DataApiUpReq implements Serializable {
@ApiModelProperty(value = "功能") @ApiModelProperty(value = "功能")
private String apiFunction; private String apiFunction;
@ApiModelProperty(value = "客户请求token")
private String requestToken;
@ApiModelProperty(value = "创建人", hidden = true) @ApiModelProperty(value = "创建人", hidden = true)
private String crePerson; private String crePerson;
......
...@@ -67,4 +67,6 @@ public interface DataGoodsService { ...@@ -67,4 +67,6 @@ public interface DataGoodsService {
public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception; public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
Result editStatus(Long goodsId, Long statusId); Result editStatus(Long goodsId, Long statusId);
// Result getJoinType(String parentKey);
} }
\ No newline at end of file
...@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.jz.common.base.CurrentUser;
import com.jz.common.bean.BaseBeanResponse; import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse; import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
...@@ -37,7 +36,6 @@ import java.util.Map; ...@@ -37,7 +36,6 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.RandomUtils;
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.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -230,6 +228,16 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -230,6 +228,16 @@ public class DataGoodsServiceImpl implements DataGoodsService {
} }
return Result.of_error(ResultMsg.UPDATE_FAIL); return Result.of_error(ResultMsg.UPDATE_FAIL);
} }
//
// @Override
// public Result getJoinType(String parentKey) {
// Map headers = new HashMap<>();
// headers.put("Content-type","application/x-www-form-urlencoded;charset=UTF-8");
// String url = "http://127.0.0.1:8088/api/direction/getApiTypeList";
// String s = httpsUtils.submitPost(url,parentKey , headers);
// System.out.println(s);
// return null;
// }
/** /**
...@@ -246,6 +254,9 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -246,6 +254,9 @@ public class DataGoodsServiceImpl implements DataGoodsService {
if (dataApiUpReq == null) { if (dataApiUpReq == null) {
return Result.error("上传失败!"); return Result.error("上传失败!");
} }
if (!StringUtils.isNotEmpty(dataApiUpReq.getReturnType())) {
return Result.error("输出类型不能为空");
}
if (!StringUtils.isNotEmpty(dataApiUpReq.getJoinType())) { if (!StringUtils.isNotEmpty(dataApiUpReq.getJoinType())) {
return Result.error("接入类型不存在!"); return Result.error("接入类型不存在!");
} }
...@@ -290,6 +301,7 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -290,6 +301,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
// String url= "http://127.0.0.1:8088/api/producer/addDataBankApiInfo"; // String url= "http://127.0.0.1:8088/api/producer/addDataBankApiInfo";
String post = httpsUtils.submitPost(url, JSON.toJSONString(apiReq)); String post = httpsUtils.submitPost(url, JSON.toJSONString(apiReq));
System.out.println(post);
JSONObject result = JSON.parseObject(post); JSONObject result = JSON.parseObject(post);
if (!result.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(result.get("data"))){ if (!result.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(result.get("data"))){
return Result.of_error("制作失败!"); return Result.of_error("制作失败!");
......
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