mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-01 15:37:41 +08:00
Fix reserved word columns and update field names
This commit is contained in:
@@ -12,23 +12,23 @@ import java.util.List;
|
||||
public class CategoryService {
|
||||
private final CategoryRepository categoryRepository;
|
||||
|
||||
public Category createCategory(String name, String describe, String icon, String smallIcon) {
|
||||
public Category createCategory(String name, String description, String icon, String smallIcon) {
|
||||
Category category = new Category();
|
||||
category.setName(name);
|
||||
category.setDescribe(describe);
|
||||
category.setDescription(description);
|
||||
category.setIcon(icon);
|
||||
category.setSmallIcon(smallIcon);
|
||||
return categoryRepository.save(category);
|
||||
}
|
||||
|
||||
public Category updateCategory(Long id, String name, String describe, String icon, String smallIcon) {
|
||||
public Category updateCategory(Long id, String name, String description, String icon, String smallIcon) {
|
||||
Category category = categoryRepository.findById(id)
|
||||
.orElseThrow(() -> new IllegalArgumentException("Category not found"));
|
||||
if (name != null) {
|
||||
category.setName(name);
|
||||
}
|
||||
if (describe != null) {
|
||||
category.setDescribe(describe);
|
||||
if (description != null) {
|
||||
category.setDescription(description);
|
||||
}
|
||||
if (icon != null) {
|
||||
category.setIcon(icon);
|
||||
|
||||
@@ -12,23 +12,23 @@ import java.util.List;
|
||||
public class TagService {
|
||||
private final TagRepository tagRepository;
|
||||
|
||||
public Tag createTag(String name, String describe, String icon, String smallIcon) {
|
||||
public Tag createTag(String name, String description, String icon, String smallIcon) {
|
||||
Tag tag = new Tag();
|
||||
tag.setName(name);
|
||||
tag.setDescribe(describe);
|
||||
tag.setDescription(description);
|
||||
tag.setIcon(icon);
|
||||
tag.setSmallIcon(smallIcon);
|
||||
return tagRepository.save(tag);
|
||||
}
|
||||
|
||||
public Tag updateTag(Long id, String name, String describe, String icon, String smallIcon) {
|
||||
public Tag updateTag(Long id, String name, String description, String icon, String smallIcon) {
|
||||
Tag tag = tagRepository.findById(id)
|
||||
.orElseThrow(() -> new IllegalArgumentException("Tag not found"));
|
||||
if (name != null) {
|
||||
tag.setName(name);
|
||||
}
|
||||
if (describe != null) {
|
||||
tag.setDescribe(describe);
|
||||
if (description != null) {
|
||||
tag.setDescription(description);
|
||||
}
|
||||
if (icon != null) {
|
||||
tag.setIcon(icon);
|
||||
|
||||
Reference in New Issue
Block a user