模板添加两个参数

This commit is contained in:
2025-02-19 14:36:27 +08:00
parent e87ce424fb
commit 373922bbbf
6 changed files with 21 additions and 16 deletions

View File

@ -70,9 +70,9 @@ public class TemplateServiceImpl implements TemplateService {
@Override
public ApiResponse<Integer> deleteById(Long id) {
int i = templateMapper.deleteById(id);
templateRepository.clearTemplateCache(id);
if (i > 0) {
templateMapper.deleteByPid(id);
templateRepository.clearTemplateCache(id);
return ApiResponse.success(i);
}else {
return ApiResponse.fail("删除模版失败");
@ -92,8 +92,8 @@ public class TemplateServiceImpl implements TemplateService {
item.setStatus(1);
templateMapper.add(item);
});
templateRepository.clearTemplateCache(template.getId());
}
templateRepository.clearTemplateCache(template.getId());
if (i > 0) {
return ApiResponse.success(true);
}else {
@ -120,7 +120,7 @@ public class TemplateServiceImpl implements TemplateService {
@Override
public void saveConfig(Long configId, TemplateConfigEntity config) {
config.setId(configId);
templateRepository.clearTemplateCache(config.getTemplateId());
templateMapper.updateConfigById(config);
templateRepository.clearTemplateCache(config.getTemplateId());
}
}