Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
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
fulixin
dsk-operate-sys-cscec
Commits
dbe4940a
Commit
dbe4940a
authored
Nov 16, 2023
by
tanyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
集成goview 大屏设计系统
parent
ba733961
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1083 additions
and
0 deletions
+1083
-0
BaseController.java
...n/java/com/dsk/biz/goview/common/base/BaseController.java
+111
-0
BaseService.java
...main/java/com/dsk/biz/goview/common/base/BaseService.java
+36
-0
AjaxResult.java
.../main/java/com/dsk/biz/goview/common/bean/AjaxResult.java
+104
-0
GoviewProject.java
.../java/com/dsk/biz/goview/common/domain/GoviewProject.java
+44
-0
GoviewProjectData.java
...a/com/dsk/biz/goview/common/domain/GoviewProjectData.java
+34
-0
MagicHttp.java
...main/java/com/dsk/biz/goview/common/domain/MagicHttp.java
+83
-0
ResultTable.java
...in/java/com/dsk/biz/goview/common/domain/ResultTable.java
+88
-0
Tablepar.java
.../main/java/com/dsk/biz/goview/common/domain/Tablepar.java
+61
-0
DataVTenantHandler.java
...in/java/com/dsk/biz/goview/config/DataVTenantHandler.java
+53
-0
GoviewProperties.java
...main/java/com/dsk/biz/goview/config/GoviewProperties.java
+44
-0
MybatisAutoConfiguration.java
...a/com/dsk/biz/goview/config/MybatisAutoConfiguration.java
+56
-0
YamlPropertySourceFactory.java
.../com/dsk/biz/goview/config/YamlPropertySourceFactory.java
+42
-0
GoViewProjectAPIController.java
...dsk/biz/goview/controller/GoViewProjectAPIController.java
+202
-0
GoviewPageController.java
...a/com/dsk/biz/goview/controller/GoviewPageController.java
+39
-0
GoviewProjectDataMapper.java
...va/com/dsk/biz/goview/mapper/GoviewProjectDataMapper.java
+14
-0
GoviewProjectMapper.java
...n/java/com/dsk/biz/goview/mapper/GoviewProjectMapper.java
+14
-0
index.html
...module/dsk-biz-bi/src/main/resources/templates/index.html
+58
-0
No files found.
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/common/base/BaseController.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
common
.
base
;
import
cn.hutool.core.util.StrUtil
;
import
com.dsk.biz.goview.common.bean.AjaxResult
;
import
com.dsk.biz.goview.common.domain.ResultTable
;
import
org.springframework.beans.propertyeditors.CustomDateEditor
;
import
org.springframework.web.bind.WebDataBinder
;
import
org.springframework.web.bind.annotation.InitBinder
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
/**
* web层通用数据处理
*
* @author fuce
* @ClassName: BaseController
* @date 2018年8月18日
*/
public
class
BaseController
{
/**
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
*/
@InitBinder
public
void
initBinder
(
WebDataBinder
binder
)
{
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
dateFormat
.
setLenient
(
false
);
binder
.
registerCustomEditor
(
Date
.
class
,
new
CustomDateEditor
(
dateFormat
,
true
));
}
/**
* 响应返回结果
* @param rows 影响行数
* @return 操作结果
*/
protected
AjaxResult
toAjax
(
int
rows
)
{
return
rows
>
0
?
success
()
:
error
();
}
/**
* 返回成功
*/
public
AjaxResult
success
()
{
return
AjaxResult
.
success
();
}
/**
* 返回失败消息
*/
public
AjaxResult
error
()
{
return
AjaxResult
.
error
();
}
/**
* 返回成功消息
*/
public
AjaxResult
success
(
String
message
)
{
return
AjaxResult
.
success
(
message
);
}
/**
* 返回失败消息
*/
public
AjaxResult
error
(
String
message
)
{
return
AjaxResult
.
error
(
message
);
}
/**
* 返回错误码消息
*/
public
AjaxResult
error
(
int
code
,
String
message
)
{
return
AjaxResult
.
error
(
code
,
message
);
}
/**
* 返回object数据
*/
public
AjaxResult
retobject
(
int
code
,
Object
data
)
{
return
AjaxResult
.
successData
(
code
,
data
);
}
/**
* 页面跳转
*/
public
String
redirect
(
String
url
)
{
return
StrUtil
.
format
(
"redirect:{}"
,
url
);
}
/**
* Describe: 返回数据表格数据 分页 Param data Return 表格分页数据
*/
protected
static
ResultTable
pageTable
(
Object
data
,
long
count
)
{
return
ResultTable
.
pageTable
(
count
,
data
);
}
/**
* Describe: 返回数据表格数据 Param data Return 表格分页数据
*/
protected
static
ResultTable
dataTable
(
Object
data
)
{
return
ResultTable
.
dataTable
(
data
);
}
/**
* Describe: 返回树状表格数据 分页 Param data Return 表格分页数据
*/
protected
static
ResultTable
treeTable
(
Object
data
)
{
return
ResultTable
.
dataTable
(
data
);
}
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/common/base/BaseService.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
common
.
base
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 抽象类BaseService
*
* @ClassName: BaseService
* @Description: Service实现这个
* @author fuce
* @date 2018年6月3日
*
*/
public
interface
BaseService
<
T
,
T2
>
{
int
deleteByPrimaryKey
(
String
id
);
int
insertSelective
(
T
record
);
T
selectByPrimaryKey
(
String
id
);
int
updateByPrimaryKeySelective
(
T
record
);
int
updateByExampleSelective
(
@Param
(
"record"
)
T
record
,
@Param
(
"example"
)
T2
example
);
int
updateByExample
(
@Param
(
"record"
)
T
record
,
@Param
(
"example"
)
T2
example
);
List
<
T
>
selectByExample
(
T2
example
);
long
countByExample
(
T2
example
);
int
deleteByExample
(
T2
example
);
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/common/bean/AjaxResult.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
common
.
bean
;
import
java.util.HashMap
;
/**
* @ClassName: AjaxResult
* @Description: ajax操作消息提醒
* @author fuce
* @date 2018年8月18日
*
*/
public
class
AjaxResult
extends
HashMap
<
String
,
Object
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 初始化一个新创建的 Message 对象
*/
public
AjaxResult
()
{
}
/**
* 返回错误消息
* @return 错误消息
*/
public
static
AjaxResult
error
()
{
return
error
(
500
,
"操作失败"
);
}
/**
* 返回错误消息
* @param msg 内容
* @return 错误消息
*/
public
static
AjaxResult
error
(
String
msg
)
{
return
error
(
500
,
msg
);
}
/**
* 返回错误消息
* @param code 错误码
* @param msg 内容
* @return 错误消息
*/
public
static
AjaxResult
error
(
int
code
,
String
msg
)
{
AjaxResult
json
=
new
AjaxResult
();
json
.
put
(
"code"
,
code
);
json
.
put
(
"msg"
,
msg
);
return
json
;
}
/**
* 返回成功消息
* @param msg 内容
* @return 成功消息
*/
public
static
AjaxResult
success
(
String
msg
)
{
AjaxResult
json
=
new
AjaxResult
();
json
.
put
(
"msg"
,
msg
);
json
.
put
(
"code"
,
200
);
return
json
;
}
/**
* 返回成功消息
* @param msg 内容
* @return 成功消息
*/
public
static
AjaxResult
successNullData
(
String
msg
)
{
AjaxResult
json
=
new
AjaxResult
();
json
.
put
(
"msg"
,
msg
);
json
.
put
(
"data"
,
null
);
json
.
put
(
"code"
,
200
);
return
json
;
}
/**
* 返回成功消息
* @return 成功消息
*/
public
static
AjaxResult
success
()
{
return
AjaxResult
.
success
(
"操作成功"
);
}
public
static
AjaxResult
successData
(
int
code
,
Object
value
)
{
AjaxResult
json
=
new
AjaxResult
();
json
.
put
(
"code"
,
code
);
json
.
put
(
"data"
,
value
);
return
json
;
}
/**
* 返回成功消息
* @param key 键值
* @param value 内容
* @return 成功消息
*/
@Override
public
AjaxResult
put
(
String
key
,
Object
value
)
{
super
.
put
(
key
,
value
);
return
this
;
}
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/common/domain/GoviewProject.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
common
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Transient
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
@Data
@Entity
public
class
GoviewProject
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@TableId
(
type
=
IdType
.
ASSIGN_UUID
)
private
String
id
;
private
String
projectName
;
private
Integer
state
;
private
LocalDateTime
createTime
;
private
String
createUserId
;
private
Integer
isDelete
;
private
String
indexImage
;
private
String
remarks
;
private
Long
tenantId
;
@Transient
@TableField
(
exist
=
false
)
private
String
content
;
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/common/domain/GoviewProjectData.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
common
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
@Data
@Entity
public
class
GoviewProjectData
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@TableId
(
type
=
IdType
.
ASSIGN_UUID
)
private
String
id
;
private
String
projectId
;
private
LocalDateTime
createTime
;
private
String
createUserId
;
private
Long
tenantId
;
@Lob
@Basic
(
fetch
=
FetchType
.
LAZY
)
@Column
(
columnDefinition
=
"TEXT"
)
private
String
content
;
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/common/domain/MagicHttp.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
common
.
domain
;
import
java.util.Map
;
public
class
MagicHttp
{
/**
* 请求url
*/
private
String
url
;
/**
* 请求类型 get post
*/
private
String
requestType
;
private
Map
<
String
,
String
>
head
;
private
String
body
;
private
Integer
timeout
;
private
Map
<
String
,
Object
>
form
;
private
String
cookie
;
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getRequestType
()
{
return
requestType
;
}
public
void
setRequestType
(
String
requestType
)
{
this
.
requestType
=
requestType
;
}
public
Map
<
String
,
String
>
getHead
()
{
return
head
;
}
public
void
setHead
(
Map
<
String
,
String
>
head
)
{
this
.
head
=
head
;
}
public
String
getBody
()
{
return
body
;
}
public
void
setBody
(
String
body
)
{
this
.
body
=
body
;
}
public
String
getCookie
()
{
return
cookie
;
}
public
void
setCookie
(
String
cookie
)
{
this
.
cookie
=
cookie
;
}
public
Integer
getTimeout
()
{
return
timeout
;
}
public
void
setTimeout
(
Integer
timeout
)
{
this
.
timeout
=
timeout
;
}
public
Map
<
String
,
Object
>
getForm
()
{
return
form
;
}
public
void
setForm
(
Map
<
String
,
Object
>
form
)
{
this
.
form
=
form
;
}
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/common/domain/ResultTable.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
common
.
domain
;
public
class
ResultTable
{
/**
* 状态码
*/
private
Integer
code
;
/**
* 提示消息
*/
private
String
msg
;
/**
* 消息总量
*/
private
Long
count
;
/**
* 数据对象
*/
private
Object
data
;
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
Long
getCount
()
{
return
count
;
}
public
void
setCount
(
Long
count
)
{
this
.
count
=
count
;
}
public
Object
getData
()
{
return
data
;
}
public
void
setData
(
Object
data
)
{
this
.
data
=
data
;
}
/**
* 构 建
*/
public
static
ResultTable
pageTable
(
long
count
,
Object
data
)
{
ResultTable
resultTable
=
new
ResultTable
();
resultTable
.
setData
(
data
);
resultTable
.
setCode
(
0
);
resultTable
.
setCount
(
count
);
if
(
data
!=
null
)
{
resultTable
.
setMsg
(
"获取成功"
);
}
else
{
resultTable
.
setMsg
(
"获取失败"
);
}
return
resultTable
;
}
public
static
ResultTable
dataTable
(
Object
data
)
{
ResultTable
resultTable
=
new
ResultTable
();
resultTable
.
setData
(
data
);
resultTable
.
setCode
(
0
);
if
(
data
!=
null
)
{
resultTable
.
setMsg
(
"获取成功"
);
}
else
{
resultTable
.
setMsg
(
"获取失败"
);
}
return
resultTable
;
}
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/common/domain/Tablepar.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
common
.
domain
;
/**
* boostrap table post 参数
*
* @author fc
*
*/
public
class
Tablepar
{
private
int
page
;
// 页码
private
int
limit
;
// 数量
private
String
orderByColumn
;
// 排序字段
private
String
isAsc
;
// 排序字符 asc desc
private
String
searchText
;
// 列表table里面的搜索
public
int
getPage
()
{
return
page
;
}
public
void
setPage
(
int
page
)
{
this
.
page
=
page
;
}
public
int
getLimit
()
{
return
limit
;
}
public
void
setLimit
(
int
limit
)
{
this
.
limit
=
limit
;
}
public
String
getOrderByColumn
()
{
return
orderByColumn
;
}
public
void
setOrderByColumn
(
String
orderByColumn
)
{
this
.
orderByColumn
=
orderByColumn
;
}
public
String
getIsAsc
()
{
return
isAsc
;
}
public
void
setIsAsc
(
String
isAsc
)
{
this
.
isAsc
=
isAsc
;
}
public
String
getSearchText
()
{
return
searchText
;
}
public
void
setSearchText
(
String
searchText
)
{
this
.
searchText
=
searchText
;
}
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/config/DataVTenantHandler.java
0 → 100644
View file @
dbe4940a
///*
// * Copyright (c) 2018-2025, lengleng All rights reserved.
// *
// * Redistribution and use in source and binary forms, with or without
// * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice,
// * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// * notice, this list of conditions and the following disclaimer in the
// * documentation and/or other materials provided with the distribution.
// * Neither the name of the pig4cloud.com developer nor the names of its
// * contributors may be used to endorse or promote products derived from
// * this software without specific prior written permission.
// * Author: lengleng (wangiegie@gmail.com)
// */
//
//package com.dsk.biz.goview.config;
//
//import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import net.sf.jsqlparser.expression.Expression;
//import net.sf.jsqlparser.expression.LongValue;
//import net.sf.jsqlparser.expression.NullValue;
//
///**
// * @author lengleng
// * @date 2018-12-26
// * <p>
// * 租户维护处理器
// */
//@Slf4j
//@RequiredArgsConstructor
//public class DataVTenantHandler implements TenantLineHandler {
//
// /**
// * 获取租户 ID 值表达式,只支持单个 ID 值
// * <p>
// * @return 租户 ID 值表达式
// */
// @Override
// public Expression getTenantId() {
// Long tenantId = TenantContextHolder.getTenantId();
// log.debug("当前租户为 >> {}", tenantId);
//
// if (tenantId == null) {
// return new NullValue();
// }
// return new LongValue(tenantId);
// }
//
//}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/config/GoviewProperties.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
config
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
/**
* @author lengleng
* @date 2022/5/2
* <p>
* 数据大屏配置
*/
@Data
//@ConfigurationProperties("gv")
@Component
@ConfigurationProperties
(
prefix
=
"gv"
)
public
class
GoviewProperties
{
/**
* 服务 http://IP:port
*/
private
String
host
=
""
;
/**
* 路由前缀
*/
private
String
gatewayPrefix
=
"/api/gv"
;
/**
* 图片存放路径
*/
private
String
imgPath
;
/**
* 项目 license
*/
private
String
license
;
/**
* 是否开启检查更新
*/
private
boolean
checkUpdate
=
true
;
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/config/MybatisAutoConfiguration.java
0 → 100644
View file @
dbe4940a
///*
// * Copyright (c) 2020 pig4cloud Authors. All Rights Reserved.
// *
// * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// * http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// */
//
//package com.dsk.biz.goview.config;
//
//import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
//import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
//import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
//import org.springframework.boot.autoconfigure.domain.EntityScan;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author lengleng
// * @date 2020-03-14
// * <p>
// * mybatis plus 统一配置
// */
//@Configuration(proxyBeanMethods = false)
//@MapperScan(basePackages = "io.springboot.plugin.goview.mapper")
//@EntityScan(basePackages = "io.springboot.plugin.goview.common.domain")
//public class MybatisAutoConfiguration {
//
// @Bean
// public TenantContextHolderFilter tenantContextHolderFilter() {
// return new TenantContextHolderFilter();
// }
//
// /**
// * 分页插件, 对于单一数据库类型来说,都建议配置该值,避免每次分页都去抓取数据库类型
// */
// @Bean
// @ConditionalOnMissingBean
// public MybatisPlusInterceptor mybatisPlusInterceptor() {
// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(new DataVTenantHandler()));
// interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
// return interceptor;
// }
//
//}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/config/YamlPropertySourceFactory.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
config
;
import
org.springframework.beans.factory.config.YamlPropertiesFactoryBean
;
import
org.springframework.core.env.PropertiesPropertySource
;
import
org.springframework.core.env.PropertySource
;
import
org.springframework.core.io.support.EncodedResource
;
import
org.springframework.core.io.support.PropertySourceFactory
;
import
org.springframework.lang.Nullable
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.util.Properties
;
/**
* @author lengleng
* @date 2023/4/5
*/
public
class
YamlPropertySourceFactory
implements
PropertySourceFactory
{
@Override
public
PropertySource
<?>
createPropertySource
(
@Nullable
String
name
,
EncodedResource
resource
)
throws
IOException
{
Properties
propertiesFromYaml
=
loadYamlIntoProperties
(
resource
);
String
sourceName
=
name
!=
null
?
name
:
resource
.
getResource
().
getFilename
();
return
new
PropertiesPropertySource
(
sourceName
,
propertiesFromYaml
);
}
private
Properties
loadYamlIntoProperties
(
EncodedResource
resource
)
throws
FileNotFoundException
{
try
{
YamlPropertiesFactoryBean
factory
=
new
YamlPropertiesFactoryBean
();
factory
.
setResources
(
resource
.
getResource
());
factory
.
afterPropertiesSet
();
return
factory
.
getObject
();
}
catch
(
IllegalStateException
e
)
{
Throwable
cause
=
e
.
getCause
();
if
(
cause
instanceof
FileNotFoundException
)
throw
(
FileNotFoundException
)
e
.
getCause
();
throw
e
;
}
}
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/controller/GoViewProjectAPIController.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
controller
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.plugins.IgnoreStrategy
;
import
com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.dsk.biz.goview.common.base.BaseController
;
import
com.dsk.biz.goview.common.bean.AjaxResult
;
import
com.dsk.biz.goview.common.domain.*
;
import
com.dsk.biz.goview.config.GoviewProperties
;
import
com.dsk.biz.goview.mapper.GoviewProjectDataMapper
;
import
com.dsk.biz.goview.mapper.GoviewProjectMapper
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.ContentDisposition
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.util.FileCopyUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 项目表Controller
*
* @author fuce
* @ClassName: GoviewProjectController
* @date 2022-05-18 21:43:25
*/
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"/api/goview/project"
)
public
class
GoViewProjectAPIController
extends
BaseController
{
private
final
GoviewProjectDataMapper
projectDataMapper
;
private
final
GoviewProjectMapper
projectMapper
;
private
final
GoviewProperties
goviewProperties
;
@GetMapping
(
"/list"
)
public
ResultTable
list
(
Tablepar
tablepar
,
GoviewProject
goviewProject
)
{
Page
page
=
new
Page
(
tablepar
.
getPage
(),
tablepar
.
getLimit
());
Page
result
=
projectMapper
.
selectPage
(
page
,
Wrappers
.
query
(
goviewProject
));
ResultTable
resultTable
=
pageTable
(
result
.
getRecords
(),
result
.
getTotal
());
resultTable
.
setCode
(
200
);
return
resultTable
;
}
/**
* 新增保存
* @param
* @return
*/
@PostMapping
(
"/create"
)
public
AjaxResult
add
(
@RequestBody
GoviewProject
goviewProject
)
{
projectMapper
.
insert
(
goviewProject
);
return
AjaxResult
.
successData
(
200
,
goviewProject
).
put
(
"msg"
,
"创建成功"
);
}
/**
* 项目表删除
* @param ids
* @return
*/
@DeleteMapping
(
"/delete"
)
public
AjaxResult
delete
(
String
ids
)
{
projectMapper
.
deleteById
(
ids
);
return
success
();
}
@PostMapping
(
"/edit"
)
public
AjaxResult
editSave
(
@RequestBody
GoviewProject
goviewProject
)
{
projectMapper
.
updateById
(
goviewProject
);
return
success
();
}
@PostMapping
(
"/rename"
)
public
AjaxResult
rename
(
@RequestBody
GoviewProject
goviewProject
)
{
projectMapper
.
updateById
(
goviewProject
);
return
success
();
}
// 发布/取消项目状态
@PutMapping
(
"/publish"
)
@ResponseBody
public
AjaxResult
updateVisible
(
@RequestBody
GoviewProject
goviewProject
)
{
projectMapper
.
updateById
(
goviewProject
);
return
success
();
}
/**
* 获取项目存储数据
* @param id 项目id
* @param mmap
* @return
*/
@GetMapping
(
"/getData"
)
public
AjaxResult
getData
(
String
projectId
,
ModelMap
map
)
{
InterceptorIgnoreHelper
.
handle
(
IgnoreStrategy
.
builder
().
tenantLine
(
true
).
build
());
GoviewProject
goviewProject
=
projectMapper
.
selectById
(
projectId
);
if
(
goviewProject
==
null
)
{
return
AjaxResult
.
successData
(
200
,
null
).
put
(
"msg"
,
"无数据"
);
}
List
<
GoviewProjectData
>
goviewProjectDataList
=
projectDataMapper
.
selectList
(
Wrappers
.<
GoviewProjectData
>
lambdaQuery
().
eq
(
GoviewProjectData:
:
getProjectId
,
projectId
));
if
(
CollUtil
.
isNotEmpty
(
goviewProjectDataList
))
{
goviewProject
.
setContent
(
goviewProjectDataList
.
get
(
0
).
getContent
());
return
AjaxResult
.
successData
(
200
,
goviewProject
).
put
(
"msg"
,
"获取成功"
);
}
return
AjaxResult
.
successData
(
200
,
null
).
put
(
"msg"
,
"无数据"
);
}
@PostMapping
(
"/save/data"
)
public
AjaxResult
saveData
(
GoviewProjectData
data
)
{
boolean
exists
=
projectDataMapper
.
exists
(
Wrappers
.<
GoviewProjectData
>
lambdaQuery
().
eq
(
GoviewProjectData:
:
getProjectId
,
data
.
getProjectId
()));
if
(
exists
)
{
projectDataMapper
.
update
(
data
,
Wrappers
.<
GoviewProjectData
>
lambdaQuery
().
eq
(
GoviewProjectData:
:
getProjectId
,
data
.
getProjectId
()));
}
else
{
projectDataMapper
.
insert
(
data
);
}
return
AjaxResult
.
success
(
"操作成功"
);
}
/**
* 模拟请求
* @return
*/
@PostMapping
(
"/magicHttp"
)
public
AjaxResult
magicHttp
(
@RequestBody
MagicHttp
magicHttp
)
{
return
AjaxResult
.
successNullData
(
"参数异常为null"
);
}
/**
* 上传文件
* @param file 文件流对象
* @return
* @throws Exception
*/
@PostMapping
(
"/upload"
)
@ResponseBody
public
AjaxResult
upload
(
@RequestBody
MultipartFile
object
)
throws
IOException
{
File
dest
=
new
File
(
goviewProperties
.
getImgPath
()
+
object
.
getOriginalFilename
());
object
.
transferTo
(
dest
);
Map
<
String
,
String
>
map
=
new
HashMap
(
4
);
String
url
;
if
(
StrUtil
.
isNotBlank
(
goviewProperties
.
getHost
()))
{
url
=
goviewProperties
.
getHost
()
+
goviewProperties
.
getGatewayPrefix
()
+
"/api/project/get-file/"
+
object
.
getOriginalFilename
();
}
else
{
url
=
goviewProperties
.
getGatewayPrefix
()
+
"/api/project/get-file/"
+
object
.
getOriginalFilename
();
}
map
.
put
(
"link"
,
url
);
return
AjaxResult
.
successData
(
200
,
map
);
}
/**
* 文件获取
* @param fileName 文件名
*/
@GetMapping
(
"/get-file/{fileName}"
)
public
ResponseEntity
<
byte
[]>
getFile
(
@PathVariable
String
fileName
)
{
HttpHeaders
headers
=
new
HttpHeaders
();
// 通知浏览器以下载文件方式打开
ContentDisposition
contentDisposition
=
ContentDisposition
.
builder
(
"attachment"
).
filename
(
fileName
).
build
();
headers
.
setContentDisposition
(
contentDisposition
);
try
{
return
new
ResponseEntity
<>(
FileCopyUtils
.
copyToByteArray
(
new
File
(
goviewProperties
.
getImgPath
()
+
fileName
)),
headers
,
HttpStatus
.
OK
);
}
catch
(
IOException
e
)
{
log
.
warn
(
e
.
getLocalizedMessage
());
}
return
null
;
}
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/controller/GoviewPageController.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
controller
;
import
cn.dev33.satoken.annotation.SaIgnore
;
import
com.dsk.biz.goview.common.bean.AjaxResult
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
static
com
.
dsk
.
biz
.
goview
.
common
.
bean
.
AjaxResult
.
success
;
/**
* @author lengleng
* @date 2022/5/21
*/
@Slf4j
@Controller
@RequestMapping
@RequiredArgsConstructor
public
class
GoviewPageController
{
@SaIgnore
@GetMapping
({
"/"
,
"/chart/**"
,
"/project/**"
})
public
String
index
()
{
return
"index"
;
}
@GetMapping
(
"/api/goview/sys/getOssInfo"
)
@ResponseBody
public
AjaxResult
getOssInfo
()
{
return
success
();
}
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/mapper/GoviewProjectDataMapper.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.dsk.biz.goview.common.domain.GoviewProjectData
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author lengleng
* @date 2023/4/4
*/
@Mapper
public
interface
GoviewProjectDataMapper
extends
BaseMapper
<
GoviewProjectData
>
{
}
dsk-module/dsk-biz-bi/src/main/java/com/dsk/biz/goview/mapper/GoviewProjectMapper.java
0 → 100644
View file @
dbe4940a
package
com
.
dsk
.
biz
.
goview
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.dsk.biz.goview.common.domain.GoviewProject
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author lengleng
* @date 2023/4/4
*/
@Mapper
public
interface
GoviewProjectMapper
extends
BaseMapper
<
GoviewProject
>
{
}
dsk-module/dsk-biz-bi/src/main/resources/templates/index.html
0 → 100644
View file @
dbe4940a
<!DOCTYPE html>
<html
lang=
"zh-cmn-Hans"
>
<head>
<script>
self
[
"MonacoEnvironment"
]
=
(
function
(
paths
)
{
return
{
globalAPI
:
false
,
getWorkerUrl
:
function
(
moduleId
,
label
)
{
var
result
=
paths
[
label
];
if
(
/^
((
http:
)
|
(
https:
)
|
(
file:
)
|
(\/\/))
/
.
test
(
result
))
{
var
currentUrl
=
String
(
window
.
location
);
var
currentOrigin
=
currentUrl
.
substr
(
0
,
currentUrl
.
length
-
window
.
location
.
hash
.
length
-
window
.
location
.
search
.
length
-
window
.
location
.
pathname
.
length
);
if
(
result
.
substring
(
0
,
currentOrigin
.
length
)
!==
currentOrigin
)
{
var
js
=
'/*'
+
label
+
'*/importScripts("'
+
result
+
'");'
;
var
blob
=
new
Blob
([
js
],
{
type
:
'application/javascript'
});
return
URL
.
createObjectURL
(
blob
);
}
}
return
result
;
}
};
})({
"editorWorkerService"
:
"/api/gv/monacoeditorwork/editor.worker.bundle.js"
,
"typescript"
:
"/api/gv/monacoeditorwork/ts.worker.bundle.js"
,
"json"
:
"/api/gv/monacoeditorwork/json.worker.bundle.js"
,
"html"
:
"/api/gv/monacoeditorwork/html.worker.bundle.js"
,
"javascript"
:
"/api/gv/monacoeditorwork/ts.worker.bundle.js"
,
"handlebars"
:
"/api/gv/monacoeditorwork/html.worker.bundle.js"
,
"razor"
:
"/api/gv/monacoeditorwork/html.worker.bundle.js"
});
</script>
<meta
charset=
"UTF-8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
/>
<meta
name=
"renderer"
content=
"webkit"
/>
<meta
name=
"description"
content=
"GoView 是高效、高性能的拖拽式低代码数据可视化开发平台,将页面元素封装为基础组件,无需编写代码即可完成业务需求。"
>
<meta
name=
"keywords"
content=
"GoView,goview,低代码,可视化"
>
<meta
name=
"author"
content=
"奔跑的面条,面条"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
/>
<link
rel=
"icon"
href=
"./favicon.ico"
/>
<title>
GoView
</title>
<script
type=
"module"
crossorigin
src=
"/api/gv/static/js/index-ebdecea3.js"
></script>
<link
rel=
"stylesheet"
href=
"/api/gv/static/css/index-9c2eb289.css"
>
</head>
<body>
<div
id=
"appProvider"
style=
"display: none;"
></div>
<div
id=
"app"
>
<div
class=
"first-loading-wrp"
>
<div
class=
"loading-wrp"
>
<span
class=
"dot dot-spin"
><i></i><i></i><i></i><i></i></span>
</div>
</div>
</div>
</body>
</html>
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