|
|
@ -74,7 +74,7 @@ public class Controler { |
|
|
|
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
param.put("key", methodName.substring(3)); |
|
|
|
param.put("type", method.getReturnType().getSimpleName()); |
|
|
|
param.put("type", method.getReturnType().getName()); |
|
|
|
param.put("group", paramAnnotation.group()); |
|
|
|
param.put("name",paramAnnotation.name()); |
|
|
|
param.put("value", method.invoke(paramService)); |
|
|
@ -246,4 +246,26 @@ public class Controler { |
|
|
|
} |
|
|
|
return AppRet.success(actionResult); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/api/service-config/class-struct-info-get") |
|
|
|
@ResponseBody |
|
|
|
public AppRet<Object> classStructInfoGet( @RequestBody Map<String, Object> params ) throws Exception { |
|
|
|
String className = (String)params.get("class"); |
|
|
|
Class<?> clazz = Class.forName(className); |
|
|
|
List<Map<String,Object>> struct = new ArrayList<>(); |
|
|
|
this.classStructInfoFill(clazz, struct); |
|
|
|
return AppRet.success(struct); |
|
|
|
} |
|
|
|
|
|
|
|
// fill up struct info |
|
|
|
private void classStructInfoFill( Class<?> clazz, List<Map<String,Object>> struct ) { |
|
|
|
var fields = clazz.getFields(); |
|
|
|
for ( var item : fields ) { |
|
|
|
var filed = new HashMap<String,Object>(); |
|
|
|
filed.put("name", item.getName()); |
|
|
|
filed.put("type", item.getType().getName()); |
|
|
|
filed.put("typeShort", item.getType().getSimpleName()); |
|
|
|
struct.add(filed); |
|
|
|
} |
|
|
|
} |
|
|
|
} |