【修复】教程修改分类不生效问题

This commit is contained in:
2025-12-04 18:41:26 +08:00
parent eec3fc663b
commit 6da50d70d0
2 changed files with 2 additions and 2 deletions

View File

@@ -56,7 +56,7 @@ public class BizTutorialController {
@PostMapping("/update") @PostMapping("/update")
@ResponseBody @ResponseBody
public Result<String> update(@RequestBody Tutorial tutorial) { public Result<String> update(@RequestBody Tutorial tutorial) {
return Result.isBool(tutorialService.updateById(tutorial)); return Result.isBool(tutorialService.update(tutorial));
} }
/** /**

View File

@@ -57,7 +57,7 @@ public class TutorialServiceImpl extends ServiceImpl<TutorialMapper, Tutorial> i
@Override @Override
public boolean update(Tutorial tutorial) { public boolean update(Tutorial tutorial) {
super.updateById(tutorial); super.updateById(tutorial);
tutorialCategoryRelationService.remove(new LambdaQueryWrapper<TutorialCategoryRelation>().eq(TutorialCategoryRelation::getCategoryId, tutorial.getCategoryId())); tutorialCategoryRelationService.remove(new LambdaQueryWrapper<TutorialCategoryRelation>().eq(TutorialCategoryRelation::getTutorialId, tutorial.getId()));
TutorialCategoryRelation tutorialCategoryRelation = new TutorialCategoryRelation(); TutorialCategoryRelation tutorialCategoryRelation = new TutorialCategoryRelation();
tutorialCategoryRelation.setTutorialId(tutorial.getId()); tutorialCategoryRelation.setTutorialId(tutorial.getId());
tutorialCategoryRelation.setCategoryId(tutorial.getCategoryId()); tutorialCategoryRelation.setCategoryId(tutorial.getCategoryId());