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

Resource发布

上级 aafde95a
......@@ -57,7 +57,7 @@ public class {{apiEntity.codeName}}Resource {
{{#each apiEntity.methods}}
@ApiOperation(value = "{{apiEntity.entity.logicName}}", tags = {"{{apiEntity.entity.logicName}}" }, notes = "{{apiEntity.entity.logicName}}")
@RequestMapping(method = RequestMethod.{{requestMethod}}, value = "{{requestPath}}")
public ResponseEntity {{camelCase name}}({{#each pathVariables}}{{#gt @index 0}}, {{/gt}}@PathVariable("{{camelCase name}}") {{type.java}} {{camelCase name}}{{/each}}{{#if body}}{{#if pathVariables}}, {{/if}}@Validated @RequestBody {{body}} {{camelCase body}}{{/if}}) {
public ResponseEntity {{camelCase name}}({{#each pathVariables}}{{#unless @first}}, {{/unless}}@PathVariable("{{camelCase name}}") {{type.java}} {{camelCase name}}{{/each}}{{#if body}}{{#if pathVariables}}, {{/if}}@Validated @RequestBody {{body}} {{camelCase body}}{{/if}}) {
{{!行为}}
{{#eq methodType "DEACTION"}}
{{!行为参数准备}}
......@@ -71,12 +71,12 @@ public class {{apiEntity.codeName}}Resource {
{{camelCase apiEntity.entity.codeName}}Service.{{camelCase name}}({{camelCase apiEntity.entity.codeName}});
{{/eq}}
{{#eq input.type "KEYFIELD"}}
{{#neq name "Get"}}
{{camelCase apiEntity.entity.codeName}}Service.{{camelCase name}}({{camelCase apiEntity.entity.keyField.codeName}});
{{/neq}}
{{#eq name "Get"}}
{{#eq return.type "DTO"}}
{{apiEntity.entity.codeName}} {{camelCase apiEntity.entity.codeName}} = {{camelCase apiEntity.entity.codeName}}Service.{{camelCase name}}({{camelCase apiEntity.entity.keyField.codeName}});
{{/eq}}
{{#neq return.type "DTO"}}
{{camelCase apiEntity.entity.codeName}}Service.{{camelCase name}}({{camelCase apiEntity.entity.keyField.codeName}});
{{/neq}}
{{/eq}}
{{!返回处理}}
{{#eq return.type "DTO"}}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册