Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-bi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林锐标
slm-bi
Commits
445e3b22
Commit
445e3b22
authored
Jun 17, 2021
by
梁光意
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
判断不能创建顶级分组
parent
3c8ad24f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
InstrumentPanelGroupController.java
.../slm/slmbi/controller/InstrumentPanelGroupController.java
+9
-1
No files found.
src/main/java/com/syc/slm/slmbi/controller/InstrumentPanelGroupController.java
View file @
445e3b22
package
com
.
syc
.
slm
.
slmbi
.
controller
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.slmbi.dto.CreateInstrumentPanelGroupDTO
;
import
com.syc.slm.slmbi.dto.InstrumentPanelGroupDTO
;
import
com.syc.slm.slmbi.exception.SysException
;
import
com.syc.slm.slmbi.service.InstrumentPanelGroupService
;
import
com.syc.slm.slmbi.vo.InstrumentPanelGroupVo
;
import
io.swagger.annotations.Api
;
...
...
@@ -44,7 +46,13 @@ public class InstrumentPanelGroupController extends BaseRestController{
@ApiOperation
(
"保存仪表板分组"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
String
>
saveGroup
(
@PathVariable
String
appId
,
@RequestBody
CreateInstrumentPanelGroupDTO
group
)
{
return
call
(()->
instrumentPanelGroupService
.
saveGroup
(
group
,
appId
));
return
call
(()
->
{
// 不能在service层判断,因为那个方式需要初始化
if
(
StringUtils
.
isBlank
(
group
.
getParentId
()))
{
throw
new
SysException
(
"不能创建顶级分组"
);
}
return
instrumentPanelGroupService
.
saveGroup
(
group
,
appId
);
});
}
@PutMapping
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment