mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-22 21:21:06 +08:00
Fix reserved word columns and update field names
This commit is contained in:
@@ -19,13 +19,13 @@ public class CategoryController {
|
||||
|
||||
@PostMapping
|
||||
public CategoryDto create(@RequestBody CategoryRequest req) {
|
||||
Category c = categoryService.createCategory(req.getName(), req.getDescribe(), req.getIcon(), req.getSmallIcon());
|
||||
Category c = categoryService.createCategory(req.getName(), req.getDescription(), req.getIcon(), req.getSmallIcon());
|
||||
return toDto(c);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public CategoryDto update(@PathVariable Long id, @RequestBody CategoryRequest req) {
|
||||
Category c = categoryService.updateCategory(id, req.getName(), req.getDescribe(), req.getIcon(), req.getSmallIcon());
|
||||
Category c = categoryService.updateCategory(id, req.getName(), req.getDescription(), req.getIcon(), req.getSmallIcon());
|
||||
return toDto(c);
|
||||
}
|
||||
|
||||
@@ -67,14 +67,14 @@ public class CategoryController {
|
||||
dto.setName(c.getName());
|
||||
dto.setIcon(c.getIcon());
|
||||
dto.setSmallIcon(c.getSmallIcon());
|
||||
dto.setDescribe(c.getDescribe());
|
||||
dto.setDescription(c.getDescription());
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Data
|
||||
private static class CategoryRequest {
|
||||
private String name;
|
||||
private String describe;
|
||||
private String description;
|
||||
private String icon;
|
||||
private String smallIcon;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class CategoryController {
|
||||
private static class CategoryDto {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String describe;
|
||||
private String description;
|
||||
private String icon;
|
||||
private String smallIcon;
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ public class TagController {
|
||||
|
||||
@PostMapping
|
||||
public TagDto create(@RequestBody TagRequest req) {
|
||||
Tag tag = tagService.createTag(req.getName(), req.getDescribe(), req.getIcon(), req.getSmallIcon());
|
||||
Tag tag = tagService.createTag(req.getName(), req.getDescription(), req.getIcon(), req.getSmallIcon());
|
||||
return toDto(tag);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public TagDto update(@PathVariable Long id, @RequestBody TagRequest req) {
|
||||
Tag tag = tagService.updateTag(id, req.getName(), req.getDescribe(), req.getIcon(), req.getSmallIcon());
|
||||
Tag tag = tagService.updateTag(id, req.getName(), req.getDescription(), req.getIcon(), req.getSmallIcon());
|
||||
return toDto(tag);
|
||||
}
|
||||
|
||||
@@ -67,14 +67,14 @@ public class TagController {
|
||||
dto.setName(tag.getName());
|
||||
dto.setIcon(tag.getIcon());
|
||||
dto.setSmallIcon(tag.getSmallIcon());
|
||||
dto.setDescribe(tag.getDescribe());
|
||||
dto.setDescription(tag.getDescription());
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Data
|
||||
private static class TagRequest {
|
||||
private String name;
|
||||
private String describe;
|
||||
private String description;
|
||||
private String icon;
|
||||
private String smallIcon;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class TagController {
|
||||
private static class TagDto {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String describe;
|
||||
private String description;
|
||||
private String icon;
|
||||
private String smallIcon;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user