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
eff42b35
Commit
eff42b35
authored
May 15, 2021
by
linruibiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口编写
parent
46900d55
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
InstrumentPanelConfigController.java
...slm/slmbi/controller/InstrumentPanelConfigController.java
+12
-4
InstrumentPanelConfigVo.java
...in/java/com/syc/slm/slmbi/vo/InstrumentPanelConfigVo.java
+4
-1
No files found.
src/main/java/com/syc/slm/slmbi/controller/InstrumentPanelConfigController.java
View file @
eff42b35
...
...
@@ -2,6 +2,7 @@ package com.syc.slm.slmbi.controller;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.slmbi.dto.InstrumentPanelConfigDTO
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.service.InstrumentPanelConfigService
;
import
com.syc.slm.slmbi.vo.InstrumentPanelConfigVo
;
import
io.swagger.annotations.Api
;
...
...
@@ -11,6 +12,8 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
/**
* slm-bi
* 仪表板样式以及数据配置
...
...
@@ -31,14 +34,14 @@ public class InstrumentPanelConfigController extends BaseRestController {
@ApiOperation
(
"保存仪表板样式以及数据配置"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
String
>
saveInstrumentPanelConfig
(
@PathVariable
String
appId
,
@RequestBody
InstrumentPanelConfigDTO
config
)
{
return
R
.
ok
(
instrumentPanelConfigService
.
saveConfig
(
appId
,
config
));
return
call
(()->
instrumentPanelConfigService
.
saveConfig
(
appId
,
config
));
}
@PostMapping
(
"/publish"
)
@ApiOperation
(
"保存发布仪表板样式以及数据配置"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
String
>
publish
(
@PathVariable
String
appId
,
@RequestBody
InstrumentPanelConfigDTO
config
)
{
return
R
.
ok
(
instrumentPanelConfigService
.
publish
(
appId
,
config
));
return
call
(()->
instrumentPanelConfigService
.
publish
(
appId
,
config
));
}
@GetMapping
(
"/{panelId}"
)
...
...
@@ -46,8 +49,13 @@ public class InstrumentPanelConfigController extends BaseRestController {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"panelId"
,
value
=
"仪表板id"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)})
public
R
<
InstrumentPanelConfigVo
>
getConfigByPanelId
(
@PathVariable
String
appId
,
@PathVariable
(
"panelId"
)
String
panelId
)
{
return
R
.
ok
(
instrumentPanelConfigService
.
getConfigByPanelId
(
panelId
));
@PathVariable
(
"panelId"
)
String
panelId
,
HttpServletRequest
request
)
{
return
call
(()->{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
InstrumentPanelConfigVo
config
=
instrumentPanelConfigService
.
getConfigByPanelId
(
panelId
);
config
.
setUser
(
currentUser
);
return
config
;
});
}
}
src/main/java/com/syc/slm/slmbi/vo/InstrumentPanelConfigVo.java
View file @
eff42b35
package
com
.
syc
.
slm
.
slmbi
.
vo
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.entity.InstrumentPanelConfig
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -7,7 +8,6 @@ import lombok.Data;
import
lombok.EqualsAndHashCode
;
import
java.util.List
;
import
java.util.Map
;
/**
* slm-bi
...
...
@@ -25,4 +25,7 @@ public class InstrumentPanelConfigVo extends InstrumentPanelConfig {
private
List
<
CustomPermissionVo
>
permissions
;
@ApiModelProperty
(
value
=
"仪表板信息"
,
required
=
true
)
private
InstrumentPanelVo
panel
;
@ApiModelProperty
(
value
=
"当前用户"
,
required
=
true
)
private
CurrentUser
user
;
}
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