diff --git a/ym-generator/src/main/resources/templates/controller.java.vm b/ym-generator/src/main/resources/templates/controller.java.vm index fc2f2b1..ebd19b7 100644 --- a/ym-generator/src/main/resources/templates/controller.java.vm +++ b/ym-generator/src/main/resources/templates/controller.java.vm @@ -68,26 +68,26 @@ public class ${table.controllerName} { @ApiOperation("保存") @LogOperation("保存") @PreAuthorize("@ex.hasAuthority('${package.ModuleName}:${table.entityPath}:save')") - public Result save(@RequestBody ${entity}DTO dto){ + public Result save(@RequestBody ${entity}DTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ${table.entityPath}Service.save(dto); - return new Result(); + return new Result().ok(dto.getId()); } @PutMapping @ApiOperation("修改") @LogOperation("修改") @PreAuthorize("@ex.hasAuthority('${package.ModuleName}:${table.entityPath}:update')") - public Result update(@RequestBody ${entity}DTO dto){ + public Result update(@RequestBody ${entity}DTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); ${table.entityPath}Service.update(dto); - return new Result(); + return new Result().ok(dto.getId()); } @DeleteMapping