zhangjinli 3 years ago
parent 2ba21016d6
commit 2c85fef5a3

@ -196,23 +196,23 @@ public class ReferenceController {
@AdminTokenValid @AdminTokenValid
@AdminCheckAuthorityAnnotation(jurisdictionId = "109") @AdminCheckAuthorityAnnotation(jurisdictionId = "109")
public Result del(@Validated @RequestBody DelRParam param) { public Result del(@Validated @RequestBody DelRParam param) {
List<Reference> rList = referenceService.list(new QueryWrapper<Reference>().in("id", param.getIdList())); // List<Reference> rList = referenceService.list(new QueryWrapper<Reference>().in("id", param.getIdList()));
// 删除素材字段 // // 删除素材字段
referenceService.update(new UpdateWrapper<Reference>().in("id", param.getIdList()).set("isDeleted", 1)); // referenceService.update(new UpdateWrapper<Reference>().in("id", param.getIdList()).set("isDeleted", 1));
//删除素材文件 // //删除素材文件
for (Reference r : rList) { // for (Reference r : rList) {
if (path != null) { // if (path != null) {
if (r.getFileUrl() != null) { // if (r.getFileUrl() != null) {
new File(path + "/upload" + r.getFileUrl()).delete(); // new File(path + "/upload" + r.getFileUrl()).delete();
} // }
if (r.getCoverUrl() != null) { // if (r.getCoverUrl() != null) {
new File(path + "/upload" + r.getCoverUrl()).delete(); // new File(path + "/upload" + r.getCoverUrl()).delete();
} // }
} // }
} // }
//删除素材任务关联 // //删除素材任务关联
taskReferenceService.remove(new UpdateWrapper<TaskReference>().in("referenceId", param.getIdList())); // taskReferenceService.remove(new UpdateWrapper<TaskReference>().in("referenceId", param.getIdList()));
return Result.success(); return MybatisPlusUtil.sqlResult( referenceService.update(new UpdateWrapper<Reference>().in("id", param.getIdList()).set("isDeleted", 1)),"删除");
} }

@ -76,7 +76,7 @@ public class TopicActivityController {
public Result add(@Validated @RequestBody AddTopicParam param) { public Result add(@Validated @RequestBody AddTopicParam param) {
TopicActivity topicActivity = new TopicActivity() TopicActivity topicActivity = new TopicActivity()
.setTitle(param.getTitle()) .setTitle(param.getTitle())
.setSubtitle(param.getSubtitle()) .setSubtitle(param.getSubtitle().trim())
.setType(param.getType()) .setType(param.getType())
.setContent(param.getContent()) .setContent(param.getContent())
.setDuration(param.getDuration()) .setDuration(param.getDuration())

Loading…
Cancel
Save