feat: 菜单新增接口完成
This commit is contained in:
parent
8cba4462c8
commit
92b01751bf
@ -38,5 +38,9 @@ public class SystemController {
|
||||
public ResponseEntity updateMenu(@RequestBody MenuDataItem menuDataItem) {
|
||||
return ResponseEntity.ok(systemService.updateMenu(menuDataItem));
|
||||
}
|
||||
@PostMapping("/menu-add")
|
||||
public ResponseEntity addMenu(@RequestBody MenuDataItem menuDataItem) {
|
||||
return ResponseEntity.ok(systemService.addMenu(menuDataItem));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,4 +9,6 @@ public interface SystemService {
|
||||
ResponseResult getMenuAll();
|
||||
|
||||
ResponseResult updateMenu(MenuDataItem menuDataItem);
|
||||
|
||||
ResponseResult addMenu(MenuDataItem menuDataItem);
|
||||
}
|
||||
|
@ -62,4 +62,19 @@ public class SystemServiceImpl implements SystemService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult addMenu(MenuDataItem menuDataItem) {
|
||||
try{
|
||||
int success = systemMapper.insert(menuDataItem);
|
||||
if (success==1) {
|
||||
return ResponseResult.success("菜单新增成功");
|
||||
} else {
|
||||
return ResponseResult.info(0,"菜单新增失败");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return ResponseResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user