Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzlite
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzlite
提交
170e9e6f
提交
170e9e6f
编写于
9月 21, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
配置
上级
04aeea74
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
44 行增加
和
11 行删除
+44
-11
DstComponentExService.java
...bizlab/core/extensions/service/DstComponentExService.java
+13
-0
LiteModelService.java
...bizlab/core/lite/extensions/service/LiteModelService.java
+30
-4
LiteCoreResource.java
...java/cn/ibizlab/api/rest/extensions/LiteCoreResource.java
+1
-7
未找到文件。
ibzlite-core/src/main/java/cn/ibizlab/core/extensions/service/DstComponentExService.java
浏览文件 @
170e9e6f
...
@@ -3,6 +3,8 @@ package cn.ibizlab.core.extensions.service;
...
@@ -3,6 +3,8 @@ package cn.ibizlab.core.extensions.service;
import
cn.ibizlab.core.lite.service.impl.DstComponentServiceImpl
;
import
cn.ibizlab.core.lite.service.impl.DstComponentServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.core.lite.domain.DstComponent
;
import
cn.ibizlab.core.lite.domain.DstComponent
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Caching
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.context.annotation.Primary
;
...
@@ -31,5 +33,16 @@ public class DstComponentExService extends DstComponentServiceImpl {
...
@@ -31,5 +33,16 @@ public class DstComponentExService extends DstComponentServiceImpl {
public
DstComponent
sync
(
DstComponent
et
)
{
public
DstComponent
sync
(
DstComponent
et
)
{
return
super
.
sync
(
et
);
return
super
.
sync
(
et
);
}
}
@Override
@Caching
(
evict
=
{
@CacheEvict
(
value
=
"dstcomponent"
,
key
=
"'row:'+#p0.appId+'.'+#p0.name"
),
@CacheEvict
(
value
=
"dstcomponent"
,
key
=
"'row:'+#p0.appId+'.'+#p0.codeName"
)
})
public
boolean
update
(
DstComponent
et
)
{
return
super
.
update
(
et
);
}
}
}
ibzlite-core/src/main/java/cn/ibizlab/core/lite/extensions/service/LiteModelService.java
浏览文件 @
170e9e6f
package
cn
.
ibizlab
.
core
.
lite
.
extensions
.
service
;
package
cn
.
ibizlab
.
core
.
lite
.
extensions
.
service
;
import
cn.ibizlab.core.lite.domain.DstApp
;
import
cn.ibizlab.core.lite.domain.*
;
import
cn.ibizlab.core.lite.domain.DstSystem
;
import
cn.ibizlab.core.lite.domain.MetaEntity
;
import
cn.ibizlab.core.lite.domain.MetaRelationship
;
import
cn.ibizlab.core.lite.extensions.domain.EntityModel
;
import
cn.ibizlab.core.lite.extensions.domain.EntityModel
;
import
cn.ibizlab.core.lite.extensions.domain.FieldModel
;
import
cn.ibizlab.core.lite.extensions.domain.FieldModel
;
import
cn.ibizlab.core.lite.extensions.domain.RelationshipModel
;
import
cn.ibizlab.core.lite.extensions.domain.RelationshipModel
;
import
cn.ibizlab.core.lite.extensions.util.LiteStorage
;
import
cn.ibizlab.core.lite.extensions.util.LiteStorage
;
import
cn.ibizlab.core.lite.service.*
;
import
cn.ibizlab.core.lite.service.*
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -16,8 +15,10 @@ import org.springframework.cache.annotation.CacheEvict;
...
@@ -16,8 +15,10 @@ import org.springframework.cache.annotation.CacheEvict;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Caching
;
import
org.springframework.cache.annotation.Caching
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.sql.Wrapper
;
import
java.sql.Wrapper
;
...
@@ -63,6 +64,10 @@ public class LiteModelService {
...
@@ -63,6 +64,10 @@ public class LiteModelService {
@Lazy
@Lazy
private
IMetaDataSetService
metaDataSetService
;
private
IMetaDataSetService
metaDataSetService
;
@Autowired
@Lazy
private
IDstComponentService
dstComponentService
;
@Cacheable
(
value
=
"entitymodel"
,
key
=
"'row:'+#p0+'.'+#p1"
)
@Cacheable
(
value
=
"entitymodel"
,
key
=
"'row:'+#p0+'.'+#p1"
)
public
EntityModel
getEntityModel
(
String
systemId
,
String
name
)
public
EntityModel
getEntityModel
(
String
systemId
,
String
name
)
{
{
...
@@ -198,4 +203,25 @@ public class LiteModelService {
...
@@ -198,4 +203,25 @@ public class LiteModelService {
return
list
;
return
list
;
}
}
@Cacheable
(
value
=
"dstcomponent"
,
key
=
"'row:'+#p0+'.'+#p1"
)
public
DstComponent
getComponent
(
String
app
,
String
component
)
{
DstComponent
dstComponent
=
dstComponentService
.
getOne
(
Wrappers
.<
DstComponent
>
lambdaQuery
().
eq
(
DstComponent:
:
getAppId
,
app
).
and
(
wrapper
->
wrapper
.
eq
(
DstComponent:
:
getCodeName
,
component
).
or
().
eq
(
DstComponent:
:
getName
,
component
)),
true
);
if
(
dstComponent
==
null
||
StringUtils
.
isEmpty
(
dstComponent
.
getConfig
()))
throw
new
BadRequestAlertException
(
"未找到配置"
,
"DstComponent"
,
component
);
return
dstComponent
;
}
@CacheEvict
(
value
=
"dstcomponent"
,
key
=
"'row:'+#p0+'.'+#p1"
)
public
void
resetComponent
(
String
app
,
String
component
)
{
}
}
}
ibzlite-provider/ibzlite-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/LiteCoreResource.java
浏览文件 @
170e9e6f
...
@@ -46,13 +46,7 @@ public class LiteCoreResource {
...
@@ -46,13 +46,7 @@ public class LiteCoreResource {
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/lite/{app}/components/{component}"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/lite/{app}/components/{component}"
)
public
ResponseEntity
<
JSON
>
getComponent
(
@PathVariable
(
"app"
)
String
app
,
@PathVariable
(
"component"
)
String
component
)
{
public
ResponseEntity
<
JSON
>
getComponent
(
@PathVariable
(
"app"
)
String
app
,
@PathVariable
(
"component"
)
String
component
)
{
DstComponent
dstComponent
=
dstComponentService
.
getOne
(
Wrappers
.<
DstComponent
>
lambdaQuery
().
eq
(
DstComponent:
:
getAppId
,
app
).
and
(
DstComponent
dstComponent
=
liteModelService
.
getComponent
(
app
,
component
);
wrapper
->
wrapper
.
eq
(
DstComponent:
:
getCodeName
,
component
).
or
().
eq
(
DstComponent:
:
getName
,
component
)),
true
);
if
(
StringUtils
.
isEmpty
(
dstComponent
.
getConfig
()))
throw
new
BadRequestAlertException
(
"未找到配置"
,
"DstComponent"
,
component
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
JSON
.
parseObject
(
dstComponent
.
getConfig
()));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
JSON
.
parseObject
(
dstComponent
.
getConfig
()));
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录