Commit adb0e9ba authored by 梁彬's avatar 梁彬

refactor: 重构仪表板API与DTO

parent 0c4cf8b8
......@@ -3,7 +3,7 @@ package com.syc.slm.slmbi.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.syc.slm.common.core.util.R;
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.vo.InstrumentPanelVo;
import io.swagger.annotations.Api;
......@@ -23,7 +23,7 @@ import java.util.List;
**/
@RestController
@RequestMapping("/panels")
@Api(value = "仪表板", description = "仪表板配置接口")
@Api(value = "仪表板配置接口", description = "仪表板配置接口")
public class InstrumentPanelController {
@Autowired
......@@ -37,7 +37,7 @@ public class InstrumentPanelController {
*/
@GetMapping
@ApiOperation("仪表板列表")
public R<IPage<InstrumentPanelVo>> selectInstrumentPanelList(@RequestBody SearchInstrumentPanelDTO where) {
public R<IPage<InstrumentPanelVo>> selectInstrumentPanelList(@RequestBody QueryInstrumentPanelDTO where) {
return R.ok(instrumentPanelService.selectInstrumentPanelList(where));
}
......@@ -47,7 +47,7 @@ public class InstrumentPanelController {
return R.ok(instrumentPanelService.savePanel(panel));
}
@PutMapping("/batch-publish")
@PutMapping("/publish")
@ApiOperation("批量发布")
@ApiImplicitParam(name = "ids", value = "仪表板id集合", required = true)
public R<Boolean> batchPublish(@RequestBody List<String> ids) {
......@@ -71,6 +71,7 @@ public class InstrumentPanelController {
@PostMapping("/save-as")
@ApiOperation("另存为")
public R<String> saveAs(@RequestBody SaveInstrumentPanelDTO panelDTO) {
// FIXME 另存为需要保存配置、权限信息吗?
return R.ok(instrumentPanelService.saveAsPanel(panelDTO));
}
......
......@@ -22,6 +22,9 @@ public class InstrumentPanelConfigDTO {
@ApiModelProperty(value = "仪表板名称", required = true)
private String panelName;
@ApiModelProperty(value = "仪表板分组id", required = true)
private String groupId;
@ApiModelProperty(value = "仪表板配置详情,包含了样式,数据配置", required = true)
private String configDetails;
......
......@@ -16,8 +16,8 @@ import java.util.Date;
**/
@ApiModel(value = "查询仪表板列表DTO")
@Data
@EqualsAndHashCode(callSuper = false)
public class SearchInstrumentPanelDTO {
@EqualsAndHashCode(callSuper = true)
public class QueryInstrumentPanelDTO extends QueryPageDTO {
@ApiModelProperty(value = "仪表板名称")
private String name;
@ApiModelProperty(value = "仪表板归属分组")
......@@ -26,8 +26,10 @@ public class SearchInstrumentPanelDTO {
private String creatorName;
@ApiModelProperty(value = "修改人名称")
private String updaterName;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "状态")
private Integer recordStatus;
@ApiModelProperty(value = "修改时间开始")
private Date updateTimeBegin;
@ApiModelProperty(value = "修改时间结束")
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;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
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.vo.InstrumentPanelVo;
......@@ -23,7 +23,7 @@ public interface InstrumentPanelService extends IService<InstrumentPanel> {
* @param where
* @return
*/
IPage<InstrumentPanelVo> selectInstrumentPanelList(SearchInstrumentPanelDTO where);
IPage<InstrumentPanelVo> selectInstrumentPanelList(QueryInstrumentPanelDTO where);
/**
* 保存仪表板
......
......@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.syc.slm.slmbi.dao.InstrumentPanelMapper;
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.service.InstrumentPanelService;
import com.syc.slm.slmbi.vo.InstrumentPanelVo;
......@@ -23,7 +23,7 @@ import java.util.List;
public class InstrumentPanelServiceImpl extends ServiceImpl<InstrumentPanelMapper, InstrumentPanel>
implements InstrumentPanelService {
@Override
public IPage<InstrumentPanelVo> selectInstrumentPanelList(SearchInstrumentPanelDTO where) {
public IPage<InstrumentPanelVo> selectInstrumentPanelList(QueryInstrumentPanelDTO where) {
return null;
}
......
......@@ -27,9 +27,9 @@ spring:
pool-name: HikariCP
max-lifetime: 1800000
connection-timeout: 30000
username: root
password: root
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
username: syc_dev
password: Test123!
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:
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