Skip to content

Commit

Permalink
Change 代码生成模板
Browse files Browse the repository at this point in the history
  • Loading branch information
enilu committed Jun 8, 2021
1 parent 668f097 commit d080137
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flash-generator/src/main/resources/code/controller.vm
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@ public class ${table.ControllerClassName} extends BaseController {
@Autowired
private ${table.ServiceClassName} ${table.ServiceInstanceName};

@RequestMapping(value = "/list",method = RequestMethod.GET)
@GetMapping(value = "/list")
@RequiresPermissions(value = "${table.UriPrefix}")
public Object list(@RequestParam(required = false) Long id) {
Page<${table.EntityClassName}> page = new PageFactory<${table.EntityClassName}>().defaultPage();
page.addFilter("id",id);
page = ${table.ServiceInstanceName}.queryPage(page);
return Rets.success(page);
}
@RequestMapping(method = RequestMethod.POST)
@PostMapping
@BussinessLog(value = "新增${table.Label}", key = "name")
@RequiresPermissions(value = "${table.UriPrefix}/add")
public Object add(@ModelAttribute ${table.EntityClassName} ${table.entityNameLowerFirstChar}){
${table.ServiceInstanceName}.insert(${table.entityNameLowerFirstChar});
return Rets.success();
}
@RequestMapping(method = RequestMethod.PUT)
@PutMapping
@BussinessLog(value = "更新${table.Label}", key = "name")
@RequiresPermissions(value = "${table.UriPrefix}/update")
public Object update(@ModelAttribute ${table.EntityClassName} ${table.entityNameLowerFirstChar}){
${table.ServiceInstanceName}.update(${table.entityNameLowerFirstChar});
return Rets.success();
}
@RequestMapping(method = RequestMethod.DELETE)
@DeleteMapping
@BussinessLog(value = "删除${table.Label}", key = "id")
@RequiresPermissions(value = "${table.UriPrefix}/delete")
public Object remove(Long id){
Expand Down

0 comments on commit d080137

Please # to comment.