Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdst
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdst
提交
3fd32f7f
提交
3fd32f7f
编写于
9月 17, 2021
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码 [ibz-dst,应用]
上级
05ab67df
变更
12
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
266 行增加
和
5 行删除
+266
-5
dametrics.ts
app_web/src/mock/entity/dametrics/dametrics.ts
+65
-0
rule-items.ts
app_web/src/mock/entity/rule-items/rule-items.ts
+38
-0
dametric-service-base.ts
app_web/src/service/dametric/dametric-service-base.ts
+39
-0
rule-item-service-base.ts
app_web/src/service/rule-item/rule-item-service-base.ts
+28
-0
IDAMetricService.java
...va/cn/ibizlab/core/analysis/service/IDAMetricService.java
+2
-0
DAMetricServiceImpl.java
...izlab/core/analysis/service/impl/DAMetricServiceImpl.java
+16
-0
IRuleItemService.java
...n/java/cn/ibizlab/core/rule/service/IRuleItemService.java
+2
-0
RuleItemServiceImpl.java
...n/ibizlab/core/rule/service/impl/RuleItemServiceImpl.java
+16
-0
h2_table.xml
ibzdst-core/src/main/resources/liquibase/h2_table.xml
+3
-3
systemResource.json
...st-core/src/main/resources/permission/systemResource.json
+2
-2
DAMetricResource.java
...i/src/main/java/cn/ibizlab/api/rest/DAMetricResource.java
+36
-0
RuleItemResource.java
...i/src/main/java/cn/ibizlab/api/rest/RuleItemResource.java
+19
-0
未找到文件。
app_web/src/mock/entity/dametrics/dametrics.ts
浏览文件 @
3fd32f7f
...
...
@@ -371,6 +371,71 @@ mock.onPost(new RegExp(/^\/dametrics\/?([a-zA-Z0-9\-\;]{0,35})\/syncrule$/)).rep
});
// TestRule
mock
.
onPost
(
new
RegExp
(
/^
\/
dabuilds
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dametrics
\/([
a-zA-Z0-9
\-\;]{1,35})\/
testrule$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dametric 方法: TestRule"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'build_id'
,
'metric_id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dabuilds
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dametrics
\/([
a-zA-Z0-9
\-\;]{1,35})\/
testrule$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// TestRule
mock
.
onPost
(
new
RegExp
(
/^
\/
dametrics
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
testrule$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dametric 方法: TestRule"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'metric_id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dametrics
\/([
a-zA-Z0-9
\-\;]{1,35})\/
testrule$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.metric_id, tempValue.metric_id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'metric_id'
]
==
tempValue
[
'metric_id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
dabuilds
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dametrics
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dametric 方法: Update"
);
...
...
app_web/src/mock/entity/rule-items/rule-items.ts
浏览文件 @
3fd32f7f
...
...
@@ -281,6 +281,44 @@ mock.onPost(new RegExp(/^\/ruleitems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((
return
[
status
,
data
];
});
// TestRule
mock
.
onPost
(
new
RegExp
(
/^
\/
ruleitems
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
testrule$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ruleitem 方法: TestRule"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'rule_id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
ruleitems
\/([
a-zA-Z0-9
\-\;]{1,35})\/
testrule$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.rule_id, tempValue.rule_id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'rule_id'
]
==
tempValue
[
'rule_id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
ruleitems
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ruleitem 方法: Update"
);
...
...
app_web/src/service/dametric/dametric-service-base.ts
浏览文件 @
3fd32f7f
...
...
@@ -220,6 +220,45 @@ export default class DAMetricServiceBase extends EntityService {
return
await
Http
.
getInstance
().
post
(
`/dametrics/syncrulebatch`
,
tempData
,
isloading
);
}
/**
* TestRule接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DAMetricServiceBase
*/
public
async
TestRule
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dabuild
&&
context
.
dametric
){
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dabuilds/
${
context
.
dabuild
}
/dametrics/
${
context
.
dametric
}
/testrule`
,
data
,
isloading
);
return
res
;
}
let
res
:
any
=
Http
.
getInstance
().
post
(
`/dametrics/
${
context
.
dametric
}
/testrule`
,
data
,
isloading
);
return
res
;
}
/**
* TestRuleBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DAMetricServiceBase
*/
public
async
TestRuleBatch
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dabuild
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
await
Http
.
getInstance
().
post
(
`/dabuilds/
${
context
.
dabuild
}
/dametrics/testrulebatch`
,
tempData
,
isloading
);
}
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
await
Http
.
getInstance
().
post
(
`/dametrics/testrulebatch`
,
tempData
,
isloading
);
}
/**
* Update接口方法
*
...
...
app_web/src/service/rule-item/rule-item-service-base.ts
浏览文件 @
3fd32f7f
...
...
@@ -194,6 +194,34 @@ export default class RuleItemServiceBase extends EntityService {
return
res
;
}
/**
* TestRule接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof RuleItemServiceBase
*/
public
async
TestRule
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/ruleitems/
${
context
.
ruleitem
}
/testrule`
,
data
,
isloading
);
return
res
;
}
/**
* TestRuleBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof RuleItemServiceBase
*/
public
async
TestRuleBatch
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
await
Http
.
getInstance
().
post
(
`/ruleitems/testrulebatch`
,
tempData
,
isloading
);
}
/**
* Update接口方法
*
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/analysis/service/IDAMetricService.java
浏览文件 @
3fd32f7f
...
...
@@ -38,6 +38,8 @@ public interface IDAMetricService extends IService<DAMetric> {
void
saveBatch
(
List
<
DAMetric
>
list
);
DAMetric
syncRule
(
DAMetric
et
);
boolean
syncRuleBatch
(
List
<
DAMetric
>
etList
);
DAMetric
testRule
(
DAMetric
et
);
boolean
testRuleBatch
(
List
<
DAMetric
>
etList
);
Page
<
DAMetric
>
searchDefault
(
DAMetricSearchContext
context
);
List
<
DAMetric
>
selectByBuildId
(
String
build_id
);
void
removeByBuildId
(
String
build_id
);
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/analysis/service/impl/DAMetricServiceImpl.java
浏览文件 @
3fd32f7f
...
...
@@ -203,6 +203,22 @@ public class DAMetricServiceImpl extends ServiceImpl<DAMetricMapper, DAMetric> i
return
true
;
}
@Override
@Transactional
public
DAMetric
testRule
(
DAMetric
et
)
{
//自定义代码
return
et
;
}
@Override
@Transactional
public
boolean
testRuleBatch
(
List
<
DAMetric
>
etList
)
{
for
(
DAMetric
et
:
etList
)
{
testRule
(
et
);
}
return
true
;
}
@Override
public
List
<
DAMetric
>
selectByBuildId
(
String
build_id
)
{
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/rule/service/IRuleItemService.java
浏览文件 @
3fd32f7f
...
...
@@ -40,6 +40,8 @@ public interface IRuleItemService extends IService<RuleItem> {
boolean
modelchangeBatch
(
List
<
RuleItem
>
etList
);
boolean
save
(
RuleItem
et
);
void
saveBatch
(
List
<
RuleItem
>
list
);
RuleItem
testRule
(
RuleItem
et
);
boolean
testRuleBatch
(
List
<
RuleItem
>
etList
);
Page
<
RuleItem
>
searchDefault
(
RuleItemSearchContext
context
);
List
<
RuleItem
>
selectByModelId
(
String
id
);
void
removeByModelId
(
String
id
);
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/rule/service/impl/RuleItemServiceImpl.java
浏览文件 @
3fd32f7f
...
...
@@ -222,6 +222,22 @@ public class RuleItemServiceImpl extends ServiceImpl<RuleItemMapper, RuleItem> i
}
}
@Override
@Transactional
public
RuleItem
testRule
(
RuleItem
et
)
{
//自定义代码
return
et
;
}
@Override
@Transactional
public
boolean
testRuleBatch
(
List
<
RuleItem
>
etList
)
{
for
(
RuleItem
et
:
etList
)
{
testRule
(
et
);
}
return
true
;
}
@Override
public
List
<
RuleItem
>
selectByModelId
(
String
id
)
{
...
...
ibzdst-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
3fd32f7f
...
...
@@ -54,7 +54,7 @@
<!--输出实体[DA_METRIC]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-da_metric-
1
-3"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-da_metric-
2
-3"
>
<createTable
tableName=
"IBZDAMETRIC"
>
<column
name=
"DA_METRICID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DA_METRIC_DA_METRICID"
/>
...
...
@@ -496,7 +496,7 @@
<!--输出实体[RU_ITEM]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ru_item-
1
-18"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ru_item-
3
-18"
>
<createTable
tableName=
"IBZRULE"
>
<column
name=
"RULEID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_RU_ITEM_RULEID"
/>
...
...
@@ -587,7 +587,7 @@
<!--输出实体[DA_BUILD]外键关系 -->
<!--输出实体[DA_CHART]外键关系 -->
<!--输出实体[DA_METRIC]外键关系 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-da_metric-
1
-20"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-da_metric-
2
-20"
>
<addForeignKeyConstraint
baseColumnNames=
"BUILDID"
baseTableName=
"IBZDAMETRIC"
constraintName=
"DER1N_DA_METRIC_DA_BUILD_BUILD"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"BUILDID"
referencedTableName=
"IBZDABUILD"
validate=
"true"
/>
</changeSet>
<!--输出实体[DA_REPORT]外键关系 -->
...
...
ibzdst-core/src/main/resources/permission/systemResource.json
浏览文件 @
3fd32f7f
...
...
@@ -32,7 +32,7 @@
"delogicname"
:
"指标"
,
"sysmoudle"
:{
"id"
:
"ANALYSIS"
,
"name"
:
"analysis"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"数据集"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"SyncRule"
,
"name"
:
"同步指标到规则"
,
"type"
:
"USERCUSTOM"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"SyncRule"
,
"name"
:
"同步指标到规则"
,
"type"
:
"USERCUSTOM"
}
,{
"id"
:
"TestRule"
,
"name"
:
"TestRule"
,
"type"
:
"USERCUSTOM"
}
],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
}
,
{
...
...
@@ -168,7 +168,7 @@
"delogicname"
:
"规则"
,
"sysmoudle"
:{
"id"
:
"RULE"
,
"name"
:
"rule"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"数据集"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"BuildRuleFile"
,
"name"
:
"生成规则文件"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Modelchange"
,
"name"
:
"modelchange"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"BuildRuleFile"
,
"name"
:
"生成规则文件"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Modelchange"
,
"name"
:
"modelchange"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
}
,{
"id"
:
"TestRule"
,
"name"
:
"TestRule"
,
"type"
:
"USERCUSTOM"
}
],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
}
,
{
...
...
ibzdst-provider/ibzdst-provider-api/src/main/java/cn/ibizlab/api/rest/DAMetricResource.java
浏览文件 @
3fd32f7f
...
...
@@ -158,6 +158,25 @@ public class DAMetricResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
result
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-TestRule-all')"
)
@ApiOperation
(
value
=
"TestRule"
,
tags
=
{
"指标"
},
notes
=
"TestRule"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dametrics/{dametric_id}/testrule"
)
public
ResponseEntity
<
DAMetricDTO
>
testRule
(
@PathVariable
(
"dametric_id"
)
String
dametric_id
,
@RequestBody
DAMetricDTO
dametricdto
)
{
DAMetric
domain
=
dametricMapping
.
toDomain
(
dametricdto
);
domain
.
setMetricId
(
dametric_id
);
domain
=
dametricService
.
testRule
(
domain
);
dametricdto
=
dametricMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dametricdto
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-TestRule-all')"
)
@ApiOperation
(
value
=
"批量处理[TestRule]"
,
tags
=
{
"指标"
},
notes
=
"批量处理[TestRule]"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dametrics/testrulebatch"
)
public
ResponseEntity
<
Boolean
>
testRuleBatch
(
@RequestBody
List
<
DAMetricDTO
>
dametricdtos
)
{
List
<
DAMetric
>
domains
=
dametricMapping
.
toDomain
(
dametricdtos
);
boolean
result
=
dametricService
.
testRuleBatch
(
domains
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
result
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-searchDefault-all')"
)
@ApiOperation
(
value
=
"获取数据集"
,
tags
=
{
"指标"
}
,
notes
=
"获取数据集"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dametrics/fetchdefault"
)
...
...
@@ -307,6 +326,23 @@ public class DAMetricResource {
boolean
result
=
dametricService
.
syncRuleBatch
(
domains
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
result
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-TestRule-all')"
)
@ApiOperation
(
value
=
"根据分析指标"
,
tags
=
{
"指标"
},
notes
=
"根据分析指标"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dabuilds/{dabuild_id}/dametrics/{dametric_id}/testrule"
)
public
ResponseEntity
<
DAMetricDTO
>
testRuleByDABuild
(
@PathVariable
(
"dabuild_id"
)
String
dabuild_id
,
@PathVariable
(
"dametric_id"
)
String
dametric_id
,
@RequestBody
DAMetricDTO
dametricdto
)
{
DAMetric
domain
=
dametricMapping
.
toDomain
(
dametricdto
);
domain
.
setBuildId
(
dabuild_id
);
domain
=
dametricService
.
testRule
(
domain
)
;
dametricdto
=
dametricMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dametricdto
);
}
@ApiOperation
(
value
=
"批量处理[根据分析指标]"
,
tags
=
{
"指标"
},
notes
=
"批量处理[根据分析指标]"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dabuilds/{dabuild_id}/dametrics/testrulebatch"
)
public
ResponseEntity
<
Boolean
>
testRuleByDABuild
(
@PathVariable
(
"dabuild_id"
)
String
dabuild_id
,
@RequestBody
List
<
DAMetricDTO
>
dametricdtos
)
{
List
<
DAMetric
>
domains
=
dametricMapping
.
toDomain
(
dametricdtos
);
boolean
result
=
dametricService
.
testRuleBatch
(
domains
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
result
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-searchDefault-all')"
)
@ApiOperation
(
value
=
"根据分析获取数据集"
,
tags
=
{
"指标"
}
,
notes
=
"根据分析获取数据集"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dabuilds/{dabuild_id}/dametrics/fetchdefault"
)
...
...
ibzdst-provider/ibzdst-provider-api/src/main/java/cn/ibizlab/api/rest/RuleItemResource.java
浏览文件 @
3fd32f7f
...
...
@@ -177,6 +177,25 @@ public class RuleItemResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-RuleItem-TestRule-all')"
)
@ApiOperation
(
value
=
"TestRule"
,
tags
=
{
"规则"
},
notes
=
"TestRule"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ruleitems/{ruleitem_id}/testrule"
)
public
ResponseEntity
<
RuleItemDTO
>
testRule
(
@PathVariable
(
"ruleitem_id"
)
String
ruleitem_id
,
@RequestBody
RuleItemDTO
ruleitemdto
)
{
RuleItem
domain
=
ruleitemMapping
.
toDomain
(
ruleitemdto
);
domain
.
setRuleId
(
ruleitem_id
);
domain
=
ruleitemService
.
testRule
(
domain
);
ruleitemdto
=
ruleitemMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ruleitemdto
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-RuleItem-TestRule-all')"
)
@ApiOperation
(
value
=
"批量处理[TestRule]"
,
tags
=
{
"规则"
},
notes
=
"批量处理[TestRule]"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ruleitems/testrulebatch"
)
public
ResponseEntity
<
Boolean
>
testRuleBatch
(
@RequestBody
List
<
RuleItemDTO
>
ruleitemdtos
)
{
List
<
RuleItem
>
domains
=
ruleitemMapping
.
toDomain
(
ruleitemdtos
);
boolean
result
=
ruleitemService
.
testRuleBatch
(
domains
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
result
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-RuleItem-searchDefault-all')"
)
@ApiOperation
(
value
=
"获取数据集"
,
tags
=
{
"规则"
}
,
notes
=
"获取数据集"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ruleitems/fetchdefault"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录