提交 aafde95a 编写于 作者: xignzi006's avatar xignzi006

Resource发布

上级 a03c6ef1
......@@ -48,7 +48,7 @@ public class ApiMethodModel extends BaseModel {
if (!CollectionUtils.isEmpty(parentApiEntities)) {
for (ApiEntityRSModel apiRs : parentApiEntities) {
String strMajorEntityPlurlize = Inflector.getInstance().pluralize(StringAdvUtils.camelcase(apiRs.getMajorEntityCodeName()).toLowerCase());
path = String.format("/%s/{%s}", strMajorEntityPlurlize,StringAdvUtils.camelcase(apiRs.getParentIdFieldCodeName())) + path;
path = String.format("/%s/{%s}", strMajorEntityPlurlize, StringAdvUtils.camelcase(apiRs.getParentIdFieldCodeName())) + path;
}
}
......@@ -76,7 +76,7 @@ public class ApiMethodModel extends BaseModel {
JSONObject pathVariable = new JSONObject();
pathVariable.put("name", apiRs.getParentIdFieldCodeName());
pathVariable.put("type", PropType.findType(apiRs.getParentIdFieldType()));
pathVariables.add(pathVariable);
pathVariables.add(0, pathVariable);
}
}
if (getPSDEServiceAPIMethod().isNeedResourceKey()) {
......@@ -92,11 +92,6 @@ public class ApiMethodModel extends BaseModel {
IPSDEServiceAPIMethodInput iPSDEServiceAPIMethodInput = getPSDEServiceAPIMethod().getPSDEServiceAPIMethodInput();
if (iPSDEServiceAPIMethodInput != null) {
if ("DTO".equals(iPSDEServiceAPIMethodInput.getType())) {
try {
iPSDEServiceAPIMethodInput.getPSDEMethodDTO();
} catch (Exception e) {
int i = 0;
}
if ("DEFAULT".equals(iPSDEServiceAPIMethodInput.getPSDEMethodDTO().getType()))
return iPSDEServiceAPIMethodInput.getPSDEMethodDTO().getName();
else if ("DEFILTER".equals(iPSDEServiceAPIMethodInput.getPSDEMethodDTO().getType()))
......
......@@ -64,7 +64,9 @@ public class {{apiEntity.codeName}}Resource {
{{#eq input.type "DTO"}}
{{apiEntity.entity.codeName}} {{camelCase apiEntity.entity.codeName}} = {{camelCase input.pSDEMethodDTO.name}}Mapping.toDomain({{camelCase body}});
{{#each pathVariables}}
{{#if @last}}
{{camelCase apiEntity.entity.codeName}}.set{{pascalCase name}}({{camelCase name}});
{{/if}}
{{/each}}
{{camelCase apiEntity.entity.codeName}}Service.{{camelCase name}}({{camelCase apiEntity.entity.codeName}});
{{/eq}}
......@@ -93,7 +95,9 @@ public class {{apiEntity.codeName}}Resource {
{{!数据集}}
{{#eq methodType "FETCH"}}
{{#each pathVariables}}
{{#if @last}}
{{camelCase body}}.set{{pascalCase name}}EQ({{camelCase name}});
{{/if}}
{{/each}}
Page<{{apiEntity.entity.codeName}}> domains = {{camelCase apiEntity.entity.codeName}}Service.search{{pSDEDataSet.codeName}}({{camelCase body}}) ;
List<{{return.pSDEMethodDTO.name}}> list = {{camelCase return.pSDEMethodDTO.name}}Mapping.toDto(domains.getContent());
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册