资源录入区分前端与管理后台录入

This commit is contained in:
wangliwen 2022-04-25 12:39:10 +08:00
parent cd0aca28c8
commit 60685c8878
1 changed files with 7 additions and 2 deletions

View File

@ -121,11 +121,16 @@ public class ResourceController {
@PostMapping("/insert")
@ApiOperation("保存")
@LogOperation("保存")
@ApiImplicitParams({
@ApiImplicitParam(name = "source", value = "请求来源", paramType = "string", dataType = "string")
})
//@RequiresPermissions("resource:resource:save")
public Result save(@RequestBody ResourceDTO dto) {
public Result save(@RequestBody ResourceDTO dto, String source) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
if ("f".equals(source)) {
dto.setDelFlag(2); // 来自前端页面
}
resourceService.insertWithAttrs(dto);
return new Result().ok(dto.getId() == null ? "" : dto.getId());