提交 9016ec12 编写于 作者: ibizdev's avatar ibizdev

zhouweidong 发布系统代码 [ibz-dst,应用]

上级 c9182a03
...@@ -427,6 +427,71 @@ mock.onPost(new RegExp(/^\/dametrics\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply(( ...@@ -427,6 +427,71 @@ mock.onPost(new RegExp(/^\/dametrics\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((
return [status, data]; return [status, data];
}); });
// SyncRule
mock.onPost(new RegExp(/^\/dabuilds\/([a-zA-Z0-9\-\;]{1,35})\/dametrics\/([a-zA-Z0-9\-\;]{1,35})\/syncrule$/)).reply((config: any) => {
console.groupCollapsed("实体:dametric 方法: SyncRule");
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})\/syncrule$/).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, {}];
});
// SyncRule
mock.onPost(new RegExp(/^\/dametrics\/?([a-zA-Z0-9\-\;]{0,35})\/syncrule$/)).reply((config: any) => {
console.groupCollapsed("实体:dametric 方法: SyncRule");
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})\/syncrule$/).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];
});
// FetchDefault // FetchDefault
mock.onGet(new RegExp(/^\/dabuilds\/([a-zA-Z0-9\-\;]{1,35})\/dametrics\/fetchdefault$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/dabuilds\/([a-zA-Z0-9\-\;]{1,35})\/dametrics\/fetchdefault$/)).reply((config: any) => {
......
...@@ -225,6 +225,27 @@ export default class DAMetricServiceBase extends EntityService { ...@@ -225,6 +225,27 @@ export default class DAMetricServiceBase extends EntityService {
return res; return res;
} }
/**
* SyncRule接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DAMetricServiceBase
*/
public async SyncRule(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}/syncrule`,data,isloading);
return res;
}
let res:any = Http.getInstance().post(`/dametrics/${context.dametric}/syncrule`,data,isloading);
return res;
}
/** /**
* FetchDefault接口方法 * FetchDefault接口方法
* *
......
...@@ -36,6 +36,7 @@ public interface IDAMetricService extends IService<DAMetric> { ...@@ -36,6 +36,7 @@ public interface IDAMetricService extends IService<DAMetric> {
boolean checkKey(DAMetric et); boolean checkKey(DAMetric et);
boolean save(DAMetric et); boolean save(DAMetric et);
void saveBatch(List<DAMetric> list); void saveBatch(List<DAMetric> list);
DAMetric syncRule(DAMetric et);
Page<DAMetric> searchDefault(DAMetricSearchContext context); Page<DAMetric> searchDefault(DAMetricSearchContext context);
List<DAMetric> selectByBuildId(String build_id); List<DAMetric> selectByBuildId(String build_id);
void removeByBuildId(String build_id); void removeByBuildId(String build_id);
......
...@@ -52,6 +52,10 @@ public class DAMetricServiceImpl extends ServiceImpl<DAMetricMapper, DAMetric> i ...@@ -52,6 +52,10 @@ public class DAMetricServiceImpl extends ServiceImpl<DAMetricMapper, DAMetric> i
@Lazy @Lazy
protected cn.ibizlab.core.analysis.service.IDABuildService dabuildService; protected cn.ibizlab.core.analysis.service.IDABuildService dabuildService;
@Autowired
@Lazy
protected cn.ibizlab.core.analysis.service.IDAMetricService dametricService;
protected int batchSize = 500; protected int batchSize = 500;
@Override @Override
...@@ -62,6 +66,9 @@ public class DAMetricServiceImpl extends ServiceImpl<DAMetricMapper, DAMetric> i ...@@ -62,6 +66,9 @@ public class DAMetricServiceImpl extends ServiceImpl<DAMetricMapper, DAMetric> i
return false; return false;
} }
CachedBeanCopier.copy(get(et.getMetricId()), et); CachedBeanCopier.copy(get(et.getMetricId()), et);
cn.ibizlab.core.analysis.domain.DAMetric actionLogicDE =new cn.ibizlab.core.analysis.domain.DAMetric();
et.copyTo(actionLogicDE,true);
dametricService.syncRule(actionLogicDE);
return true; return true;
} }
...@@ -80,6 +87,9 @@ public class DAMetricServiceImpl extends ServiceImpl<DAMetricMapper, DAMetric> i ...@@ -80,6 +87,9 @@ public class DAMetricServiceImpl extends ServiceImpl<DAMetricMapper, DAMetric> i
return false; return false;
} }
CachedBeanCopier.copy(get(et.getMetricId()), et); CachedBeanCopier.copy(get(et.getMetricId()), et);
cn.ibizlab.core.analysis.domain.DAMetric actionLogicDE =new cn.ibizlab.core.analysis.domain.DAMetric();
et.copyTo(actionLogicDE,true);
dametricService.syncRule(actionLogicDE);
return true; return true;
} }
...@@ -160,6 +170,13 @@ public class DAMetricServiceImpl extends ServiceImpl<DAMetricMapper, DAMetric> i ...@@ -160,6 +170,13 @@ public class DAMetricServiceImpl extends ServiceImpl<DAMetricMapper, DAMetric> i
saveOrUpdateBatch(list,batchSize); saveOrUpdateBatch(list,batchSize);
} }
@Override
@Transactional
public DAMetric syncRule(DAMetric et) {
//自定义代码
return et;
}
@Override @Override
public List<DAMetric> selectByBuildId(String build_id) { public List<DAMetric> selectByBuildId(String build_id) {
......
package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.analysis.service.impl.DAMetricServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.analysis.domain.DAMetric;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[指标] 自定义服务对象
*/
@Slf4j
@Primary
@Service("DAMetricExService")
public class DAMetricExService extends DAMetricServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* [SyncRule:同步指标到规则] 行为扩展
* @param et
* @return
*/
@Override
@Transactional
public DAMetric syncRule(DAMetric et) {
return super.syncRule(et);
}
}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!--输出实体[DA_BUILD]数据结构 --> <!--输出实体[DA_BUILD]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-da_build-45-1"> <changeSet author="root" id="tab-da_build-45-1">
<createTable tableName="IBZDABUILD"> <createTable tableName="IBZDABUILD">
<column name="BUILDID" remarks="" type="VARCHAR(100)"> <column name="BUILDID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DA_BUILD_BUILDID"/> <constraints primaryKey="true" primaryKeyName="PK_DA_BUILD_BUILDID"/>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<!--输出实体[DA_CHART]数据结构 --> <!--输出实体[DA_CHART]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-da_chart-22-2"> <changeSet author="root" id="tab-da_chart-22-2">
<createTable tableName="IBZDACHART"> <createTable tableName="IBZDACHART">
<column name="CHARTID" remarks="" type="VARCHAR(100)"> <column name="CHARTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DA_CHART_CHARTID"/> <constraints primaryKey="true" primaryKeyName="PK_DA_CHART_CHARTID"/>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<!--输出实体[DA_METRIC]数据结构 --> <!--输出实体[DA_METRIC]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-da_metric-53-3"> <changeSet author="root" id="tab-da_metric-56-3">
<createTable tableName="IBZDAMETRIC"> <createTable tableName="IBZDAMETRIC">
<column name="DA_METRICID" remarks="" type="VARCHAR(100)"> <column name="DA_METRICID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DA_METRIC_DA_METRICID"/> <constraints primaryKey="true" primaryKeyName="PK_DA_METRIC_DA_METRICID"/>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<!--输出实体[DA_REPORT]数据结构 --> <!--输出实体[DA_REPORT]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-da_report-24-4"> <changeSet author="root" id="tab-da_report-24-4">
<createTable tableName="IBZDAREPORT"> <createTable tableName="IBZDAREPORT">
<column name="REPORTID" remarks="" type="VARCHAR(100)"> <column name="REPORTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DA_REPORT_REPORTID"/> <constraints primaryKey="true" primaryKeyName="PK_DA_REPORT_REPORTID"/>
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<!--输出实体[DST_DATASOURCE]数据结构 --> <!--输出实体[DST_DATASOURCE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-dst_datasource-6-5"> <changeSet author="root" id="tab-dst_datasource-6-5">
<createTable tableName="IBZDATASOURCE"> <createTable tableName="IBZDATASOURCE">
<column name="DSID" remarks="" type="VARCHAR(100)"> <column name="DSID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DST_DATASOURCE_DSID"/> <constraints primaryKey="true" primaryKeyName="PK_DST_DATASOURCE_DSID"/>
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<!--输出实体[DST_SYSTEM]数据结构 --> <!--输出实体[DST_SYSTEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-dst_system-5-6"> <changeSet author="root" id="tab-dst_system-5-6">
<createTable tableName="IBZPSSYSTEM"> <createTable tableName="IBZPSSYSTEM">
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)"> <column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DST_SYSTEM_PSSYSTEMID"/> <constraints primaryKey="true" primaryKeyName="PK_DST_SYSTEM_PSSYSTEMID"/>
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<!--输出实体[RU_EXECLOG]数据结构 --> <!--输出实体[RU_EXECLOG]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ru_execlog-31-7"> <changeSet author="root" id="tab-ru_execlog-31-7">
<createTable tableName="IBZRULELOG"> <createTable tableName="IBZRULELOG">
<column name="RU_EXECLOGID" remarks="" type="VARCHAR(100)"> <column name="RU_EXECLOGID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_RU_EXECLOG_RU_EXECLOGID"/> <constraints primaryKey="true" primaryKeyName="PK_RU_EXECLOG_RU_EXECLOGID"/>
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
<!--输出实体[RU_EXECRESULT]数据结构 --> <!--输出实体[RU_EXECRESULT]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ru_execresult-43-8"> <changeSet author="root" id="tab-ru_execresult-43-8">
<createTable tableName="IBZRULERESULT"> <createTable tableName="IBZRULERESULT">
<column name="RU_EXECRESULTID" remarks="" type="VARCHAR(100)"> <column name="RU_EXECRESULTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_RU_EXECRESULT_RU_EXECRESULT"/> <constraints primaryKey="true" primaryKeyName="PK_RU_EXECRESULT_RU_EXECRESULT"/>
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
<!--输出实体[META_DATASET]数据结构 --> <!--输出实体[META_DATASET]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_dataset-2-9"> <changeSet author="root" id="tab-meta_dataset-2-9">
<createTable tableName="IBZDATASET"> <createTable tableName="IBZDATASET">
<column name="DATASETID" remarks="" type="VARCHAR(100)"> <column name="DATASETID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_DATASET_DATASETID"/> <constraints primaryKey="true" primaryKeyName="PK_META_DATASET_DATASETID"/>
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
<!--输出实体[META_ENTITY]数据结构 --> <!--输出实体[META_ENTITY]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_entity-12-10"> <changeSet author="root" id="tab-meta_entity-12-10">
<createTable tableName="IBZENTITY"> <createTable tableName="IBZENTITY">
<column name="ENTITYID" remarks="" type="VARCHAR(100)"> <column name="ENTITYID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_ENTITY_ENTITYID"/> <constraints primaryKey="true" primaryKeyName="PK_META_ENTITY_ENTITYID"/>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
<!--输出实体[META_FIELD]数据结构 --> <!--输出实体[META_FIELD]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_field-7-11"> <changeSet author="root" id="tab-meta_field-7-11">
<createTable tableName="IBZFIELD"> <createTable tableName="IBZFIELD">
<column name="FIELDID" remarks="" type="VARCHAR(100)"> <column name="FIELDID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_FIELD_FIELDID"/> <constraints primaryKey="true" primaryKeyName="PK_META_FIELD_FIELDID"/>
...@@ -322,7 +322,7 @@ ...@@ -322,7 +322,7 @@
<!--输出实体[META_MODEL]数据结构 --> <!--输出实体[META_MODEL]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_model-18-12"> <changeSet author="root" id="tab-meta_model-18-12">
<createTable tableName="IBZMODEL"> <createTable tableName="IBZMODEL">
<column name="MODELID" remarks="" type="VARCHAR(100)"> <column name="MODELID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_MODEL_MODELID"/> <constraints primaryKey="true" primaryKeyName="PK_META_MODEL_MODELID"/>
...@@ -348,7 +348,7 @@ ...@@ -348,7 +348,7 @@
<!--输出实体[META_MODULE]数据结构 --> <!--输出实体[META_MODULE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_module-7-13"> <changeSet author="root" id="tab-meta_module-7-13">
<createTable tableName="IBZMODULE"> <createTable tableName="IBZMODULE">
<column name="MODULEID" remarks="" type="VARCHAR(100)"> <column name="MODULEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_MODULE_MODULEID"/> <constraints primaryKey="true" primaryKeyName="PK_META_MODULE_MODULEID"/>
...@@ -366,7 +366,7 @@ ...@@ -366,7 +366,7 @@
<!--输出实体[META_RELATION]数据结构 --> <!--输出实体[META_RELATION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_relation-6-14"> <changeSet author="root" id="tab-meta_relation-6-14">
<createTable tableName="IBZRELATION"> <createTable tableName="IBZRELATION">
<column name="RELATIONID" remarks="" type="VARCHAR(100)"> <column name="RELATIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_RELATION_RELATIONID"/> <constraints primaryKey="true" primaryKeyName="PK_META_RELATION_RELATIONID"/>
...@@ -398,7 +398,7 @@ ...@@ -398,7 +398,7 @@
<!--输出实体[RU_ENGINE]数据结构 --> <!--输出实体[RU_ENGINE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ru_engine-29-15"> <changeSet author="root" id="tab-ru_engine-29-15">
<createTable tableName="IBZRULEENGINE"> <createTable tableName="IBZRULEENGINE">
<column name="ENGINEID" remarks="" type="VARCHAR(100)"> <column name="ENGINEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_RU_ENGINE_ENGINEID"/> <constraints primaryKey="true" primaryKeyName="PK_RU_ENGINE_ENGINEID"/>
...@@ -420,7 +420,7 @@ ...@@ -420,7 +420,7 @@
<!--输出实体[RU_ITEM]数据结构 --> <!--输出实体[RU_ITEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ru_item-59-16"> <changeSet author="root" id="tab-ru_item-65-16">
<createTable tableName="IBZRULE"> <createTable tableName="IBZRULE">
<column name="RULEID" remarks="" type="VARCHAR(100)"> <column name="RULEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_RU_ITEM_RULEID"/> <constraints primaryKey="true" primaryKeyName="PK_RU_ITEM_RULEID"/>
...@@ -457,7 +457,7 @@ ...@@ -457,7 +457,7 @@
<!--输出实体[DA_BUILD]外键关系 --> <!--输出实体[DA_BUILD]外键关系 -->
<!--输出实体[DA_CHART]外键关系 --> <!--输出实体[DA_CHART]外键关系 -->
<!--输出实体[DA_METRIC]外键关系 --> <!--输出实体[DA_METRIC]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-da_metric-53-17"> <changeSet author="root" id="fk-da_metric-56-17">
<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"/> <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> </changeSet>
<!--输出实体[DA_REPORT]外键关系 --> <!--输出实体[DA_REPORT]外键关系 -->
...@@ -465,7 +465,7 @@ ...@@ -465,7 +465,7 @@
<!--输出实体[DST_SYSTEM]外键关系 --> <!--输出实体[DST_SYSTEM]外键关系 -->
<!--输出实体[RU_EXECLOG]外键关系 --> <!--输出实体[RU_EXECLOG]外键关系 -->
<!--输出实体[RU_EXECRESULT]外键关系 --> <!--输出实体[RU_EXECRESULT]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-ru_execresult-43-18"> <changeSet author="root" id="fk-ru_execresult-43-18">
<addForeignKeyConstraint baseColumnNames="RULEID" baseTableName="IBZRULERESULT" constraintName="DER1N_RU_EXECRESULT_RU_ITEM_RU" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="RULEID" referencedTableName="IBZRULE" validate="true"/> <addForeignKeyConstraint baseColumnNames="RULEID" baseTableName="IBZRULERESULT" constraintName="DER1N_RU_EXECRESULT_RU_ITEM_RU" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="RULEID" referencedTableName="IBZRULE" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[META_DATASET]外键关系 --> <!--输出实体[META_DATASET]外键关系 -->
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"delogicname":"指标", "delogicname":"指标",
"sysmoudle":{"id":"ANALYSIS","name":"analysis"}, "sysmoudle":{"id":"ANALYSIS","name":"analysis"},
"dedataset":[{"id":"Default" , "name":"数据集"}], "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" }], "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" }],
"datascope":[{"id":"all","name":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
......
...@@ -136,6 +136,17 @@ public class DAMetricResource { ...@@ -136,6 +136,17 @@ public class DAMetricResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-SyncRule-all')")
@ApiOperation(value = "同步指标到规则", tags = {"指标" }, notes = "同步指标到规则")
@RequestMapping(method = RequestMethod.POST, value = "/dametrics/{dametric_id}/syncrule")
public ResponseEntity<DAMetricDTO> syncRule(@PathVariable("dametric_id") String dametric_id, @RequestBody DAMetricDTO dametricdto) {
DAMetric domain = dametricMapping.toDomain(dametricdto);
domain.setMetricId(dametric_id);
domain = dametricService.syncRule(domain);
dametricdto = dametricMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dametricdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"指标" } ,notes = "获取数据集") @ApiOperation(value = "获取数据集", tags = {"指标" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/dametrics/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/dametrics/fetchdefault")
...@@ -266,6 +277,17 @@ public class DAMetricResource { ...@@ -266,6 +277,17 @@ public class DAMetricResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-SyncRule-all')")
@ApiOperation(value = "根据分析指标", tags = {"指标" }, notes = "根据分析指标")
@RequestMapping(method = RequestMethod.POST, value = "/dabuilds/{dabuild_id}/dametrics/{dametric_id}/syncrule")
public ResponseEntity<DAMetricDTO> syncRuleByDABuild(@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.syncRule(domain) ;
dametricdto = dametricMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dametricdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-DAMetric-searchDefault-all')")
@ApiOperation(value = "根据分析获取数据集", tags = {"指标" } ,notes = "根据分析获取数据集") @ApiOperation(value = "根据分析获取数据集", tags = {"指标" } ,notes = "根据分析获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/dabuilds/{dabuild_id}/dametrics/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/dabuilds/{dabuild_id}/dametrics/fetchdefault")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册