feat: 草稿删除

This commit is contained in:
2024-07-18 09:00:08 +08:00
parent be809bc752
commit e3def8d17e
@@ -286,4 +286,18 @@ public class WorkCenterController {
return Result.OK();
}
@AutoLog(value = "删除草稿")
@ApiOperation(value = "删除草稿")
@PostMapping("/deleteDraft")
public Result<?> deleteDraft(@RequestBody Map<String, String> map) {
String id = map.get("id");
// 判断当前登录人是否属于草稿的所有人
ProcessDraft processDraft = processDraftService.getById(id);
if (!CurrentUserUtil.getId().equals(processDraft.getUserId())) {
return Result.error(MessageUtils.getMessage(ResultCommon.NO_PERMISSION));
}
processDraftService.removeById(id);
return Result.OK();
}
}