Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
1a341726
提交
1a341726
authored
10月 11, 2021
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 完善API接口文档
上级
7faa88f2
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
88 行增加
和
35 行删除
+88
-35
Datasource.java
...end/src/main/java/io/dataease/base/domain/Datasource.java
+11
-8
ChartViewController.java
...ava/io/dataease/controller/chart/ChartViewController.java
+2
-1
DataSetTableController.java
...o/dataease/controller/dataset/DataSetTableController.java
+8
-6
DataSetTableFieldController.java
...aease/controller/dataset/DataSetTableFieldController.java
+6
-5
ChartDetail.java
...ain/java/io/dataease/controller/response/ChartDetail.java
+13
-0
DataSetDetail.java
...n/java/io/dataease/controller/response/DataSetDetail.java
+14
-0
DatasetTableField4Type.java
.../dataease/controller/response/DatasetTableField4Type.java
+15
-0
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+9
-6
DataSetTableService.java
...java/io/dataease/service/dataset/DataSetTableService.java
+10
-9
没有找到文件。
backend/src/main/java/io/dataease/base/domain/Datasource.java
浏览文件 @
1a341726
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
Datasource
implements
Serializable
{
@ApiModelProperty
(
"ID"
)
private
String
id
;
@ApiModelProperty
(
"名称"
)
private
String
name
;
@ApiModelProperty
(
"描述"
)
private
String
desc
;
@ApiModelProperty
(
"类型"
)
private
String
type
;
@ApiModelProperty
(
"创建时间"
)
private
Long
createTime
;
@ApiModelProperty
(
"更新时间"
)
private
Long
updateTime
;
@ApiModelProperty
(
"创建者"
)
private
String
createBy
;
@ApiModelProperty
(
"状态"
)
private
String
status
;
@ApiModelProperty
(
"配置详情"
)
private
String
configuration
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
backend/src/main/java/io/dataease/controller/chart/ChartViewController.java
浏览文件 @
1a341726
...
...
@@ -5,6 +5,7 @@ import io.dataease.base.domain.ChartViewWithBLOBs;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.controller.request.chart.ChartExtRequest
;
import
io.dataease.controller.request.chart.ChartViewRequest
;
import
io.dataease.controller.response.ChartDetail
;
import
io.dataease.dto.chart.ChartViewDTO
;
import
io.dataease.service.chart.ChartViewService
;
import
io.swagger.annotations.Api
;
...
...
@@ -66,7 +67,7 @@ public class ChartViewController {
@ApiOperation
(
"视图详情"
)
@PostMapping
(
"chartDetail/{id}"
)
public
Map
<
String
,
Object
>
chartDetail
(
@PathVariable
String
id
)
{
public
ChartDetail
chartDetail
(
@PathVariable
String
id
)
{
return
chartViewService
.
getChartDetail
(
id
);
}
...
...
backend/src/main/java/io/dataease/controller/dataset/DataSetTableController.java
浏览文件 @
1a341726
...
...
@@ -5,12 +5,14 @@ import io.dataease.base.domain.DatasetTable;
import
io.dataease.base.domain.DatasetTableField
;
import
io.dataease.base.domain.DatasetTableIncrementalConfig
;
import
io.dataease.controller.request.dataset.DataSetTableRequest
;
import
io.dataease.controller.response.DataSetDetail
;
import
io.dataease.datasource.dto.TableFiled
;
import
io.dataease.dto.dataset.DataSetTableDTO
;
import
io.dataease.dto.dataset.ExcelFileData
;
import
io.dataease.service.dataset.DataSetTableService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -54,7 +56,7 @@ public class DataSetTableController {
@ApiOperation
(
"删除"
)
@PostMapping
(
"delete/{id}"
)
public
void
delete
(
@PathVariable
String
id
)
throws
Exception
{
public
void
delete
(
@ApiParam
(
name
=
"id"
,
value
=
"数据集ID"
,
required
=
true
)
@PathVariable
String
id
)
throws
Exception
{
dataSetTableService
.
delete
(
id
);
}
...
...
@@ -72,7 +74,7 @@ public class DataSetTableController {
@ApiOperation
(
"详息"
)
@PostMapping
(
"get/{id}"
)
public
DatasetTable
get
(
@PathVariable
String
id
)
{
public
DatasetTable
get
(
@
ApiParam
(
name
=
"id"
,
value
=
"数据集ID"
,
required
=
true
)
@
PathVariable
String
id
)
{
return
dataSetTableService
.
get
(
id
);
}
...
...
@@ -84,8 +86,8 @@ public class DataSetTableController {
@ApiOperation
(
"查询原始字段"
)
@PostMapping
(
"getFields"
)
public
List
<
TableFiled
>
getFields
(
@RequestBody
Data
SetTableRequest
dataSetTableRequest
)
throws
Exception
{
return
dataSetTableService
.
getFields
(
data
SetTableRequest
);
public
List
<
TableFiled
>
getFields
(
@RequestBody
Data
setTable
datasetTable
)
throws
Exception
{
return
dataSetTableService
.
getFields
(
data
setTable
);
}
@ApiOperation
(
"查询生成字段"
)
...
...
@@ -126,11 +128,11 @@ public class DataSetTableController {
@ApiOperation
(
"数据集详息"
)
@PostMapping
(
"datasetDetail/{id}"
)
public
Map
<
String
,
Object
>
datasetDetail
(
@PathVariable
String
id
)
{
public
DataSetDetail
datasetDetail
(
@PathVariable
String
id
)
{
return
dataSetTableService
.
getDatasetDetail
(
id
);
}
@ApiOperation
(
"excel上传"
)
//
@ApiOperation("excel上传")
@PostMapping
(
"excel/upload"
)
public
ExcelFileData
excelUpload
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"tableId"
)
String
tableId
,
@RequestParam
(
"editType"
)
Integer
editType
)
throws
Exception
{
return
dataSetTableService
.
excelSaveAndParse
(
file
,
tableId
,
editType
);
...
...
backend/src/main/java/io/dataease/controller/dataset/DataSetTableFieldController.java
浏览文件 @
1a341726
...
...
@@ -2,6 +2,7 @@ package io.dataease.controller.dataset;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
io.dataease.base.domain.DatasetTableField
;
import
io.dataease.controller.response.DatasetTableField4Type
;
import
io.dataease.service.dataset.DataSetFieldService
;
import
io.dataease.service.dataset.DataSetTableFieldsService
;
import
io.swagger.annotations.Api
;
...
...
@@ -39,7 +40,7 @@ public class DataSetTableFieldController {
@ApiOperation
(
"分组查询表下属字段"
)
@PostMapping
(
"listByDQ/{tableId}"
)
public
Map
<
String
,
List
<
DatasetTableField
>>
listByDQ
(
@PathVariable
String
tableId
)
{
public
DatasetTableField4Type
listByDQ
(
@PathVariable
String
tableId
)
{
DatasetTableField
datasetTableField
=
DatasetTableField
.
builder
().
build
();
datasetTableField
.
setTableId
(
tableId
);
datasetTableField
.
setGroupType
(
"d"
);
...
...
@@ -47,10 +48,10 @@ public class DataSetTableFieldController {
datasetTableField
.
setGroupType
(
"q"
);
List
<
DatasetTableField
>
quotaList
=
dataSetTableFieldsService
.
list
(
datasetTableField
);
Map
<
String
,
List
<
DatasetTableField
>>
map
=
new
HashMap
<>
();
map
.
put
(
"dimensionList"
,
dimensionList
);
map
.
put
(
"quotaList"
,
quotaList
);
return
map
;
DatasetTableField4Type
datasetTableField4Type
=
new
DatasetTableField4Type
();
datasetTableField4Type
.
setDimensionList
(
dimensionList
);
datasetTableField4Type
.
setQuotaList
(
quotaList
);
return
datasetTableField4Type
;
}
@ApiOperation
(
"批量更新"
)
...
...
backend/src/main/java/io/dataease/controller/response/ChartDetail.java
0 → 100644
浏览文件 @
1a341726
package
io
.
dataease
.
controller
.
response
;
import
io.dataease.base.domain.ChartViewWithBLOBs
;
import
io.dataease.base.domain.DatasetTable
;
import
io.dataease.base.domain.Datasource
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
ChartDetail
extends
DataSetDetail
{
@ApiModelProperty
(
"视图"
)
private
ChartViewWithBLOBs
chart
;
}
backend/src/main/java/io/dataease/controller/response/DataSetDetail.java
0 → 100644
浏览文件 @
1a341726
package
io
.
dataease
.
controller
.
response
;
import
io.dataease.base.domain.DatasetTable
;
import
io.dataease.base.domain.Datasource
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
DataSetDetail
{
@ApiModelProperty
(
"数据集"
)
private
DatasetTable
table
;
@ApiModelProperty
(
"数据源"
)
private
Datasource
datasource
;
}
backend/src/main/java/io/dataease/controller/response/DatasetTableField4Type.java
0 → 100644
浏览文件 @
1a341726
package
io
.
dataease
.
controller
.
response
;
import
io.dataease.base.domain.DatasetTableField
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
DatasetTableField4Type
{
@ApiModelProperty
(
"维度"
)
List
<
DatasetTableField
>
dimensionList
;
@ApiModelProperty
(
"指标"
)
List
<
DatasetTableField
>
quotaList
;
}
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
1a341726
...
...
@@ -12,6 +12,8 @@ import io.dataease.commons.utils.BeanUtils;
import
io.dataease.commons.utils.CommonBeanFactory
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.controller.request.chart.*
;
import
io.dataease.controller.response.ChartDetail
;
import
io.dataease.controller.response.DataSetDetail
;
import
io.dataease.datasource.provider.DatasourceProvider
;
import
io.dataease.datasource.provider.ProviderFactory
;
import
io.dataease.datasource.request.DatasourceRequest
;
...
...
@@ -1055,15 +1057,16 @@ public class ChartViewService {
}
}
public
Map
<
String
,
Object
>
getChartDetail
(
String
id
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>
();
public
ChartDetail
getChartDetail
(
String
id
)
{
ChartDetail
chartDetail
=
new
ChartDetail
();
ChartViewWithBLOBs
chartViewWithBLOBs
=
chartViewMapper
.
selectByPrimaryKey
(
id
);
map
.
put
(
"chart"
,
chartViewWithBLOBs
);
chartDetail
.
setChart
(
chartViewWithBLOBs
);
if
(
ObjectUtils
.
isNotEmpty
(
chartViewWithBLOBs
))
{
Map
<
String
,
Object
>
datasetDetail
=
dataSetTableService
.
getDatasetDetail
(
chartViewWithBLOBs
.
getTableId
());
map
.
putAll
(
datasetDetail
);
DataSetDetail
datasetDetail
=
dataSetTableService
.
getDatasetDetail
(
chartViewWithBLOBs
.
getTableId
());
chartDetail
.
setTable
(
datasetDetail
.
getTable
());
chartDetail
.
setDatasource
(
datasetDetail
.
getDatasource
());
}
return
map
;
return
chartDetail
;
}
public
List
<
ChartView
>
viewsByIds
(
List
<
String
>
viewIds
)
{
...
...
backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java
浏览文件 @
1a341726
...
...
@@ -15,6 +15,7 @@ import io.dataease.commons.utils.*;
import
io.dataease.controller.request.dataset.DataSetGroupRequest
;
import
io.dataease.controller.request.dataset.DataSetTableRequest
;
import
io.dataease.controller.request.dataset.DataSetTaskRequest
;
import
io.dataease.controller.response.DataSetDetail
;
import
io.dataease.datasource.constants.DatasourceTypes
;
import
io.dataease.datasource.dto.TableFiled
;
import
io.dataease.datasource.provider.DatasourceProvider
;
...
...
@@ -382,13 +383,13 @@ public class DataSetTableService {
return
extDataSetTableMapper
.
searchOne
(
dataSetTableRequest
);
}
public
List
<
TableFiled
>
getFields
(
Data
SetTableRequest
dataSetTableRequest
)
throws
Exception
{
Datasource
ds
=
datasourceMapper
.
selectByPrimaryKey
(
data
SetTableRequest
.
getDataSourceId
());
public
List
<
TableFiled
>
getFields
(
Data
setTable
datasetTable
)
throws
Exception
{
Datasource
ds
=
datasourceMapper
.
selectByPrimaryKey
(
data
setTable
.
getDataSourceId
());
DatasourceProvider
datasourceProvider
=
ProviderFactory
.
getProvider
(
ds
.
getType
());
DatasourceRequest
datasourceRequest
=
new
DatasourceRequest
();
datasourceRequest
.
setDatasource
(
ds
);
QueryProvider
qp
=
ProviderFactory
.
getQueryProvider
(
ds
.
getType
());
datasourceRequest
.
setQuery
(
qp
.
convertTableToSql
(
new
Gson
().
fromJson
(
data
SetTableRequest
.
getInfo
(),
DataTableInfoDTO
.
class
).
getTable
(),
ds
));
datasourceRequest
.
setQuery
(
qp
.
convertTableToSql
(
new
Gson
().
fromJson
(
data
setTable
.
getInfo
(),
DataTableInfoDTO
.
class
).
getTable
(),
ds
));
return
datasourceProvider
.
fetchResultField
(
datasourceRequest
);
}
...
...
@@ -966,7 +967,7 @@ public class DataSetTableService {
List
<
TableFiled
>
fields
=
new
ArrayList
<>();
long
syncTime
=
System
.
currentTimeMillis
();
if
(
StringUtils
.
equalsIgnoreCase
(
datasetTable
.
getType
(),
"db"
))
{
fields
=
getFields
(
data
SetTableRequest
);
fields
=
getFields
(
data
setTable
);
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
datasetTable
.
getType
(),
"sql"
))
{
DatasourceProvider
datasourceProvider
=
ProviderFactory
.
getProvider
(
ds
.
getType
());
DatasourceRequest
datasourceRequest
=
new
DatasourceRequest
();
...
...
@@ -1198,15 +1199,15 @@ public class DataSetTableService {
}
}
public
Map
<
String
,
Object
>
getDatasetDetail
(
String
id
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>
();
public
DataSetDetail
getDatasetDetail
(
String
id
)
{
DataSetDetail
dataSetDetail
=
new
DataSetDetail
();
DatasetTable
table
=
datasetTableMapper
.
selectByPrimaryKey
(
id
);
map
.
put
(
"table"
,
table
);
dataSetDetail
.
setTable
(
table
);
if
(
ObjectUtils
.
isNotEmpty
(
table
))
{
Datasource
datasource
=
datasourceMapper
.
selectByPrimaryKey
(
table
.
getDataSourceId
());
map
.
put
(
"datasource"
,
datasource
);
dataSetDetail
.
setDatasource
(
datasource
);
}
return
map
;
return
dataSetDetail
;
}
public
ExcelFileData
excelSaveAndParse
(
MultipartFile
file
,
String
tableId
,
Integer
editType
)
throws
Exception
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论