Skip to content

Commit

Permalink
fix(extension/crud): 修复 Name for argument of type [java.lang.Long] no…
Browse files Browse the repository at this point in the history
…t specified, and parameter name information not available via reflection. 错误
  • Loading branch information
Charles7c committed Jul 18, 2024
1 parent 65cfe91 commit c17668c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public R<List<L>> list(Q query, SortQuery sortQuery) {
@Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH)
@ResponseBody
@GetMapping("/{id}")
public R<D> get(@PathVariable Long id) {
public R<D> get(@PathVariable("id") Long id) {
this.checkPermission(Api.LIST);
return R.ok(baseService.get(id));
}
Expand Down Expand Up @@ -140,7 +140,7 @@ public R<Long> add(@Validated(ValidateGroup.Crud.Add.class) @RequestBody C req)
@Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH)
@ResponseBody
@PutMapping("/{id}")
public R<Void> update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody C req, @PathVariable Long id) {
public R<Void> update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody C req, @PathVariable("id") Long id) {
this.checkPermission(Api.UPDATE);
baseService.update(req, id);
return R.ok("修改成功");
Expand All @@ -156,7 +156,7 @@ public R<Void> update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody C
@Parameter(name = "ids", description = "ID 列表", example = "1,2", in = ParameterIn.PATH)
@ResponseBody
@DeleteMapping("/{ids}")
public R<Void> delete(@PathVariable List<Long> ids) {
public R<Void> delete(@PathVariable("ids") List<Long> ids) {
this.checkPermission(Api.DELETE);
baseService.delete(ids);
return R.ok("删除成功");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public R<List<L>> list(Q query, SortQuery sortQuery) {
@Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH)
@ResponseBody
@GetMapping("/{id}")
public R<D> get(@PathVariable Long id) {
public R<D> get(@PathVariable("id") Long id) {
this.checkPermission(Api.LIST);
return R.ok(baseService.get(id));
}
Expand Down Expand Up @@ -140,7 +140,7 @@ public R<Long> add(@Validated(ValidateGroup.Crud.Add.class) @RequestBody C req)
@Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH)
@ResponseBody
@PutMapping("/{id}")
public R<Void> update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody C req, @PathVariable Long id) {
public R<Void> update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody C req, @PathVariable("id") Long id) {
this.checkPermission(Api.UPDATE);
baseService.update(req, id);
return R.ok("修改成功");
Expand All @@ -156,7 +156,7 @@ public R<Void> update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody C
@Parameter(name = "ids", description = "ID 列表", example = "1,2", in = ParameterIn.PATH)
@ResponseBody
@DeleteMapping("/{ids}")
public R<Void> delete(@PathVariable List<Long> ids) {
public R<Void> delete(@PathVariable("ids") List<Long> ids) {
this.checkPermission(Api.DELETE);
baseService.delete(ids);
return R.ok("删除成功");
Expand Down

0 comments on commit c17668c

Please sign in to comment.