|
45 | 45 | */ |
46 | 46 | public class ParamsBuildHelper extends BaseHelper { |
47 | 47 |
|
| 48 | + /** |
| 49 | + * Builds a parameter list based on field information. |
| 50 | + * @param className The name of the generic type. |
| 51 | + * @param pre A prefix builder for nested fields. |
| 52 | + * @param level The next level of nesting. |
| 53 | + * @param isRequired Indicates whether the parameter is required. |
| 54 | + * @param isResp Indicates whether the parameter is a response parameter. |
| 55 | + * @param registryClasses A collection of registered classes. |
| 56 | + * @param projectBuilder A project builder instance. |
| 57 | + * @param groupClasses A collection of grouped classes. |
| 58 | + * @param pid The parent ID of the field. |
| 59 | + * @param jsonRequest The JSON request object. |
| 60 | + * @param atomicInteger An AtomicInteger for ID generation. |
| 61 | + * <p> |
| 62 | + * This method handles various types of fields and their values, including handling |
| 63 | + * self-referential loops, maps, arrays, objects, and primitive types. It adds |
| 64 | + * parameters to the paramList based on the type and structure of the given field, |
| 65 | + * recursively calling itself for nested or complex types. |
| 66 | + * @return A List of ApiParam instances representing the built parameters. |
| 67 | + */ |
48 | 68 | public static List<ApiParam> buildParams(String className, String pre, int level, String isRequired, boolean isResp, |
49 | 69 | Map<String, String> registryClasses, ProjectDocConfigBuilder projectBuilder, Set<String> groupClasses, |
50 | 70 | int pid, boolean jsonRequest, AtomicInteger atomicInteger) { |
@@ -384,7 +404,7 @@ else if (DocAnnotationConstants.JSON_FORMAT.equals(simpleAnnotationName)) { |
384 | 404 | for (int j = 0; j < level; j++) { |
385 | 405 | preBuilder.append(DocGlobalConstants.FIELD_SPACE); |
386 | 406 | } |
387 | | - preBuilder.append("└─"); |
| 407 | + preBuilder.append(DocGlobalConstants.PARAM_PREFIX); |
388 | 408 | int fieldPid; |
389 | 409 | ApiParam param = ApiParam.of() |
390 | 410 | .setField(pre + fieldName) |
@@ -664,7 +684,7 @@ private static List<ApiParam> buildMapParam(String[] globGicName, String pre, in |
664 | 684 | for (int j = 0; j < level; j++) { |
665 | 685 | preBuilder.append(DocGlobalConstants.FIELD_SPACE); |
666 | 686 | } |
667 | | - preBuilder.append("└─"); |
| 687 | + preBuilder.append(DocGlobalConstants.PARAM_PREFIX); |
668 | 688 | paramList.addAll(buildParams(globGicName[1], preBuilder.toString(), ++nextLevel, isRequired, isResp, |
669 | 689 | registryClasses, projectBuilder, groupClasses, pid, jsonRequest, atomicInteger)); |
670 | 690 | return paramList; |
|
0 commit comments