提交 a2461c92 authored 作者: mry's avatar mry

fix(web): 修改了swaggerController

上级 45f35dcc
...@@ -4,9 +4,9 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,9 +4,9 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.matrix.database.entity.Environment;
import org.matrix.database.entity.InterfaceInformation; import org.matrix.database.entity.InterfaceInformation;
import org.matrix.database.entity.Parameter; import org.matrix.database.entity.Parameter;
import org.matrix.database.entity.Environment;
import org.matrix.database.service.IEnvironmentService; import org.matrix.database.service.IEnvironmentService;
import org.matrix.exception.GlobalException; import org.matrix.exception.GlobalException;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -151,20 +151,23 @@ public class SwaggerController { ...@@ -151,20 +151,23 @@ public class SwaggerController {
Object tags = objRequestMaps.get("tags"); Object tags = objRequestMaps.get("tags");
Object summary = objRequestMaps.get("summary"); Object summary = objRequestMaps.get("summary");
List<Parameter> parameterAllList = new ArrayList<>(); List<Parameter> parameterAllList = new ArrayList<>();
InterfaceInformation interfaceInformation = new InterfaceInformation();
if (parameters != null) { if (parameters != null) {
@SuppressWarnings(value = "all") @SuppressWarnings(value = "all")
List<String> parameterLists = (List<String>) parameters; List<String> parameterLists = (List<String>) parameters;
Parameter parameter = new Parameter();
InterfaceInformation interfaceInformation = new InterfaceInformation();
for (Object parameterList : parameterLists) { for (Object parameterList : parameterLists) {
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
Map<String, String> parameterMaps = (Map<String, String>) parameterList; Map<String, String> parameterMaps = (Map<String, String>) parameterList;
String methodIn = parameterMaps.get("in");
String methodName = parameterMaps.get("name");
String methodType = parameterMaps.get("type");
Parameter parameter = new Parameter();
//传参格式 //传参格式
parameter.setIn(parameterMaps.get("in")); parameter.setIn(methodIn);
//拿到参数名称 //拿到参数名称
parameter.setName(parameterMaps.get("name")); parameter.setName(methodName);
//拿到参数类型 //拿到参数类型
parameter.setType(parameterMaps.get("type")); parameter.setType(methodType);
parameterAllList.add(parameter); parameterAllList.add(parameter);
} }
interfaceInformation.setHost(String.valueOf(host)); interfaceInformation.setHost(String.valueOf(host));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论