From ecc7e14acd7a54e7c5b8241a19437fd37e858b29 Mon Sep 17 00:00:00 2001 From: laileon Date: Tue, 11 Jul 2017 14:21:18 +0800 Subject: [PATCH] modified template --- src/test/resources/generator/template/controller-restful.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/resources/generator/template/controller-restful.ftl b/src/test/resources/generator/template/controller-restful.ftl index bf72458..76a3856 100644 --- a/src/test/resources/generator/template/controller-restful.ftl +++ b/src/test/resources/generator/template/controller-restful.ftl @@ -21,7 +21,7 @@ public class ${modelNameUpperCamel}Controller { private ${modelNameUpperCamel}Service ${modelNameLowerCamel}Service; @PostMapping - public Result add(${modelNameUpperCamel} ${modelNameLowerCamel}) { + public Result add(@RequestBody ${modelNameUpperCamel} ${modelNameLowerCamel}) { ${modelNameLowerCamel}Service.save(${modelNameLowerCamel}); return ResultGenerator.genSuccessResult(); } @@ -33,7 +33,7 @@ public class ${modelNameUpperCamel}Controller { } @PutMapping - public Result update(${modelNameUpperCamel} ${modelNameLowerCamel}) { + public Result update(@RequestBody ${modelNameUpperCamel} ${modelNameLowerCamel}) { ${modelNameLowerCamel}Service.update(${modelNameLowerCamel}); return ResultGenerator.genSuccessResult(); }