Commit adb0e9ba authored by 梁彬's avatar 梁彬

refactor: 重构仪表板API与DTO

parent 0c4cf8b8
...@@ -3,7 +3,7 @@ package com.syc.slm.slmbi.controller; ...@@ -3,7 +3,7 @@ package com.syc.slm.slmbi.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.syc.slm.common.core.util.R; import com.syc.slm.common.core.util.R;
import com.syc.slm.slmbi.dto.SaveInstrumentPanelDTO; import com.syc.slm.slmbi.dto.SaveInstrumentPanelDTO;
import com.syc.slm.slmbi.dto.SearchInstrumentPanelDTO; import com.syc.slm.slmbi.dto.QueryInstrumentPanelDTO;
import com.syc.slm.slmbi.service.InstrumentPanelService; import com.syc.slm.slmbi.service.InstrumentPanelService;
import com.syc.slm.slmbi.vo.InstrumentPanelVo; import com.syc.slm.slmbi.vo.InstrumentPanelVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -23,7 +23,7 @@ import java.util.List; ...@@ -23,7 +23,7 @@ import java.util.List;
**/ **/
@RestController @RestController
@RequestMapping("/panels") @RequestMapping("/panels")
@Api(value = "仪表板", description = "仪表板配置接口") @Api(value = "仪表板配置接口", description = "仪表板配置接口")
public class InstrumentPanelController { public class InstrumentPanelController {
@Autowired @Autowired
...@@ -37,7 +37,7 @@ public class InstrumentPanelController { ...@@ -37,7 +37,7 @@ public class InstrumentPanelController {
*/ */
@GetMapping @GetMapping
@ApiOperation("仪表板列表") @ApiOperation("仪表板列表")
public R<IPage<InstrumentPanelVo>> selectInstrumentPanelList(@RequestBody SearchInstrumentPanelDTO where) { public R<IPage<InstrumentPanelVo>> selectInstrumentPanelList(@RequestBody QueryInstrumentPanelDTO where) {
return R.ok(instrumentPanelService.selectInstrumentPanelList(where)); return R.ok(instrumentPanelService.selectInstrumentPanelList(where));
} }
...@@ -47,7 +47,7 @@ public class InstrumentPanelController { ...@@ -47,7 +47,7 @@ public class InstrumentPanelController {
return R.ok(instrumentPanelService.savePanel(panel)); return R.ok(instrumentPanelService.savePanel(panel));
} }
@PutMapping("/batch-publish") @PutMapping("/publish")
@ApiOperation("批量发布") @ApiOperation("批量发布")
@ApiImplicitParam(name = "ids", value = "仪表板id集合", required = true) @ApiImplicitParam(name = "ids", value = "仪表板id集合", required = true)
public R<Boolean> batchPublish(@RequestBody List<String> ids) { public R<Boolean> batchPublish(@RequestBody List<String> ids) {
...@@ -71,6 +71,7 @@ public class InstrumentPanelController { ...@@ -71,6 +71,7 @@ public class InstrumentPanelController {
@PostMapping("/save-as") @PostMapping("/save-as")
@ApiOperation("另存为") @ApiOperation("另存为")
public R<String> saveAs(@RequestBody SaveInstrumentPanelDTO panelDTO) { public R<String> saveAs(@RequestBody SaveInstrumentPanelDTO panelDTO) {
// FIXME 另存为需要保存配置、权限信息吗?
return R.ok(instrumentPanelService.saveAsPanel(panelDTO)); return R.ok(instrumentPanelService.saveAsPanel(panelDTO));
} }
......
...@@ -22,6 +22,9 @@ public class InstrumentPanelConfigDTO { ...@@ -22,6 +22,9 @@ public class InstrumentPanelConfigDTO {
@ApiModelProperty(value = "仪表板名称", required = true) @ApiModelProperty(value = "仪表板名称", required = true)
private String panelName; private String panelName;
@ApiModelProperty(value = "仪表板分组id", required = true)
private String groupId;
@ApiModelProperty(value = "仪表板配置详情,包含了样式,数据配置", required = true) @ApiModelProperty(value = "仪表板配置详情,包含了样式,数据配置", required = true)
private String configDetails; private String configDetails;
......
...@@ -16,8 +16,8 @@ import java.util.Date; ...@@ -16,8 +16,8 @@ import java.util.Date;
**/ **/
@ApiModel(value = "查询仪表板列表DTO") @ApiModel(value = "查询仪表板列表DTO")
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = true)
public class SearchInstrumentPanelDTO { public class QueryInstrumentPanelDTO extends QueryPageDTO {
@ApiModelProperty(value = "仪表板名称") @ApiModelProperty(value = "仪表板名称")
private String name; private String name;
@ApiModelProperty(value = "仪表板归属分组") @ApiModelProperty(value = "仪表板归属分组")
...@@ -26,8 +26,10 @@ public class SearchInstrumentPanelDTO { ...@@ -26,8 +26,10 @@ public class SearchInstrumentPanelDTO {
private String creatorName; private String creatorName;
@ApiModelProperty(value = "修改人名称") @ApiModelProperty(value = "修改人名称")
private String updaterName; private String updaterName;
@ApiModelProperty(value = "修改时间") @ApiModelProperty(value = "修改时间开始")
private Date updateTime; private Date updateTimeBegin;
@ApiModelProperty(value = "状态") @ApiModelProperty(value = "修改时间结束")
private Integer recordStatus; private Date updateTimeEnd;
@ApiModelProperty(value = "发布状态")
private Boolean published;
} }
package com.syc.slm.slmbi.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author liangbin
* @date 2021/3/31
*/
@ApiModel("分布查询参数")
@Data
public class QueryPageDTO {
@ApiModelProperty("页码")
private Integer pageNum = 1;
@ApiModelProperty("每页大小")
private Integer pageSize = 10;
}
...@@ -3,7 +3,7 @@ package com.syc.slm.slmbi.service; ...@@ -3,7 +3,7 @@ package com.syc.slm.slmbi.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.syc.slm.slmbi.dto.SaveInstrumentPanelDTO; import com.syc.slm.slmbi.dto.SaveInstrumentPanelDTO;
import com.syc.slm.slmbi.dto.SearchInstrumentPanelDTO; import com.syc.slm.slmbi.dto.QueryInstrumentPanelDTO;
import com.syc.slm.slmbi.entity.InstrumentPanel; import com.syc.slm.slmbi.entity.InstrumentPanel;
import com.syc.slm.slmbi.vo.InstrumentPanelVo; import com.syc.slm.slmbi.vo.InstrumentPanelVo;
...@@ -23,7 +23,7 @@ public interface InstrumentPanelService extends IService<InstrumentPanel> { ...@@ -23,7 +23,7 @@ public interface InstrumentPanelService extends IService<InstrumentPanel> {
* @param where * @param where
* @return * @return
*/ */
IPage<InstrumentPanelVo> selectInstrumentPanelList(SearchInstrumentPanelDTO where); IPage<InstrumentPanelVo> selectInstrumentPanelList(QueryInstrumentPanelDTO where);
/** /**
* 保存仪表板 * 保存仪表板
......
...@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.syc.slm.slmbi.dao.InstrumentPanelMapper; import com.syc.slm.slmbi.dao.InstrumentPanelMapper;
import com.syc.slm.slmbi.dto.SaveInstrumentPanelDTO; import com.syc.slm.slmbi.dto.SaveInstrumentPanelDTO;
import com.syc.slm.slmbi.dto.SearchInstrumentPanelDTO; import com.syc.slm.slmbi.dto.QueryInstrumentPanelDTO;
import com.syc.slm.slmbi.entity.InstrumentPanel; import com.syc.slm.slmbi.entity.InstrumentPanel;
import com.syc.slm.slmbi.service.InstrumentPanelService; import com.syc.slm.slmbi.service.InstrumentPanelService;
import com.syc.slm.slmbi.vo.InstrumentPanelVo; import com.syc.slm.slmbi.vo.InstrumentPanelVo;
...@@ -23,7 +23,7 @@ import java.util.List; ...@@ -23,7 +23,7 @@ import java.util.List;
public class InstrumentPanelServiceImpl extends ServiceImpl<InstrumentPanelMapper, InstrumentPanel> public class InstrumentPanelServiceImpl extends ServiceImpl<InstrumentPanelMapper, InstrumentPanel>
implements InstrumentPanelService { implements InstrumentPanelService {
@Override @Override
public IPage<InstrumentPanelVo> selectInstrumentPanelList(SearchInstrumentPanelDTO where) { public IPage<InstrumentPanelVo> selectInstrumentPanelList(QueryInstrumentPanelDTO where) {
return null; return null;
} }
......
...@@ -27,9 +27,9 @@ spring: ...@@ -27,9 +27,9 @@ spring:
pool-name: HikariCP pool-name: HikariCP
max-lifetime: 1800000 max-lifetime: 1800000
connection-timeout: 30000 connection-timeout: 30000
username: root username: syc_dev
password: root password: Test123!
url: jdbc:mysql://${MYSQL_HOST:slm-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:slmx}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true url: jdbc:mysql://${MYSQL_HOST:dev.sycdev.com}:${MYSQL_PORT:3306}/${MYSQL_DB:sycloud_mall}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
messages: messages:
basename: i18n/messages,i18n/sys basename: i18n/messages,i18n/sys
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment