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

ibiz4j 发布系统代码

上级 879665d4
......@@ -8,7 +8,7 @@
<!--输出实体[DST_COMPONENT]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-dst_component-21-1">
<changeSet author="a_A_5d9d78509" id="tab-dst_component-24-1">
<createTable tableName="IBZCOMPONENT">
<column name="CID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DST_COMPONENT_CID"/>
......@@ -30,7 +30,7 @@
<!--输出实体[DST_CONFIG]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-dst_config-14-2">
<changeSet author="a_A_5d9d78509" id="tab-dst_config-19-2">
<createTable tableName="IBZCFG">
<column name="CFGID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DST_CONFIG_CFGID"/>
......@@ -52,7 +52,7 @@
<!--输出实体[DST_DATASOURCE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-dst_datasource-11-3">
<changeSet author="a_A_5d9d78509" id="tab-dst_datasource-17-3">
<createTable tableName="IBZDATASOURCE">
<column name="DSID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DST_DATASOURCE_DSID"/>
......@@ -70,7 +70,7 @@
<!--输出实体[DST_ROUTER]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-dst_router-17-4">
<changeSet author="a_A_5d9d78509" id="tab-dst_router-22-4">
<createTable tableName="IBZROUTER">
<column name="ROUTERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DST_ROUTER_ROUTERID"/>
......@@ -114,7 +114,7 @@
<!--输出实体[DST_VIEW]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-dst_view-15-6">
<changeSet author="a_A_5d9d78509" id="tab-dst_view-20-6">
<createTable tableName="IBZVIEW">
<column name="VIEWID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_DST_VIEW_VIEWID"/>
......@@ -134,7 +134,7 @@
<!--输出实体[META_DATASET]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_dataset-18-7">
<changeSet author="a_A_5d9d78509" id="tab-meta_dataset-24-7">
<createTable tableName="IBZDATASET">
<column name="DATASETID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_DATASET_DATASETID"/>
......@@ -156,7 +156,7 @@
<!--输出实体[META_ENTITY]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_entity-45-8">
<changeSet author="a_A_5d9d78509" id="tab-meta_entity-51-8">
<createTable tableName="IBZENTITY">
<column name="ENTITYID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_ENTITY_ENTITYID"/>
......@@ -178,7 +178,7 @@
<!--输出实体[META_FIELD]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_field-98-9">
<changeSet author="a_A_5d9d78509" id="tab-meta_field-105-9">
<createTable tableName="IBZFIELD">
<column name="FIELDID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_FIELD_FIELDID"/>
......@@ -226,7 +226,7 @@
<!--输出实体[META_MODEL]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_model-7-10">
<changeSet author="a_A_5d9d78509" id="tab-meta_model-10-10">
<createTable tableName="IBZMODEL">
<column name="MODELID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_MODEL_MODELID"/>
......@@ -242,7 +242,7 @@
<!--输出实体[META_MODULE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_module-8-11">
<changeSet author="a_A_5d9d78509" id="tab-meta_module-11-11">
<createTable tableName="IBZMODULE">
<column name="MODULEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_MODULE_MODULEID"/>
......@@ -258,7 +258,7 @@
<!--输出实体[META_RELATION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_relation-45-12">
<changeSet author="a_A_5d9d78509" id="tab-meta_relation-52-12">
<createTable tableName="IBZRELATION">
<column name="RELATIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_RELATION_RELATIONID"/>
......@@ -292,13 +292,13 @@
<!--输出实体[DST_VIEW]外键关系 -->
<!--输出实体[META_DATASET]外键关系 -->
<!--输出实体[META_ENTITY]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-meta_entity-45-13">
<changeSet author="a_A_5d9d78509" id="fk-meta_entity-51-13">
<addForeignKeyConstraint baseColumnNames="DSID" baseTableName="IBZENTITY" constraintName="DER1N_META_ENTITY_DST_DATASOUR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="DSID" referencedTableName="IBZDATASOURCE" validate="true"/>
</changeSet>
<!--输出实体[META_FIELD]外键关系 -->
<!--输出实体[META_MODEL]外键关系 -->
<!--输出实体[META_MODULE]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-meta_module-8-14">
<changeSet author="a_A_5d9d78509" id="fk-meta_module-11-14">
<addForeignKeyConstraint baseColumnNames="SYSTEMID" baseTableName="IBZMODULE" constraintName="DER1N_META_MODULE_DST_SYSTEM_S" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PSSYSTEMID" referencedTableName="IBZPSSYSTEM" validate="true"/>
</changeSet>
<!--输出实体[META_RELATION]外键关系 -->
......
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[DstAPIDTO]
*/
@Data
public class DstAPIDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [APIID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String id;
/**
* 属性 [APPNAME]
*
*/
@JSONField(name = "name")
@JsonProperty("name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String name;
/**
* 属性 [APPPATH]
*
*/
@JSONField(name = "path")
@JsonProperty("path")
@Size(min = 0, max = 2000, message = "内容长度必须小于等于[2000]")
private String path;
/**
* 属性 [SYSTEMID]
*
*/
@JSONField(name = "system_id")
@JsonProperty("system_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String systemId;
/**
* 属性 [MSID]
*
*/
@JSONField(name = "ms_id")
@JsonProperty("ms_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String msId;
/**
* 属性 [MSNAME]
*
*/
@JSONField(name = "ms_name")
@JsonProperty("ms_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String msName;
/**
* 属性 [SERVICENAME]
*
*/
@JSONField(name = "service_name")
@JsonProperty("service_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String serviceName;
/**
* 设置 [APPNAME]
*/
public void setName(String name){
this.name = name ;
this.modify("appname",name);
}
/**
* 设置 [APPPATH]
*/
public void setPath(String path){
this.path = path ;
this.modify("apppath",path);
}
/**
* 设置 [SYSTEMID]
*/
public void setSystemId(String systemId){
this.systemId = systemId ;
this.modify("systemid",systemId);
}
/**
* 设置 [MSID]
*/
public void setMsId(String msId){
this.msId = msId ;
this.modify("msid",msId);
}
/**
* 设置 [MSNAME]
*/
public void setMsName(String msName){
this.msName = msName ;
this.modify("msname",msName);
}
/**
* 设置 [SERVICENAME]
*/
public void setServiceName(String serviceName){
this.serviceName = serviceName ;
this.modify("servicename",serviceName);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[DstAppDTO]
*/
@Data
public class DstAppDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [APPID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String id;
/**
* 属性 [APPNAME]
*
*/
@JSONField(name = "label")
@JsonProperty("label")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String label;
/**
* 属性 [PSSYSTEMID]
*
*/
@JSONField(name = "pssystemid")
@JsonProperty("pssystemid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String pssystemid;
/**
* 属性 [FULLNAME]
*
*/
@JSONField(name = "fullname")
@JsonProperty("fullname")
@Size(min = 0, max = 200, message = "内容长度必须小于等于[200]")
private String fullname;
/**
* 属性 [APPTYPE]
*
*/
@JSONField(name = "type")
@JsonProperty("type")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String type;
/**
* 属性 [APPGROUP]
*
*/
@JSONField(name = "group")
@JsonProperty("group")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String group;
/**
* 属性 [ICON]
*
*/
@JSONField(name = "icon")
@JsonProperty("icon")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String icon;
/**
* 属性 [VISABLED]
*
*/
@JSONField(name = "visabled")
@JsonProperty("visabled")
private Integer visabled;
/**
* 属性 [ADDR]
*
*/
@JSONField(name = "addr")
@JsonProperty("addr")
@Size(min = 0, max = 300, message = "内容长度必须小于等于[300]")
private String addr;
/**
* 设置 [APPNAME]
*/
public void setLabel(String label){
this.label = label ;
this.modify("appname",label);
}
/**
* 设置 [PSSYSTEMID]
*/
public void setPssystemid(String pssystemid){
this.pssystemid = pssystemid ;
this.modify("pssystemid",pssystemid);
}
/**
* 设置 [FULLNAME]
*/
public void setFullname(String fullname){
this.fullname = fullname ;
this.modify("fullname",fullname);
}
/**
* 设置 [APPTYPE]
*/
public void setType(String type){
this.type = type ;
this.modify("apptype",type);
}
/**
* 设置 [APPGROUP]
*/
public void setGroup(String group){
this.group = group ;
this.modify("appgroup",group);
}
/**
* 设置 [ICON]
*/
public void setIcon(String icon){
this.icon = icon ;
this.modify("icon",icon);
}
/**
* 设置 [VISABLED]
*/
public void setVisabled(Integer visabled){
this.visabled = visabled ;
this.modify("visabled",visabled);
}
/**
* 设置 [ADDR]
*/
public void setAddr(String addr){
this.addr = addr ;
this.modify("addr",addr);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[DstComponentDTO]
*/
@Data
public class DstComponentDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [CID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String id;
/**
* 属性 [CNAME]
*
*/
@JSONField(name = "name")
@JsonProperty("name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String name;
/**
* 属性 [CODENAME]
*
*/
@JSONField(name = "code_name")
@JsonProperty("code_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String codeName;
/**
* 属性 [SYSTEMID]
*
*/
@JSONField(name = "system_id")
@JsonProperty("system_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String systemId;
/**
* 属性 [APPID]
*
*/
@JSONField(name = "app_id")
@JsonProperty("app_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String appId;
/**
* 属性 [CTYPE]
*
*/
@JSONField(name = "type")
@JsonProperty("type")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String type;
/**
* 属性 [CFG]
*
*/
@JSONField(name = "config")
@JsonProperty("config")
@Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]")
private String config;
/**
* 设置 [CNAME]
*/
public void setName(String name){
this.name = name ;
this.modify("cname",name);
}
/**
* 设置 [CODENAME]
*/
public void setCodeName(String codeName){
this.codeName = codeName ;
this.modify("codename",codeName);
}
/**
* 设置 [SYSTEMID]
*/
public void setSystemId(String systemId){
this.systemId = systemId ;
this.modify("systemid",systemId);
}
/**
* 设置 [APPID]
*/
public void setAppId(String appId){
this.appId = appId ;
this.modify("appid",appId);
}
/**
* 设置 [CTYPE]
*/
public void setType(String type){
this.type = type ;
this.modify("ctype",type);
}
/**
* 设置 [CFG]
*/
public void setConfig(String config){
this.config = config ;
this.modify("cfg",config);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[DstConfigDTO]
*/
@Data
public class DstConfigDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [CFGID]
*
*/
@JSONField(name = "cfg_id")
@JsonProperty("cfg_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String cfgId;
/**
* 属性 [SYSTEMID]
*
*/
@JSONField(name = "system_id")
@JsonProperty("system_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String systemId;
/**
* 属性 [CFGTYPE]
*
*/
@JSONField(name = "cfg_type")
@JsonProperty("cfg_type")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String cfgType;
/**
* 属性 [TARGETTYPE]
*
*/
@JSONField(name = "target_type")
@JsonProperty("target_type")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String targetType;
/**
* 属性 [USERID]
*
*/
@JSONField(name = "user_id")
@JsonProperty("user_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String userId;
/**
* 属性 [CFG]
*
*/
@JSONField(name = "cfg")
@JsonProperty("cfg")
@Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]")
private String cfg;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "update_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("update_date")
private Timestamp updateDate;
/**
* 设置 [SYSTEMID]
*/
public void setSystemId(String systemId){
this.systemId = systemId ;
this.modify("systemid",systemId);
}
/**
* 设置 [CFGTYPE]
*/
public void setCfgType(String cfgType){
this.cfgType = cfgType ;
this.modify("cfgtype",cfgType);
}
/**
* 设置 [TARGETTYPE]
*/
public void setTargetType(String targetType){
this.targetType = targetType ;
this.modify("targettype",targetType);
}
/**
* 设置 [CFG]
*/
public void setCfg(String cfg){
this.cfg = cfg ;
this.modify("cfg",cfg);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[DstDataSourceDTO]
*/
@Data
public class DstDataSourceDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [DSID]
*
*/
@JSONField(name = "ds_id")
@JsonProperty("ds_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String dsId;
/**
* 属性 [DSNAME]
*
*/
@JSONField(name = "ds_name")
@JsonProperty("ds_name")
@NotBlank(message = "[数据源名称]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String dsName;
/**
* 属性 [DSTYPE]
*
*/
@JSONField(name = "ds_type")
@JsonProperty("ds_type")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String dsType;
/**
* 属性 [DSCFG]
*
*/
@JSONField(name = "ds_cfg")
@JsonProperty("ds_cfg")
@Size(min = 0, max = 4000, message = "内容长度必须小于等于[4000]")
private String dsCfg;
/**
* 设置 [DSNAME]
*/
public void setDsName(String dsName){
this.dsName = dsName ;
this.modify("dsname",dsName);
}
/**
* 设置 [DSTYPE]
*/
public void setDsType(String dsType){
this.dsType = dsType ;
this.modify("dstype",dsType);
}
/**
* 设置 [DSCFG]
*/
public void setDsCfg(String dsCfg){
this.dsCfg = dsCfg ;
this.modify("dscfg",dsCfg);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[DstMicroserviceDTO]
*/
@Data
public class DstMicroserviceDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [MSID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String id;
/**
* 属性 [MSNAME]
*
*/
@JSONField(name = "label")
@JsonProperty("label")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String label;
/**
* 属性 [SERVICENAME]
*
*/
@JSONField(name = "servicename")
@JsonProperty("servicename")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String servicename;
/**
* 属性 [SYSTEMID]
*
*/
@JSONField(name = "pssystemid")
@JsonProperty("pssystemid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String pssystemid;
/**
* 属性 [ADDR]
*
*/
@JSONField(name = "addr")
@JsonProperty("addr")
@Size(min = 0, max = 300, message = "内容长度必须小于等于[300]")
private String addr;
/**
* 设置 [MSNAME]
*/
public void setLabel(String label){
this.label = label ;
this.modify("msname",label);
}
/**
* 设置 [SERVICENAME]
*/
public void setServicename(String servicename){
this.servicename = servicename ;
this.modify("servicename",servicename);
}
/**
* 设置 [SYSTEMID]
*/
public void setPssystemid(String pssystemid){
this.pssystemid = pssystemid ;
this.modify("systemid",pssystemid);
}
/**
* 设置 [ADDR]
*/
public void setAddr(String addr){
this.addr = addr ;
this.modify("addr",addr);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[DstRouterDTO]
*/
@Data
public class DstRouterDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [ROUTERID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String id;
/**
* 属性 [ROUTERNAME]
*
*/
@JSONField(name = "name")
@JsonProperty("name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String name;
/**
* 属性 [SYSTEMID]
*
*/
@JSONField(name = "system_id")
@JsonProperty("system_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String systemId;
/**
* 属性 [APPID]
*
*/
@JSONField(name = "app_id")
@JsonProperty("app_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String appId;
/**
* 属性 [ROUTERPATH]
*
*/
@JSONField(name = "path")
@JsonProperty("path")
@Size(min = 0, max = 255, message = "内容长度必须小于等于[255]")
private String path;
/**
* 属性 [PARENTID]
*
*/
@JSONField(name = "parentid")
@JsonProperty("parentid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String parentid;
/**
* 属性 [META]
*
*/
@JSONField(name = "meta")
@JsonProperty("meta")
@Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]")
private String meta;
/**
* 属性 [COMPONENT]
*
*/
@JSONField(name = "component")
@JsonProperty("component")
@Size(min = 0, max = 2000, message = "内容长度必须小于等于[2000]")
private String component;
/**
* 设置 [ROUTERNAME]
*/
public void setName(String name){
this.name = name ;
this.modify("routername",name);
}
/**
* 设置 [SYSTEMID]
*/
public void setSystemId(String systemId){
this.systemId = systemId ;
this.modify("systemid",systemId);
}
/**
* 设置 [APPID]
*/
public void setAppId(String appId){
this.appId = appId ;
this.modify("appid",appId);
}
/**
* 设置 [ROUTERPATH]
*/
public void setPath(String path){
this.path = path ;
this.modify("routerpath",path);
}
/**
* 设置 [PARENTID]
*/
public void setParentid(String parentid){
this.parentid = parentid ;
this.modify("parentid",parentid);
}
/**
* 设置 [META]
*/
public void setMeta(String meta){
this.meta = meta ;
this.modify("meta",meta);
}
/**
* 设置 [COMPONENT]
*/
public void setComponent(String component){
this.component = component ;
this.modify("component",component);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[DstViewDTO]
*/
@Data
public class DstViewDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [VIEWID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String id;
/**
* 属性 [VIEWNAME]
*
*/
@JSONField(name = "name")
@JsonProperty("name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String name;
/**
* 属性 [VIEWPATH]
*
*/
@JSONField(name = "path")
@JsonProperty("path")
@Size(min = 0, max = 255, message = "内容长度必须小于等于[255]")
private String path;
/**
* 属性 [SYSTEMID]
*
*/
@JSONField(name = "system_id")
@JsonProperty("system_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String systemId;
/**
* 属性 [APPID]
*
*/
@JSONField(name = "app_id")
@JsonProperty("app_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String appId;
/**
* 属性 [CFG]
*
*/
@JSONField(name = "config")
@JsonProperty("config")
@Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]")
private String config;
/**
* 设置 [VIEWNAME]
*/
public void setName(String name){
this.name = name ;
this.modify("viewname",name);
}
/**
* 设置 [VIEWPATH]
*/
public void setPath(String path){
this.path = path ;
this.modify("viewpath",path);
}
/**
* 设置 [SYSTEMID]
*/
public void setSystemId(String systemId){
this.systemId = systemId ;
this.modify("systemid",systemId);
}
/**
* 设置 [APPID]
*/
public void setAppId(String appId){
this.appId = appId ;
this.modify("appid",appId);
}
/**
* 设置 [CFG]
*/
public void setConfig(String config){
this.config = config ;
this.modify("cfg",config);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[MetaDataSetDTO]
*/
@Data
public class MetaDataSetDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [DATASETID]
*
*/
@JSONField(name = "dataset_id")
@JsonProperty("dataset_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String datasetId;
/**
* 属性 [DATASETNAME]
*
*/
@JSONField(name = "dataset_name")
@JsonProperty("dataset_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String datasetName;
/**
* 属性 [ENTITYID]
*
*/
@JSONField(name = "entity_id")
@JsonProperty("entity_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String entityId;
/**
* 属性 [ENTITYNAME]
*
*/
@JSONField(name = "entity_name")
@JsonProperty("entity_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String entityName;
/**
* 属性 [CODENAME]
*
*/
@JSONField(name = "code_name")
@JsonProperty("code_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String codeName;
/**
* 属性 [DSCODE]
*
*/
@JSONField(name = "ds_code")
@JsonProperty("ds_code")
@Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]")
private String dsCode;
/**
* 属性 [DSMODEL]
*
*/
@JSONField(name = "ds_model")
@JsonProperty("ds_model")
@Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]")
private String dsModel;
/**
* 设置 [DATASETNAME]
*/
public void setDatasetName(String datasetName){
this.datasetName = datasetName ;
this.modify("datasetname",datasetName);
}
/**
* 设置 [ENTITYID]
*/
public void setEntityId(String entityId){
this.entityId = entityId ;
this.modify("entityid",entityId);
}
/**
* 设置 [ENTITYNAME]
*/
public void setEntityName(String entityName){
this.entityName = entityName ;
this.modify("entityname",entityName);
}
/**
* 设置 [CODENAME]
*/
public void setCodeName(String codeName){
this.codeName = codeName ;
this.modify("codename",codeName);
}
/**
* 设置 [DSCODE]
*/
public void setDsCode(String dsCode){
this.dsCode = dsCode ;
this.modify("dscode",dsCode);
}
/**
* 设置 [DSMODEL]
*/
public void setDsModel(String dsModel){
this.dsModel = dsModel ;
this.modify("dsmodel",dsModel);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[MetaFieldDTO]
*/
@Data
public class MetaFieldDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [FIELDID]
*
*/
@JSONField(name = "field_id")
@JsonProperty("field_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String fieldId;
/**
* 属性 [FIELDNAME]
*
*/
@JSONField(name = "field_name")
@JsonProperty("field_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String fieldName;
/**
* 属性 [CODENAME]
*
*/
@JSONField(name = "code_name")
@JsonProperty("code_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String codeName;
/**
* 属性 [ENTITYID]
*
*/
@JSONField(name = "entity_id")
@JsonProperty("entity_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String entityId;
/**
* 属性 [ENTITYNAME]
*
*/
@JSONField(name = "entity_name")
@JsonProperty("entity_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String entityName;
/**
* 属性 [ENTITYCODENAME]
*
*/
@JSONField(name = "entity_code_name")
@JsonProperty("entity_code_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String entityCodeName;
/**
* 属性 [FIELDLOGICNAME]
*
*/
@JSONField(name = "field_logic_name")
@JsonProperty("field_logic_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String fieldLogicName;
/**
* 属性 [FIELDUNINAME]
*
*/
@JSONField(name = "field_uni_name")
@JsonProperty("field_uni_name")
@Size(min = 0, max = 200, message = "内容长度必须小于等于[200]")
private String fieldUniName;
/**
* 属性 [FIELDSHOWNAME]
*
*/
@JSONField(name = "field_show_name")
@JsonProperty("field_show_name")
@Size(min = 0, max = 200, message = "内容长度必须小于等于[200]")
private String fieldShowName;
/**
* 属性 [REFFIELDID]
*
*/
@JSONField(name = "ref_field_id")
@JsonProperty("ref_field_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String refFieldId;
/**
* 属性 [REFFIELDNAME]
*
*/
@JSONField(name = "ref_field_name")
@JsonProperty("ref_field_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String refFieldName;
/**
* 属性 [RELATIONID]
*
*/
@JSONField(name = "relation_id")
@JsonProperty("relation_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String relationId;
/**
* 属性 [RELATIONNAME]
*
*/
@JSONField(name = "relation_name")
@JsonProperty("relation_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String relationName;
/**
* 属性 [REFENTITYNAME]
*
*/
@JSONField(name = "ref_entity_name")
@JsonProperty("ref_entity_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String refEntityName;
/**
* 属性 [RELATIONCODENAME]
*
*/
@JSONField(name = "relation_code_name")
@JsonProperty("relation_code_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String relationCodeName;
/**
* 属性 [FIELDTYPE]
*
*/
@JSONField(name = "field_type")
@JsonProperty("field_type")
@Size(min = 0, max = 70, message = "内容长度必须小于等于[70]")
private String fieldType;
/**
* 属性 [DICT]
*
*/
@JSONField(name = "dict")
@JsonProperty("dict")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String dict;
/**
* 属性 [NULLABLE]
*
*/
@JSONField(name = "nullable")
@JsonProperty("nullable")
private Integer nullable;
/**
* 属性 [PHYSICALFIELD]
*
*/
@JSONField(name = "physical_field")
@JsonProperty("physical_field")
private Integer physicalField;
/**
* 属性 [DATATYPE]
*
*/
@JSONField(name = "data_type")
@JsonProperty("data_type")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String dataType;
/**
* 属性 [DATALENGTH]
*
*/
@JSONField(name = "data_length")
@JsonProperty("data_length")
private Integer dataLength;
/**
* 属性 [DATAPRECI]
*
*/
@JSONField(name = "data_preci")
@JsonProperty("data_preci")
private Integer dataPreci;
/**
* 属性 [EXPRESSION]
*
*/
@JSONField(name = "expression")
@JsonProperty("expression")
@Size(min = 0, max = 2000, message = "内容长度必须小于等于[2000]")
private String expression;
/**
* 属性 [EXTENSIONFIELD]
*
*/
@JSONField(name = "extension_field")
@JsonProperty("extension_field")
private Integer extensionField;
/**
* 属性 [SHOWORDER]
*
*/
@JSONField(name = "show_order")
@JsonProperty("show_order")
private Integer showOrder;
/**
* 设置 [FIELDNAME]
*/
public void setFieldName(String fieldName){
this.fieldName = fieldName ;
this.modify("fieldname",fieldName);
}
/**
* 设置 [CODENAME]
*/
public void setCodeName(String codeName){
this.codeName = codeName ;
this.modify("codename",codeName);
}
/**
* 设置 [ENTITYID]
*/
public void setEntityId(String entityId){
this.entityId = entityId ;
this.modify("entityid",entityId);
}
/**
* 设置 [ENTITYNAME]
*/
public void setEntityName(String entityName){
this.entityName = entityName ;
this.modify("entityname",entityName);
}
/**
* 设置 [FIELDLOGICNAME]
*/
public void setFieldLogicName(String fieldLogicName){
this.fieldLogicName = fieldLogicName ;
this.modify("fieldlogicname",fieldLogicName);
}
/**
* 设置 [REFFIELDID]
*/
public void setRefFieldId(String refFieldId){
this.refFieldId = refFieldId ;
this.modify("reffieldid",refFieldId);
}
/**
* 设置 [REFFIELDNAME]
*/
public void setRefFieldName(String refFieldName){
this.refFieldName = refFieldName ;
this.modify("reffieldname",refFieldName);
}
/**
* 设置 [RELATIONID]
*/
public void setRelationId(String relationId){
this.relationId = relationId ;
this.modify("relationid",relationId);
}
/**
* 设置 [RELATIONNAME]
*/
public void setRelationName(String relationName){
this.relationName = relationName ;
this.modify("relationname",relationName);
}
/**
* 设置 [FIELDTYPE]
*/
public void setFieldType(String fieldType){
this.fieldType = fieldType ;
this.modify("fieldtype",fieldType);
}
/**
* 设置 [DICT]
*/
public void setDict(String dict){
this.dict = dict ;
this.modify("dict",dict);
}
/**
* 设置 [NULLABLE]
*/
public void setNullable(Integer nullable){
this.nullable = nullable ;
this.modify("nullable",nullable);
}
/**
* 设置 [PHYSICALFIELD]
*/
public void setPhysicalField(Integer physicalField){
this.physicalField = physicalField ;
this.modify("physicalfield",physicalField);
}
/**
* 设置 [DATATYPE]
*/
public void setDataType(String dataType){
this.dataType = dataType ;
this.modify("datatype",dataType);
}
/**
* 设置 [DATALENGTH]
*/
public void setDataLength(Integer dataLength){
this.dataLength = dataLength ;
this.modify("datalength",dataLength);
}
/**
* 设置 [DATAPRECI]
*/
public void setDataPreci(Integer dataPreci){
this.dataPreci = dataPreci ;
this.modify("datapreci",dataPreci);
}
/**
* 设置 [EXPRESSION]
*/
public void setExpression(String expression){
this.expression = expression ;
this.modify("expression",expression);
}
/**
* 设置 [EXTENSIONFIELD]
*/
public void setExtensionField(Integer extensionField){
this.extensionField = extensionField ;
this.modify("extensionfield",extensionField);
}
/**
* 设置 [SHOWORDER]
*/
public void setShowOrder(Integer showOrder){
this.showOrder = showOrder ;
this.modify("showorder",showOrder);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[MetaModelDTO]
*/
@Data
public class MetaModelDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [MODELID]
*
*/
@JSONField(name = "model_id")
@JsonProperty("model_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String modelId;
/**
* 属性 [MODELNAME]
*
*/
@JSONField(name = "model_name")
@JsonProperty("model_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String modelName;
/**
* 属性 [CODENAME]
*
*/
@JSONField(name = "code_name")
@JsonProperty("code_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String codeName;
/**
* 属性 [MODELCFG]
*
*/
@JSONField(name = "config")
@JsonProperty("config")
@Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]")
private String config;
/**
* 设置 [MODELNAME]
*/
public void setModelName(String modelName){
this.modelName = modelName ;
this.modify("modelname",modelName);
}
/**
* 设置 [CODENAME]
*/
public void setCodeName(String codeName){
this.codeName = codeName ;
this.modify("codename",codeName);
}
/**
* 设置 [MODELCFG]
*/
public void setConfig(String config){
this.config = config ;
this.modify("modelcfg",config);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[MetaModuleDTO]
*/
@Data
public class MetaModuleDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [MODULEID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String id;
/**
* 属性 [MODULENAME]
*
*/
@JSONField(name = "name")
@JsonProperty("name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String name;
/**
* 属性 [CODENAME]
*
*/
@JSONField(name = "code_name")
@JsonProperty("code_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String codeName;
/**
* 属性 [SYSTEMID]
*
*/
@JSONField(name = "system_id")
@JsonProperty("system_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String systemId;
/**
* 设置 [MODULENAME]
*/
public void setName(String name){
this.name = name ;
this.modify("modulename",name);
}
/**
* 设置 [CODENAME]
*/
public void setCodeName(String codeName){
this.codeName = codeName ;
this.modify("codename",codeName);
}
/**
* 设置 [SYSTEMID]
*/
public void setSystemId(String systemId){
this.systemId = systemId ;
this.modify("systemid",systemId);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[MetaRelationshipDTO]
*/
@Data
public class MetaRelationshipDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [RELATIONID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String id;
/**
* 属性 [RELATIONNAME]
*
*/
@JSONField(name = "name")
@JsonProperty("name")
@NotBlank(message = "[关系名称]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String name;
/**
* 属性 [RELTYPE]
*
*/
@JSONField(name = "relation_type")
@JsonProperty("relation_type")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String relationType;
/**
* 属性 [CODENAME]
*
*/
@JSONField(name = "code_name")
@JsonProperty("code_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String codeName;
/**
* 属性 [ENTITYID]
*
*/
@JSONField(name = "entity_id")
@JsonProperty("entity_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String entityId;
/**
* 属性 [ENTITYNAME]
*
*/
@JSONField(name = "entity_name")
@JsonProperty("entity_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String entityName;
/**
* 属性 [REFENTITYID]
*
*/
@JSONField(name = "ref_entity_id")
@JsonProperty("ref_entity_id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String refEntityId;
/**
* 属性 [REFENTITYNAME]
*
*/
@JSONField(name = "ref_entity_name")
@JsonProperty("ref_entity_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String refEntityName;
/**
* 属性 [NESTEDNAME]
*
*/
@JSONField(name = "nested_name")
@JsonProperty("nested_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String nestedName;
/**
* 属性 [LOOKUP]
*
*/
@JSONField(name = "lookup")
@JsonProperty("lookup")
@Size(min = 0, max = 1000, message = "内容长度必须小于等于[1000]")
private String lookup;
/**
* 设置 [RELATIONNAME]
*/
public void setName(String name){
this.name = name ;
this.modify("relationname",name);
}
/**
* 设置 [RELTYPE]
*/
public void setRelationType(String relationType){
this.relationType = relationType ;
this.modify("reltype",relationType);
}
/**
* 设置 [CODENAME]
*/
public void setCodeName(String codeName){
this.codeName = codeName ;
this.modify("codename",codeName);
}
/**
* 设置 [ENTITYID]
*/
public void setEntityId(String entityId){
this.entityId = entityId ;
this.modify("entityid",entityId);
}
/**
* 设置 [ENTITYNAME]
*/
public void setEntityName(String entityName){
this.entityName = entityName ;
this.modify("entityname",entityName);
}
/**
* 设置 [REFENTITYID]
*/
public void setRefEntityId(String refEntityId){
this.refEntityId = refEntityId ;
this.modify("refentityid",refEntityId);
}
/**
* 设置 [REFENTITYNAME]
*/
public void setRefEntityName(String refEntityName){
this.refEntityName = refEntityName ;
this.modify("refentityname",refEntityName);
}
/**
* 设置 [NESTEDNAME]
*/
public void setNestedName(String nestedName){
this.nestedName = nestedName ;
this.modify("nestedname",nestedName);
}
/**
* 设置 [LOOKUP]
*/
public void setLookup(String lookup){
this.lookup = lookup ;
this.modify("lookup",lookup);
}
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.DstAPI;
import cn.ibizlab.api.dto.DstAPIDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiDstAPIMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface DstAPIMapping extends MappingBase<DstAPIDTO, DstAPI> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.DstApp;
import cn.ibizlab.api.dto.DstAppDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiDstAppMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface DstAppMapping extends MappingBase<DstAppDTO, DstApp> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.DstComponent;
import cn.ibizlab.api.dto.DstComponentDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiDstComponentMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface DstComponentMapping extends MappingBase<DstComponentDTO, DstComponent> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.DstConfig;
import cn.ibizlab.api.dto.DstConfigDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiDstConfigMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface DstConfigMapping extends MappingBase<DstConfigDTO, DstConfig> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.DstDataSource;
import cn.ibizlab.api.dto.DstDataSourceDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiDstDataSourceMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface DstDataSourceMapping extends MappingBase<DstDataSourceDTO, DstDataSource> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.DstMicroservice;
import cn.ibizlab.api.dto.DstMicroserviceDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiDstMicroserviceMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface DstMicroserviceMapping extends MappingBase<DstMicroserviceDTO, DstMicroservice> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.DstRouter;
import cn.ibizlab.api.dto.DstRouterDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiDstRouterMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface DstRouterMapping extends MappingBase<DstRouterDTO, DstRouter> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.DstView;
import cn.ibizlab.api.dto.DstViewDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiDstViewMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface DstViewMapping extends MappingBase<DstViewDTO, DstView> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.MetaDataSet;
import cn.ibizlab.api.dto.MetaDataSetDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiMetaDataSetMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface MetaDataSetMapping extends MappingBase<MetaDataSetDTO, MetaDataSet> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.MetaField;
import cn.ibizlab.api.dto.MetaFieldDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiMetaFieldMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface MetaFieldMapping extends MappingBase<MetaFieldDTO, MetaField> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.MetaModel;
import cn.ibizlab.api.dto.MetaModelDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiMetaModelMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface MetaModelMapping extends MappingBase<MetaModelDTO, MetaModel> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.MetaModule;
import cn.ibizlab.api.dto.MetaModuleDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiMetaModuleMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface MetaModuleMapping extends MappingBase<MetaModuleDTO, MetaModule> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.lite.domain.MetaRelationship;
import cn.ibizlab.api.dto.MetaRelationshipDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="apiMetaRelationshipMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface MetaRelationshipMapping extends MappingBase<MetaRelationshipDTO, MetaRelationship> {
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.DstAPI;
import cn.ibizlab.core.lite.service.IDstAPIService;
import cn.ibizlab.core.lite.filter.DstAPISearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"接口" })
@RestController("api-dstapi")
@RequestMapping("")
public class DstAPIResource {
@Autowired
public IDstAPIService dstapiService;
@Autowired
@Lazy
public DstAPIMapping dstapiMapping;
@ApiOperation(value = "新建接口", tags = {"接口" }, notes = "新建接口")
@RequestMapping(method = RequestMethod.POST, value = "/dstapis")
public ResponseEntity<DstAPIDTO> create(@Validated @RequestBody DstAPIDTO dstapidto) {
DstAPI domain = dstapiMapping.toDomain(dstapidto);
dstapiService.create(domain);
DstAPIDTO dto = dstapiMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量新建接口", tags = {"接口" }, notes = "批量新建接口")
@RequestMapping(method = RequestMethod.POST, value = "/dstapis/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<DstAPIDTO> dstapidtos) {
dstapiService.createBatch(dstapiMapping.toDomain(dstapidtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "更新接口", tags = {"接口" }, notes = "更新接口")
@RequestMapping(method = RequestMethod.PUT, value = "/dstapis/{dstapi_id}")
public ResponseEntity<DstAPIDTO> update(@PathVariable("dstapi_id") String dstapi_id, @RequestBody DstAPIDTO dstapidto) {
DstAPI domain = dstapiMapping.toDomain(dstapidto);
domain .setId(dstapi_id);
dstapiService.update(domain );
DstAPIDTO dto = dstapiMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量更新接口", tags = {"接口" }, notes = "批量更新接口")
@RequestMapping(method = RequestMethod.PUT, value = "/dstapis/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<DstAPIDTO> dstapidtos) {
dstapiService.updateBatch(dstapiMapping.toDomain(dstapidtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "删除接口", tags = {"接口" }, notes = "删除接口")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstapis/{dstapi_id}")
public ResponseEntity<Boolean> remove(@PathVariable("dstapi_id") String dstapi_id) {
return ResponseEntity.status(HttpStatus.OK).body(dstapiService.remove(dstapi_id));
}
@ApiOperation(value = "批量删除接口", tags = {"接口" }, notes = "批量删除接口")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstapis/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
dstapiService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取接口", tags = {"接口" }, notes = "获取接口")
@RequestMapping(method = RequestMethod.GET, value = "/dstapis/{dstapi_id}")
public ResponseEntity<DstAPIDTO> get(@PathVariable("dstapi_id") String dstapi_id) {
DstAPI domain = dstapiService.get(dstapi_id);
DstAPIDTO dto = dstapiMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取接口草稿", tags = {"接口" }, notes = "获取接口草稿")
@RequestMapping(method = RequestMethod.GET, value = "/dstapis/getdraft")
public ResponseEntity<DstAPIDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(dstapiMapping.toDto(dstapiService.getDraft(new DstAPI())));
}
@ApiOperation(value = "检查接口", tags = {"接口" }, notes = "检查接口")
@RequestMapping(method = RequestMethod.POST, value = "/dstapis/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody DstAPIDTO dstapidto) {
return ResponseEntity.status(HttpStatus.OK).body(dstapiService.checkKey(dstapiMapping.toDomain(dstapidto)));
}
@ApiOperation(value = "保存接口", tags = {"接口" }, notes = "保存接口")
@RequestMapping(method = RequestMethod.POST, value = "/dstapis/save")
public ResponseEntity<Boolean> save(@RequestBody DstAPIDTO dstapidto) {
return ResponseEntity.status(HttpStatus.OK).body(dstapiService.save(dstapiMapping.toDomain(dstapidto)));
}
@ApiOperation(value = "批量保存接口", tags = {"接口" }, notes = "批量保存接口")
@RequestMapping(method = RequestMethod.POST, value = "/dstapis/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<DstAPIDTO> dstapidtos) {
dstapiService.saveBatch(dstapiMapping.toDomain(dstapidtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取数据集", tags = {"接口" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/dstapis/fetchdefault")
public ResponseEntity<List<DstAPIDTO>> fetchDefault(DstAPISearchContext context) {
Page<DstAPI> domains = dstapiService.searchDefault(context) ;
List<DstAPIDTO> list = dstapiMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@ApiOperation(value = "查询数据集", tags = {"接口" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/dstapis/searchdefault")
public ResponseEntity<Page<DstAPIDTO>> searchDefault(@RequestBody DstAPISearchContext context) {
Page<DstAPI> domains = dstapiService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(dstapiMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.DstApp;
import cn.ibizlab.core.lite.service.IDstAppService;
import cn.ibizlab.core.lite.filter.DstAppSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"应用" })
@RestController("api-dstapp")
@RequestMapping("")
public class DstAppResource {
@Autowired
public IDstAppService dstappService;
@Autowired
@Lazy
public DstAppMapping dstappMapping;
@ApiOperation(value = "新建应用", tags = {"应用" }, notes = "新建应用")
@RequestMapping(method = RequestMethod.POST, value = "/dstapps")
public ResponseEntity<DstAppDTO> create(@Validated @RequestBody DstAppDTO dstappdto) {
DstApp domain = dstappMapping.toDomain(dstappdto);
dstappService.create(domain);
DstAppDTO dto = dstappMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量新建应用", tags = {"应用" }, notes = "批量新建应用")
@RequestMapping(method = RequestMethod.POST, value = "/dstapps/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<DstAppDTO> dstappdtos) {
dstappService.createBatch(dstappMapping.toDomain(dstappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "更新应用", tags = {"应用" }, notes = "更新应用")
@RequestMapping(method = RequestMethod.PUT, value = "/dstapps/{dstapp_id}")
public ResponseEntity<DstAppDTO> update(@PathVariable("dstapp_id") String dstapp_id, @RequestBody DstAppDTO dstappdto) {
DstApp domain = dstappMapping.toDomain(dstappdto);
domain .setId(dstapp_id);
dstappService.update(domain );
DstAppDTO dto = dstappMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量更新应用", tags = {"应用" }, notes = "批量更新应用")
@RequestMapping(method = RequestMethod.PUT, value = "/dstapps/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<DstAppDTO> dstappdtos) {
dstappService.updateBatch(dstappMapping.toDomain(dstappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "删除应用", tags = {"应用" }, notes = "删除应用")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstapps/{dstapp_id}")
public ResponseEntity<Boolean> remove(@PathVariable("dstapp_id") String dstapp_id) {
return ResponseEntity.status(HttpStatus.OK).body(dstappService.remove(dstapp_id));
}
@ApiOperation(value = "批量删除应用", tags = {"应用" }, notes = "批量删除应用")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstapps/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
dstappService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取应用", tags = {"应用" }, notes = "获取应用")
@RequestMapping(method = RequestMethod.GET, value = "/dstapps/{dstapp_id}")
public ResponseEntity<DstAppDTO> get(@PathVariable("dstapp_id") String dstapp_id) {
DstApp domain = dstappService.get(dstapp_id);
DstAppDTO dto = dstappMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取应用草稿", tags = {"应用" }, notes = "获取应用草稿")
@RequestMapping(method = RequestMethod.GET, value = "/dstapps/getdraft")
public ResponseEntity<DstAppDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(dstappMapping.toDto(dstappService.getDraft(new DstApp())));
}
@ApiOperation(value = "检查应用", tags = {"应用" }, notes = "检查应用")
@RequestMapping(method = RequestMethod.POST, value = "/dstapps/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody DstAppDTO dstappdto) {
return ResponseEntity.status(HttpStatus.OK).body(dstappService.checkKey(dstappMapping.toDomain(dstappdto)));
}
@ApiOperation(value = "保存应用", tags = {"应用" }, notes = "保存应用")
@RequestMapping(method = RequestMethod.POST, value = "/dstapps/save")
public ResponseEntity<Boolean> save(@RequestBody DstAppDTO dstappdto) {
return ResponseEntity.status(HttpStatus.OK).body(dstappService.save(dstappMapping.toDomain(dstappdto)));
}
@ApiOperation(value = "批量保存应用", tags = {"应用" }, notes = "批量保存应用")
@RequestMapping(method = RequestMethod.POST, value = "/dstapps/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<DstAppDTO> dstappdtos) {
dstappService.saveBatch(dstappMapping.toDomain(dstappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取数据集", tags = {"应用" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/dstapps/fetchdefault")
public ResponseEntity<List<DstAppDTO>> fetchDefault(DstAppSearchContext context) {
Page<DstApp> domains = dstappService.searchDefault(context) ;
List<DstAppDTO> list = dstappMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@ApiOperation(value = "查询数据集", tags = {"应用" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/dstapps/searchdefault")
public ResponseEntity<Page<DstAppDTO>> searchDefault(@RequestBody DstAppSearchContext context) {
Page<DstApp> domains = dstappService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(dstappMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.DstComponent;
import cn.ibizlab.core.lite.service.IDstComponentService;
import cn.ibizlab.core.lite.filter.DstComponentSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"组件" })
@RestController("api-dstcomponent")
@RequestMapping("")
public class DstComponentResource {
@Autowired
public IDstComponentService dstcomponentService;
@Autowired
@Lazy
public DstComponentMapping dstcomponentMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-Create-all')")
@ApiOperation(value = "新建组件", tags = {"组件" }, notes = "新建组件")
@RequestMapping(method = RequestMethod.POST, value = "/dstcomponents")
public ResponseEntity<DstComponentDTO> create(@Validated @RequestBody DstComponentDTO dstcomponentdto) {
DstComponent domain = dstcomponentMapping.toDomain(dstcomponentdto);
dstcomponentService.create(domain);
DstComponentDTO dto = dstcomponentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-Create-all')")
@ApiOperation(value = "批量新建组件", tags = {"组件" }, notes = "批量新建组件")
@RequestMapping(method = RequestMethod.POST, value = "/dstcomponents/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<DstComponentDTO> dstcomponentdtos) {
dstcomponentService.createBatch(dstcomponentMapping.toDomain(dstcomponentdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-Update-all')")
@ApiOperation(value = "更新组件", tags = {"组件" }, notes = "更新组件")
@RequestMapping(method = RequestMethod.PUT, value = "/dstcomponents/{dstcomponent_id}")
public ResponseEntity<DstComponentDTO> update(@PathVariable("dstcomponent_id") String dstcomponent_id, @RequestBody DstComponentDTO dstcomponentdto) {
DstComponent domain = dstcomponentMapping.toDomain(dstcomponentdto);
domain .setId(dstcomponent_id);
dstcomponentService.update(domain );
DstComponentDTO dto = dstcomponentMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-Update-all')")
@ApiOperation(value = "批量更新组件", tags = {"组件" }, notes = "批量更新组件")
@RequestMapping(method = RequestMethod.PUT, value = "/dstcomponents/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<DstComponentDTO> dstcomponentdtos) {
dstcomponentService.updateBatch(dstcomponentMapping.toDomain(dstcomponentdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-Remove-all')")
@ApiOperation(value = "删除组件", tags = {"组件" }, notes = "删除组件")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstcomponents/{dstcomponent_id}")
public ResponseEntity<Boolean> remove(@PathVariable("dstcomponent_id") String dstcomponent_id) {
return ResponseEntity.status(HttpStatus.OK).body(dstcomponentService.remove(dstcomponent_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-Remove-all')")
@ApiOperation(value = "批量删除组件", tags = {"组件" }, notes = "批量删除组件")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstcomponents/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
dstcomponentService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-Get-all')")
@ApiOperation(value = "获取组件", tags = {"组件" }, notes = "获取组件")
@RequestMapping(method = RequestMethod.GET, value = "/dstcomponents/{dstcomponent_id}")
public ResponseEntity<DstComponentDTO> get(@PathVariable("dstcomponent_id") String dstcomponent_id) {
DstComponent domain = dstcomponentService.get(dstcomponent_id);
DstComponentDTO dto = dstcomponentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取组件草稿", tags = {"组件" }, notes = "获取组件草稿")
@RequestMapping(method = RequestMethod.GET, value = "/dstcomponents/getdraft")
public ResponseEntity<DstComponentDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(dstcomponentMapping.toDto(dstcomponentService.getDraft(new DstComponent())));
}
@ApiOperation(value = "检查组件", tags = {"组件" }, notes = "检查组件")
@RequestMapping(method = RequestMethod.POST, value = "/dstcomponents/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody DstComponentDTO dstcomponentdto) {
return ResponseEntity.status(HttpStatus.OK).body(dstcomponentService.checkKey(dstcomponentMapping.toDomain(dstcomponentdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-Save-all')")
@ApiOperation(value = "保存组件", tags = {"组件" }, notes = "保存组件")
@RequestMapping(method = RequestMethod.POST, value = "/dstcomponents/save")
public ResponseEntity<Boolean> save(@RequestBody DstComponentDTO dstcomponentdto) {
return ResponseEntity.status(HttpStatus.OK).body(dstcomponentService.save(dstcomponentMapping.toDomain(dstcomponentdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-Save-all')")
@ApiOperation(value = "批量保存组件", tags = {"组件" }, notes = "批量保存组件")
@RequestMapping(method = RequestMethod.POST, value = "/dstcomponents/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<DstComponentDTO> dstcomponentdtos) {
dstcomponentService.saveBatch(dstcomponentMapping.toDomain(dstcomponentdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"组件" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/dstcomponents/fetchdefault")
public ResponseEntity<List<DstComponentDTO>> fetchDefault(DstComponentSearchContext context) {
Page<DstComponent> domains = dstcomponentService.searchDefault(context) ;
List<DstComponentDTO> list = dstcomponentMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstComponent-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"组件" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/dstcomponents/searchdefault")
public ResponseEntity<Page<DstComponentDTO>> searchDefault(@RequestBody DstComponentSearchContext context) {
Page<DstComponent> domains = dstcomponentService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(dstcomponentMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.DstConfig;
import cn.ibizlab.core.lite.service.IDstConfigService;
import cn.ibizlab.core.lite.filter.DstConfigSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"配置" })
@RestController("api-dstconfig")
@RequestMapping("")
public class DstConfigResource {
@Autowired
public IDstConfigService dstconfigService;
@Autowired
@Lazy
public DstConfigMapping dstconfigMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Create-all')")
@ApiOperation(value = "新建配置", tags = {"配置" }, notes = "新建配置")
@RequestMapping(method = RequestMethod.POST, value = "/dstconfigs")
public ResponseEntity<DstConfigDTO> create(@Validated @RequestBody DstConfigDTO dstconfigdto) {
DstConfig domain = dstconfigMapping.toDomain(dstconfigdto);
dstconfigService.create(domain);
DstConfigDTO dto = dstconfigMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Create-all')")
@ApiOperation(value = "批量新建配置", tags = {"配置" }, notes = "批量新建配置")
@RequestMapping(method = RequestMethod.POST, value = "/dstconfigs/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<DstConfigDTO> dstconfigdtos) {
dstconfigService.createBatch(dstconfigMapping.toDomain(dstconfigdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "dstconfig" , versionfield = "updateDate")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Update-all')")
@ApiOperation(value = "更新配置", tags = {"配置" }, notes = "更新配置")
@RequestMapping(method = RequestMethod.PUT, value = "/dstconfigs/{dstconfig_id}")
public ResponseEntity<DstConfigDTO> update(@PathVariable("dstconfig_id") String dstconfig_id, @RequestBody DstConfigDTO dstconfigdto) {
DstConfig domain = dstconfigMapping.toDomain(dstconfigdto);
domain .setCfgId(dstconfig_id);
dstconfigService.update(domain );
DstConfigDTO dto = dstconfigMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Update-all')")
@ApiOperation(value = "批量更新配置", tags = {"配置" }, notes = "批量更新配置")
@RequestMapping(method = RequestMethod.PUT, value = "/dstconfigs/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<DstConfigDTO> dstconfigdtos) {
dstconfigService.updateBatch(dstconfigMapping.toDomain(dstconfigdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Remove-all')")
@ApiOperation(value = "删除配置", tags = {"配置" }, notes = "删除配置")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstconfigs/{dstconfig_id}")
public ResponseEntity<Boolean> remove(@PathVariable("dstconfig_id") String dstconfig_id) {
return ResponseEntity.status(HttpStatus.OK).body(dstconfigService.remove(dstconfig_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Remove-all')")
@ApiOperation(value = "批量删除配置", tags = {"配置" }, notes = "批量删除配置")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstconfigs/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
dstconfigService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Get-all')")
@ApiOperation(value = "获取配置", tags = {"配置" }, notes = "获取配置")
@RequestMapping(method = RequestMethod.GET, value = "/dstconfigs/{dstconfig_id}")
public ResponseEntity<DstConfigDTO> get(@PathVariable("dstconfig_id") String dstconfig_id) {
DstConfig domain = dstconfigService.get(dstconfig_id);
DstConfigDTO dto = dstconfigMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取配置草稿", tags = {"配置" }, notes = "获取配置草稿")
@RequestMapping(method = RequestMethod.GET, value = "/dstconfigs/getdraft")
public ResponseEntity<DstConfigDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(dstconfigMapping.toDto(dstconfigService.getDraft(new DstConfig())));
}
@ApiOperation(value = "检查配置", tags = {"配置" }, notes = "检查配置")
@RequestMapping(method = RequestMethod.POST, value = "/dstconfigs/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody DstConfigDTO dstconfigdto) {
return ResponseEntity.status(HttpStatus.OK).body(dstconfigService.checkKey(dstconfigMapping.toDomain(dstconfigdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Save-all')")
@ApiOperation(value = "保存配置", tags = {"配置" }, notes = "保存配置")
@RequestMapping(method = RequestMethod.POST, value = "/dstconfigs/save")
public ResponseEntity<Boolean> save(@RequestBody DstConfigDTO dstconfigdto) {
return ResponseEntity.status(HttpStatus.OK).body(dstconfigService.save(dstconfigMapping.toDomain(dstconfigdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-Save-all')")
@ApiOperation(value = "批量保存配置", tags = {"配置" }, notes = "批量保存配置")
@RequestMapping(method = RequestMethod.POST, value = "/dstconfigs/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<DstConfigDTO> dstconfigdtos) {
dstconfigService.saveBatch(dstconfigMapping.toDomain(dstconfigdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"配置" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/dstconfigs/fetchdefault")
public ResponseEntity<List<DstConfigDTO>> fetchDefault(DstConfigSearchContext context) {
Page<DstConfig> domains = dstconfigService.searchDefault(context) ;
List<DstConfigDTO> list = dstconfigMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstConfig-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"配置" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/dstconfigs/searchdefault")
public ResponseEntity<Page<DstConfigDTO>> searchDefault(@RequestBody DstConfigSearchContext context) {
Page<DstConfig> domains = dstconfigService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(dstconfigMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.DstDataSource;
import cn.ibizlab.core.lite.service.IDstDataSourceService;
import cn.ibizlab.core.lite.filter.DstDataSourceSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"数据源" })
@RestController("api-dstdatasource")
@RequestMapping("")
public class DstDataSourceResource {
@Autowired
public IDstDataSourceService dstdatasourceService;
@Autowired
@Lazy
public DstDataSourceMapping dstdatasourceMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-Create-all')")
@ApiOperation(value = "新建数据源", tags = {"数据源" }, notes = "新建数据源")
@RequestMapping(method = RequestMethod.POST, value = "/dstdatasources")
public ResponseEntity<DstDataSourceDTO> create(@Validated @RequestBody DstDataSourceDTO dstdatasourcedto) {
DstDataSource domain = dstdatasourceMapping.toDomain(dstdatasourcedto);
dstdatasourceService.create(domain);
DstDataSourceDTO dto = dstdatasourceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-Create-all')")
@ApiOperation(value = "批量新建数据源", tags = {"数据源" }, notes = "批量新建数据源")
@RequestMapping(method = RequestMethod.POST, value = "/dstdatasources/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<DstDataSourceDTO> dstdatasourcedtos) {
dstdatasourceService.createBatch(dstdatasourceMapping.toDomain(dstdatasourcedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-Update-all')")
@ApiOperation(value = "更新数据源", tags = {"数据源" }, notes = "更新数据源")
@RequestMapping(method = RequestMethod.PUT, value = "/dstdatasources/{dstdatasource_id}")
public ResponseEntity<DstDataSourceDTO> update(@PathVariable("dstdatasource_id") String dstdatasource_id, @RequestBody DstDataSourceDTO dstdatasourcedto) {
DstDataSource domain = dstdatasourceMapping.toDomain(dstdatasourcedto);
domain .setDsId(dstdatasource_id);
dstdatasourceService.update(domain );
DstDataSourceDTO dto = dstdatasourceMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-Update-all')")
@ApiOperation(value = "批量更新数据源", tags = {"数据源" }, notes = "批量更新数据源")
@RequestMapping(method = RequestMethod.PUT, value = "/dstdatasources/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<DstDataSourceDTO> dstdatasourcedtos) {
dstdatasourceService.updateBatch(dstdatasourceMapping.toDomain(dstdatasourcedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-Remove-all')")
@ApiOperation(value = "删除数据源", tags = {"数据源" }, notes = "删除数据源")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstdatasources/{dstdatasource_id}")
public ResponseEntity<Boolean> remove(@PathVariable("dstdatasource_id") String dstdatasource_id) {
return ResponseEntity.status(HttpStatus.OK).body(dstdatasourceService.remove(dstdatasource_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-Remove-all')")
@ApiOperation(value = "批量删除数据源", tags = {"数据源" }, notes = "批量删除数据源")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstdatasources/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
dstdatasourceService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-Get-all')")
@ApiOperation(value = "获取数据源", tags = {"数据源" }, notes = "获取数据源")
@RequestMapping(method = RequestMethod.GET, value = "/dstdatasources/{dstdatasource_id}")
public ResponseEntity<DstDataSourceDTO> get(@PathVariable("dstdatasource_id") String dstdatasource_id) {
DstDataSource domain = dstdatasourceService.get(dstdatasource_id);
DstDataSourceDTO dto = dstdatasourceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取数据源草稿", tags = {"数据源" }, notes = "获取数据源草稿")
@RequestMapping(method = RequestMethod.GET, value = "/dstdatasources/getdraft")
public ResponseEntity<DstDataSourceDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(dstdatasourceMapping.toDto(dstdatasourceService.getDraft(new DstDataSource())));
}
@ApiOperation(value = "检查数据源", tags = {"数据源" }, notes = "检查数据源")
@RequestMapping(method = RequestMethod.POST, value = "/dstdatasources/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody DstDataSourceDTO dstdatasourcedto) {
return ResponseEntity.status(HttpStatus.OK).body(dstdatasourceService.checkKey(dstdatasourceMapping.toDomain(dstdatasourcedto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-Save-all')")
@ApiOperation(value = "保存数据源", tags = {"数据源" }, notes = "保存数据源")
@RequestMapping(method = RequestMethod.POST, value = "/dstdatasources/save")
public ResponseEntity<Boolean> save(@RequestBody DstDataSourceDTO dstdatasourcedto) {
return ResponseEntity.status(HttpStatus.OK).body(dstdatasourceService.save(dstdatasourceMapping.toDomain(dstdatasourcedto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-Save-all')")
@ApiOperation(value = "批量保存数据源", tags = {"数据源" }, notes = "批量保存数据源")
@RequestMapping(method = RequestMethod.POST, value = "/dstdatasources/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<DstDataSourceDTO> dstdatasourcedtos) {
dstdatasourceService.saveBatch(dstdatasourceMapping.toDomain(dstdatasourcedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"数据源" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/dstdatasources/fetchdefault")
public ResponseEntity<List<DstDataSourceDTO>> fetchDefault(DstDataSourceSearchContext context) {
Page<DstDataSource> domains = dstdatasourceService.searchDefault(context) ;
List<DstDataSourceDTO> list = dstdatasourceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"数据源" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/dstdatasources/searchdefault")
public ResponseEntity<Page<DstDataSourceDTO>> searchDefault(@RequestBody DstDataSourceSearchContext context) {
Page<DstDataSource> domains = dstdatasourceService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(dstdatasourceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.DstMicroservice;
import cn.ibizlab.core.lite.service.IDstMicroserviceService;
import cn.ibizlab.core.lite.filter.DstMicroserviceSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"微服务" })
@RestController("api-dstmicroservice")
@RequestMapping("")
public class DstMicroserviceResource {
@Autowired
public IDstMicroserviceService dstmicroserviceService;
@Autowired
@Lazy
public DstMicroserviceMapping dstmicroserviceMapping;
@ApiOperation(value = "新建微服务", tags = {"微服务" }, notes = "新建微服务")
@RequestMapping(method = RequestMethod.POST, value = "/dstmicroservices")
public ResponseEntity<DstMicroserviceDTO> create(@Validated @RequestBody DstMicroserviceDTO dstmicroservicedto) {
DstMicroservice domain = dstmicroserviceMapping.toDomain(dstmicroservicedto);
dstmicroserviceService.create(domain);
DstMicroserviceDTO dto = dstmicroserviceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量新建微服务", tags = {"微服务" }, notes = "批量新建微服务")
@RequestMapping(method = RequestMethod.POST, value = "/dstmicroservices/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<DstMicroserviceDTO> dstmicroservicedtos) {
dstmicroserviceService.createBatch(dstmicroserviceMapping.toDomain(dstmicroservicedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "更新微服务", tags = {"微服务" }, notes = "更新微服务")
@RequestMapping(method = RequestMethod.PUT, value = "/dstmicroservices/{dstmicroservice_id}")
public ResponseEntity<DstMicroserviceDTO> update(@PathVariable("dstmicroservice_id") String dstmicroservice_id, @RequestBody DstMicroserviceDTO dstmicroservicedto) {
DstMicroservice domain = dstmicroserviceMapping.toDomain(dstmicroservicedto);
domain .setId(dstmicroservice_id);
dstmicroserviceService.update(domain );
DstMicroserviceDTO dto = dstmicroserviceMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量更新微服务", tags = {"微服务" }, notes = "批量更新微服务")
@RequestMapping(method = RequestMethod.PUT, value = "/dstmicroservices/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<DstMicroserviceDTO> dstmicroservicedtos) {
dstmicroserviceService.updateBatch(dstmicroserviceMapping.toDomain(dstmicroservicedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "删除微服务", tags = {"微服务" }, notes = "删除微服务")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstmicroservices/{dstmicroservice_id}")
public ResponseEntity<Boolean> remove(@PathVariable("dstmicroservice_id") String dstmicroservice_id) {
return ResponseEntity.status(HttpStatus.OK).body(dstmicroserviceService.remove(dstmicroservice_id));
}
@ApiOperation(value = "批量删除微服务", tags = {"微服务" }, notes = "批量删除微服务")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstmicroservices/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
dstmicroserviceService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取微服务", tags = {"微服务" }, notes = "获取微服务")
@RequestMapping(method = RequestMethod.GET, value = "/dstmicroservices/{dstmicroservice_id}")
public ResponseEntity<DstMicroserviceDTO> get(@PathVariable("dstmicroservice_id") String dstmicroservice_id) {
DstMicroservice domain = dstmicroserviceService.get(dstmicroservice_id);
DstMicroserviceDTO dto = dstmicroserviceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取微服务草稿", tags = {"微服务" }, notes = "获取微服务草稿")
@RequestMapping(method = RequestMethod.GET, value = "/dstmicroservices/getdraft")
public ResponseEntity<DstMicroserviceDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(dstmicroserviceMapping.toDto(dstmicroserviceService.getDraft(new DstMicroservice())));
}
@ApiOperation(value = "检查微服务", tags = {"微服务" }, notes = "检查微服务")
@RequestMapping(method = RequestMethod.POST, value = "/dstmicroservices/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody DstMicroserviceDTO dstmicroservicedto) {
return ResponseEntity.status(HttpStatus.OK).body(dstmicroserviceService.checkKey(dstmicroserviceMapping.toDomain(dstmicroservicedto)));
}
@ApiOperation(value = "保存微服务", tags = {"微服务" }, notes = "保存微服务")
@RequestMapping(method = RequestMethod.POST, value = "/dstmicroservices/save")
public ResponseEntity<Boolean> save(@RequestBody DstMicroserviceDTO dstmicroservicedto) {
return ResponseEntity.status(HttpStatus.OK).body(dstmicroserviceService.save(dstmicroserviceMapping.toDomain(dstmicroservicedto)));
}
@ApiOperation(value = "批量保存微服务", tags = {"微服务" }, notes = "批量保存微服务")
@RequestMapping(method = RequestMethod.POST, value = "/dstmicroservices/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<DstMicroserviceDTO> dstmicroservicedtos) {
dstmicroserviceService.saveBatch(dstmicroserviceMapping.toDomain(dstmicroservicedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取数据集", tags = {"微服务" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/dstmicroservices/fetchdefault")
public ResponseEntity<List<DstMicroserviceDTO>> fetchDefault(DstMicroserviceSearchContext context) {
Page<DstMicroservice> domains = dstmicroserviceService.searchDefault(context) ;
List<DstMicroserviceDTO> list = dstmicroserviceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@ApiOperation(value = "查询数据集", tags = {"微服务" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/dstmicroservices/searchdefault")
public ResponseEntity<Page<DstMicroserviceDTO>> searchDefault(@RequestBody DstMicroserviceSearchContext context) {
Page<DstMicroservice> domains = dstmicroserviceService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(dstmicroserviceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.DstRouter;
import cn.ibizlab.core.lite.service.IDstRouterService;
import cn.ibizlab.core.lite.filter.DstRouterSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"路由" })
@RestController("api-dstrouter")
@RequestMapping("")
public class DstRouterResource {
@Autowired
public IDstRouterService dstrouterService;
@Autowired
@Lazy
public DstRouterMapping dstrouterMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-Create-all')")
@ApiOperation(value = "新建路由", tags = {"路由" }, notes = "新建路由")
@RequestMapping(method = RequestMethod.POST, value = "/dstrouters")
public ResponseEntity<DstRouterDTO> create(@Validated @RequestBody DstRouterDTO dstrouterdto) {
DstRouter domain = dstrouterMapping.toDomain(dstrouterdto);
dstrouterService.create(domain);
DstRouterDTO dto = dstrouterMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-Create-all')")
@ApiOperation(value = "批量新建路由", tags = {"路由" }, notes = "批量新建路由")
@RequestMapping(method = RequestMethod.POST, value = "/dstrouters/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<DstRouterDTO> dstrouterdtos) {
dstrouterService.createBatch(dstrouterMapping.toDomain(dstrouterdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-Update-all')")
@ApiOperation(value = "更新路由", tags = {"路由" }, notes = "更新路由")
@RequestMapping(method = RequestMethod.PUT, value = "/dstrouters/{dstrouter_id}")
public ResponseEntity<DstRouterDTO> update(@PathVariable("dstrouter_id") String dstrouter_id, @RequestBody DstRouterDTO dstrouterdto) {
DstRouter domain = dstrouterMapping.toDomain(dstrouterdto);
domain .setId(dstrouter_id);
dstrouterService.update(domain );
DstRouterDTO dto = dstrouterMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-Update-all')")
@ApiOperation(value = "批量更新路由", tags = {"路由" }, notes = "批量更新路由")
@RequestMapping(method = RequestMethod.PUT, value = "/dstrouters/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<DstRouterDTO> dstrouterdtos) {
dstrouterService.updateBatch(dstrouterMapping.toDomain(dstrouterdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-Remove-all')")
@ApiOperation(value = "删除路由", tags = {"路由" }, notes = "删除路由")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstrouters/{dstrouter_id}")
public ResponseEntity<Boolean> remove(@PathVariable("dstrouter_id") String dstrouter_id) {
return ResponseEntity.status(HttpStatus.OK).body(dstrouterService.remove(dstrouter_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-Remove-all')")
@ApiOperation(value = "批量删除路由", tags = {"路由" }, notes = "批量删除路由")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstrouters/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
dstrouterService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-Get-all')")
@ApiOperation(value = "获取路由", tags = {"路由" }, notes = "获取路由")
@RequestMapping(method = RequestMethod.GET, value = "/dstrouters/{dstrouter_id}")
public ResponseEntity<DstRouterDTO> get(@PathVariable("dstrouter_id") String dstrouter_id) {
DstRouter domain = dstrouterService.get(dstrouter_id);
DstRouterDTO dto = dstrouterMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取路由草稿", tags = {"路由" }, notes = "获取路由草稿")
@RequestMapping(method = RequestMethod.GET, value = "/dstrouters/getdraft")
public ResponseEntity<DstRouterDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(dstrouterMapping.toDto(dstrouterService.getDraft(new DstRouter())));
}
@ApiOperation(value = "检查路由", tags = {"路由" }, notes = "检查路由")
@RequestMapping(method = RequestMethod.POST, value = "/dstrouters/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody DstRouterDTO dstrouterdto) {
return ResponseEntity.status(HttpStatus.OK).body(dstrouterService.checkKey(dstrouterMapping.toDomain(dstrouterdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-Save-all')")
@ApiOperation(value = "保存路由", tags = {"路由" }, notes = "保存路由")
@RequestMapping(method = RequestMethod.POST, value = "/dstrouters/save")
public ResponseEntity<Boolean> save(@RequestBody DstRouterDTO dstrouterdto) {
return ResponseEntity.status(HttpStatus.OK).body(dstrouterService.save(dstrouterMapping.toDomain(dstrouterdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-Save-all')")
@ApiOperation(value = "批量保存路由", tags = {"路由" }, notes = "批量保存路由")
@RequestMapping(method = RequestMethod.POST, value = "/dstrouters/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<DstRouterDTO> dstrouterdtos) {
dstrouterService.saveBatch(dstrouterMapping.toDomain(dstrouterdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"路由" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/dstrouters/fetchdefault")
public ResponseEntity<List<DstRouterDTO>> fetchDefault(DstRouterSearchContext context) {
Page<DstRouter> domains = dstrouterService.searchDefault(context) ;
List<DstRouterDTO> list = dstrouterMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstRouter-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"路由" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/dstrouters/searchdefault")
public ResponseEntity<Page<DstRouterDTO>> searchDefault(@RequestBody DstRouterSearchContext context) {
Page<DstRouter> domains = dstrouterService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(dstrouterMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.DstView;
import cn.ibizlab.core.lite.service.IDstViewService;
import cn.ibizlab.core.lite.filter.DstViewSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"页面" })
@RestController("api-dstview")
@RequestMapping("")
public class DstViewResource {
@Autowired
public IDstViewService dstviewService;
@Autowired
@Lazy
public DstViewMapping dstviewMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-Create-all')")
@ApiOperation(value = "新建页面", tags = {"页面" }, notes = "新建页面")
@RequestMapping(method = RequestMethod.POST, value = "/dstviews")
public ResponseEntity<DstViewDTO> create(@Validated @RequestBody DstViewDTO dstviewdto) {
DstView domain = dstviewMapping.toDomain(dstviewdto);
dstviewService.create(domain);
DstViewDTO dto = dstviewMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-Create-all')")
@ApiOperation(value = "批量新建页面", tags = {"页面" }, notes = "批量新建页面")
@RequestMapping(method = RequestMethod.POST, value = "/dstviews/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<DstViewDTO> dstviewdtos) {
dstviewService.createBatch(dstviewMapping.toDomain(dstviewdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-Update-all')")
@ApiOperation(value = "更新页面", tags = {"页面" }, notes = "更新页面")
@RequestMapping(method = RequestMethod.PUT, value = "/dstviews/{dstview_id}")
public ResponseEntity<DstViewDTO> update(@PathVariable("dstview_id") String dstview_id, @RequestBody DstViewDTO dstviewdto) {
DstView domain = dstviewMapping.toDomain(dstviewdto);
domain .setId(dstview_id);
dstviewService.update(domain );
DstViewDTO dto = dstviewMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-Update-all')")
@ApiOperation(value = "批量更新页面", tags = {"页面" }, notes = "批量更新页面")
@RequestMapping(method = RequestMethod.PUT, value = "/dstviews/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<DstViewDTO> dstviewdtos) {
dstviewService.updateBatch(dstviewMapping.toDomain(dstviewdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-Remove-all')")
@ApiOperation(value = "删除页面", tags = {"页面" }, notes = "删除页面")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstviews/{dstview_id}")
public ResponseEntity<Boolean> remove(@PathVariable("dstview_id") String dstview_id) {
return ResponseEntity.status(HttpStatus.OK).body(dstviewService.remove(dstview_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-Remove-all')")
@ApiOperation(value = "批量删除页面", tags = {"页面" }, notes = "批量删除页面")
@RequestMapping(method = RequestMethod.DELETE, value = "/dstviews/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
dstviewService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-Get-all')")
@ApiOperation(value = "获取页面", tags = {"页面" }, notes = "获取页面")
@RequestMapping(method = RequestMethod.GET, value = "/dstviews/{dstview_id}")
public ResponseEntity<DstViewDTO> get(@PathVariable("dstview_id") String dstview_id) {
DstView domain = dstviewService.get(dstview_id);
DstViewDTO dto = dstviewMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取页面草稿", tags = {"页面" }, notes = "获取页面草稿")
@RequestMapping(method = RequestMethod.GET, value = "/dstviews/getdraft")
public ResponseEntity<DstViewDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(dstviewMapping.toDto(dstviewService.getDraft(new DstView())));
}
@ApiOperation(value = "检查页面", tags = {"页面" }, notes = "检查页面")
@RequestMapping(method = RequestMethod.POST, value = "/dstviews/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody DstViewDTO dstviewdto) {
return ResponseEntity.status(HttpStatus.OK).body(dstviewService.checkKey(dstviewMapping.toDomain(dstviewdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-Save-all')")
@ApiOperation(value = "保存页面", tags = {"页面" }, notes = "保存页面")
@RequestMapping(method = RequestMethod.POST, value = "/dstviews/save")
public ResponseEntity<Boolean> save(@RequestBody DstViewDTO dstviewdto) {
return ResponseEntity.status(HttpStatus.OK).body(dstviewService.save(dstviewMapping.toDomain(dstviewdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-Save-all')")
@ApiOperation(value = "批量保存页面", tags = {"页面" }, notes = "批量保存页面")
@RequestMapping(method = RequestMethod.POST, value = "/dstviews/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<DstViewDTO> dstviewdtos) {
dstviewService.saveBatch(dstviewMapping.toDomain(dstviewdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"页面" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/dstviews/fetchdefault")
public ResponseEntity<List<DstViewDTO>> fetchDefault(DstViewSearchContext context) {
Page<DstView> domains = dstviewService.searchDefault(context) ;
List<DstViewDTO> list = dstviewMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstView-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"页面" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/dstviews/searchdefault")
public ResponseEntity<Page<DstViewDTO>> searchDefault(@RequestBody DstViewSearchContext context) {
Page<DstView> domains = dstviewService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(dstviewMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.MetaDataSet;
import cn.ibizlab.core.lite.service.IMetaDataSetService;
import cn.ibizlab.core.lite.filter.MetaDataSetSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"数据集" })
@RestController("api-metadataset")
@RequestMapping("")
public class MetaDataSetResource {
@Autowired
public IMetaDataSetService metadatasetService;
@Autowired
@Lazy
public MetaDataSetMapping metadatasetMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-Create-all')")
@ApiOperation(value = "新建数据集", tags = {"数据集" }, notes = "新建数据集")
@RequestMapping(method = RequestMethod.POST, value = "/metadatasets")
public ResponseEntity<MetaDataSetDTO> create(@Validated @RequestBody MetaDataSetDTO metadatasetdto) {
MetaDataSet domain = metadatasetMapping.toDomain(metadatasetdto);
metadatasetService.create(domain);
MetaDataSetDTO dto = metadatasetMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-Create-all')")
@ApiOperation(value = "批量新建数据集", tags = {"数据集" }, notes = "批量新建数据集")
@RequestMapping(method = RequestMethod.POST, value = "/metadatasets/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<MetaDataSetDTO> metadatasetdtos) {
metadatasetService.createBatch(metadatasetMapping.toDomain(metadatasetdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-Update-all')")
@ApiOperation(value = "更新数据集", tags = {"数据集" }, notes = "更新数据集")
@RequestMapping(method = RequestMethod.PUT, value = "/metadatasets/{metadataset_id}")
public ResponseEntity<MetaDataSetDTO> update(@PathVariable("metadataset_id") String metadataset_id, @RequestBody MetaDataSetDTO metadatasetdto) {
MetaDataSet domain = metadatasetMapping.toDomain(metadatasetdto);
domain .setDatasetId(metadataset_id);
metadatasetService.update(domain );
MetaDataSetDTO dto = metadatasetMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-Update-all')")
@ApiOperation(value = "批量更新数据集", tags = {"数据集" }, notes = "批量更新数据集")
@RequestMapping(method = RequestMethod.PUT, value = "/metadatasets/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<MetaDataSetDTO> metadatasetdtos) {
metadatasetService.updateBatch(metadatasetMapping.toDomain(metadatasetdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-Remove-all')")
@ApiOperation(value = "删除数据集", tags = {"数据集" }, notes = "删除数据集")
@RequestMapping(method = RequestMethod.DELETE, value = "/metadatasets/{metadataset_id}")
public ResponseEntity<Boolean> remove(@PathVariable("metadataset_id") String metadataset_id) {
return ResponseEntity.status(HttpStatus.OK).body(metadatasetService.remove(metadataset_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-Remove-all')")
@ApiOperation(value = "批量删除数据集", tags = {"数据集" }, notes = "批量删除数据集")
@RequestMapping(method = RequestMethod.DELETE, value = "/metadatasets/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
metadatasetService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-Get-all')")
@ApiOperation(value = "获取数据集", tags = {"数据集" }, notes = "获取数据集")
@RequestMapping(method = RequestMethod.GET, value = "/metadatasets/{metadataset_id}")
public ResponseEntity<MetaDataSetDTO> get(@PathVariable("metadataset_id") String metadataset_id) {
MetaDataSet domain = metadatasetService.get(metadataset_id);
MetaDataSetDTO dto = metadatasetMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取数据集草稿", tags = {"数据集" }, notes = "获取数据集草稿")
@RequestMapping(method = RequestMethod.GET, value = "/metadatasets/getdraft")
public ResponseEntity<MetaDataSetDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(metadatasetMapping.toDto(metadatasetService.getDraft(new MetaDataSet())));
}
@ApiOperation(value = "检查数据集", tags = {"数据集" }, notes = "检查数据集")
@RequestMapping(method = RequestMethod.POST, value = "/metadatasets/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody MetaDataSetDTO metadatasetdto) {
return ResponseEntity.status(HttpStatus.OK).body(metadatasetService.checkKey(metadatasetMapping.toDomain(metadatasetdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-Save-all')")
@ApiOperation(value = "保存数据集", tags = {"数据集" }, notes = "保存数据集")
@RequestMapping(method = RequestMethod.POST, value = "/metadatasets/save")
public ResponseEntity<Boolean> save(@RequestBody MetaDataSetDTO metadatasetdto) {
return ResponseEntity.status(HttpStatus.OK).body(metadatasetService.save(metadatasetMapping.toDomain(metadatasetdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-Save-all')")
@ApiOperation(value = "批量保存数据集", tags = {"数据集" }, notes = "批量保存数据集")
@RequestMapping(method = RequestMethod.POST, value = "/metadatasets/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<MetaDataSetDTO> metadatasetdtos) {
metadatasetService.saveBatch(metadatasetMapping.toDomain(metadatasetdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"数据集" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/metadatasets/fetchdefault")
public ResponseEntity<List<MetaDataSetDTO>> fetchDefault(MetaDataSetSearchContext context) {
Page<MetaDataSet> domains = metadatasetService.searchDefault(context) ;
List<MetaDataSetDTO> list = metadatasetMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDataSet-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"数据集" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/metadatasets/searchdefault")
public ResponseEntity<Page<MetaDataSetDTO>> searchDefault(@RequestBody MetaDataSetSearchContext context) {
Page<MetaDataSet> domains = metadatasetService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(metadatasetMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.MetaField;
import cn.ibizlab.core.lite.service.IMetaFieldService;
import cn.ibizlab.core.lite.filter.MetaFieldSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"属性" })
@RestController("api-metafield")
@RequestMapping("")
public class MetaFieldResource {
@Autowired
public IMetaFieldService metafieldService;
@Autowired
@Lazy
public MetaFieldMapping metafieldMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-Create-all')")
@ApiOperation(value = "新建属性", tags = {"属性" }, notes = "新建属性")
@RequestMapping(method = RequestMethod.POST, value = "/metafields")
public ResponseEntity<MetaFieldDTO> create(@Validated @RequestBody MetaFieldDTO metafielddto) {
MetaField domain = metafieldMapping.toDomain(metafielddto);
metafieldService.create(domain);
MetaFieldDTO dto = metafieldMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-Create-all')")
@ApiOperation(value = "批量新建属性", tags = {"属性" }, notes = "批量新建属性")
@RequestMapping(method = RequestMethod.POST, value = "/metafields/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<MetaFieldDTO> metafielddtos) {
metafieldService.createBatch(metafieldMapping.toDomain(metafielddtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-Update-all')")
@ApiOperation(value = "更新属性", tags = {"属性" }, notes = "更新属性")
@RequestMapping(method = RequestMethod.PUT, value = "/metafields/{metafield_id}")
public ResponseEntity<MetaFieldDTO> update(@PathVariable("metafield_id") String metafield_id, @RequestBody MetaFieldDTO metafielddto) {
MetaField domain = metafieldMapping.toDomain(metafielddto);
domain .setFieldId(metafield_id);
metafieldService.update(domain );
MetaFieldDTO dto = metafieldMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-Update-all')")
@ApiOperation(value = "批量更新属性", tags = {"属性" }, notes = "批量更新属性")
@RequestMapping(method = RequestMethod.PUT, value = "/metafields/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<MetaFieldDTO> metafielddtos) {
metafieldService.updateBatch(metafieldMapping.toDomain(metafielddtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-Remove-all')")
@ApiOperation(value = "删除属性", tags = {"属性" }, notes = "删除属性")
@RequestMapping(method = RequestMethod.DELETE, value = "/metafields/{metafield_id}")
public ResponseEntity<Boolean> remove(@PathVariable("metafield_id") String metafield_id) {
return ResponseEntity.status(HttpStatus.OK).body(metafieldService.remove(metafield_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-Remove-all')")
@ApiOperation(value = "批量删除属性", tags = {"属性" }, notes = "批量删除属性")
@RequestMapping(method = RequestMethod.DELETE, value = "/metafields/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
metafieldService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-Get-all')")
@ApiOperation(value = "获取属性", tags = {"属性" }, notes = "获取属性")
@RequestMapping(method = RequestMethod.GET, value = "/metafields/{metafield_id}")
public ResponseEntity<MetaFieldDTO> get(@PathVariable("metafield_id") String metafield_id) {
MetaField domain = metafieldService.get(metafield_id);
MetaFieldDTO dto = metafieldMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取属性草稿", tags = {"属性" }, notes = "获取属性草稿")
@RequestMapping(method = RequestMethod.GET, value = "/metafields/getdraft")
public ResponseEntity<MetaFieldDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(metafieldMapping.toDto(metafieldService.getDraft(new MetaField())));
}
@ApiOperation(value = "检查属性", tags = {"属性" }, notes = "检查属性")
@RequestMapping(method = RequestMethod.POST, value = "/metafields/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody MetaFieldDTO metafielddto) {
return ResponseEntity.status(HttpStatus.OK).body(metafieldService.checkKey(metafieldMapping.toDomain(metafielddto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-Save-all')")
@ApiOperation(value = "保存属性", tags = {"属性" }, notes = "保存属性")
@RequestMapping(method = RequestMethod.POST, value = "/metafields/save")
public ResponseEntity<Boolean> save(@RequestBody MetaFieldDTO metafielddto) {
return ResponseEntity.status(HttpStatus.OK).body(metafieldService.save(metafieldMapping.toDomain(metafielddto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-Save-all')")
@ApiOperation(value = "批量保存属性", tags = {"属性" }, notes = "批量保存属性")
@RequestMapping(method = RequestMethod.POST, value = "/metafields/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<MetaFieldDTO> metafielddtos) {
metafieldService.saveBatch(metafieldMapping.toDomain(metafielddtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"属性" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/metafields/fetchdefault")
public ResponseEntity<List<MetaFieldDTO>> fetchDefault(MetaFieldSearchContext context) {
Page<MetaField> domains = metafieldService.searchDefault(context) ;
List<MetaFieldDTO> list = metafieldMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaField-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"属性" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/metafields/searchdefault")
public ResponseEntity<Page<MetaFieldDTO>> searchDefault(@RequestBody MetaFieldSearchContext context) {
Page<MetaField> domains = metafieldService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(metafieldMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.MetaModel;
import cn.ibizlab.core.lite.service.IMetaModelService;
import cn.ibizlab.core.lite.filter.MetaModelSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"模型" })
@RestController("api-metamodel")
@RequestMapping("")
public class MetaModelResource {
@Autowired
public IMetaModelService metamodelService;
@Autowired
@Lazy
public MetaModelMapping metamodelMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-Create-all')")
@ApiOperation(value = "新建模型", tags = {"模型" }, notes = "新建模型")
@RequestMapping(method = RequestMethod.POST, value = "/metamodels")
public ResponseEntity<MetaModelDTO> create(@Validated @RequestBody MetaModelDTO metamodeldto) {
MetaModel domain = metamodelMapping.toDomain(metamodeldto);
metamodelService.create(domain);
MetaModelDTO dto = metamodelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-Create-all')")
@ApiOperation(value = "批量新建模型", tags = {"模型" }, notes = "批量新建模型")
@RequestMapping(method = RequestMethod.POST, value = "/metamodels/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<MetaModelDTO> metamodeldtos) {
metamodelService.createBatch(metamodelMapping.toDomain(metamodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-Update-all')")
@ApiOperation(value = "更新模型", tags = {"模型" }, notes = "更新模型")
@RequestMapping(method = RequestMethod.PUT, value = "/metamodels/{metamodel_id}")
public ResponseEntity<MetaModelDTO> update(@PathVariable("metamodel_id") String metamodel_id, @RequestBody MetaModelDTO metamodeldto) {
MetaModel domain = metamodelMapping.toDomain(metamodeldto);
domain .setModelId(metamodel_id);
metamodelService.update(domain );
MetaModelDTO dto = metamodelMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-Update-all')")
@ApiOperation(value = "批量更新模型", tags = {"模型" }, notes = "批量更新模型")
@RequestMapping(method = RequestMethod.PUT, value = "/metamodels/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<MetaModelDTO> metamodeldtos) {
metamodelService.updateBatch(metamodelMapping.toDomain(metamodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-Remove-all')")
@ApiOperation(value = "删除模型", tags = {"模型" }, notes = "删除模型")
@RequestMapping(method = RequestMethod.DELETE, value = "/metamodels/{metamodel_id}")
public ResponseEntity<Boolean> remove(@PathVariable("metamodel_id") String metamodel_id) {
return ResponseEntity.status(HttpStatus.OK).body(metamodelService.remove(metamodel_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-Remove-all')")
@ApiOperation(value = "批量删除模型", tags = {"模型" }, notes = "批量删除模型")
@RequestMapping(method = RequestMethod.DELETE, value = "/metamodels/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
metamodelService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-Get-all')")
@ApiOperation(value = "获取模型", tags = {"模型" }, notes = "获取模型")
@RequestMapping(method = RequestMethod.GET, value = "/metamodels/{metamodel_id}")
public ResponseEntity<MetaModelDTO> get(@PathVariable("metamodel_id") String metamodel_id) {
MetaModel domain = metamodelService.get(metamodel_id);
MetaModelDTO dto = metamodelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取模型草稿", tags = {"模型" }, notes = "获取模型草稿")
@RequestMapping(method = RequestMethod.GET, value = "/metamodels/getdraft")
public ResponseEntity<MetaModelDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(metamodelMapping.toDto(metamodelService.getDraft(new MetaModel())));
}
@ApiOperation(value = "检查模型", tags = {"模型" }, notes = "检查模型")
@RequestMapping(method = RequestMethod.POST, value = "/metamodels/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody MetaModelDTO metamodeldto) {
return ResponseEntity.status(HttpStatus.OK).body(metamodelService.checkKey(metamodelMapping.toDomain(metamodeldto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-Save-all')")
@ApiOperation(value = "保存模型", tags = {"模型" }, notes = "保存模型")
@RequestMapping(method = RequestMethod.POST, value = "/metamodels/save")
public ResponseEntity<Boolean> save(@RequestBody MetaModelDTO metamodeldto) {
return ResponseEntity.status(HttpStatus.OK).body(metamodelService.save(metamodelMapping.toDomain(metamodeldto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-Save-all')")
@ApiOperation(value = "批量保存模型", tags = {"模型" }, notes = "批量保存模型")
@RequestMapping(method = RequestMethod.POST, value = "/metamodels/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<MetaModelDTO> metamodeldtos) {
metamodelService.saveBatch(metamodelMapping.toDomain(metamodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"模型" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/metamodels/fetchdefault")
public ResponseEntity<List<MetaModelDTO>> fetchDefault(MetaModelSearchContext context) {
Page<MetaModel> domains = metamodelService.searchDefault(context) ;
List<MetaModelDTO> list = metamodelMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModel-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"模型" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/metamodels/searchdefault")
public ResponseEntity<Page<MetaModelDTO>> searchDefault(@RequestBody MetaModelSearchContext context) {
Page<MetaModel> domains = metamodelService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(metamodelMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.MetaModule;
import cn.ibizlab.core.lite.service.IMetaModuleService;
import cn.ibizlab.core.lite.filter.MetaModuleSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"模块" })
@RestController("api-metamodule")
@RequestMapping("")
public class MetaModuleResource {
@Autowired
public IMetaModuleService metamoduleService;
@Autowired
@Lazy
public MetaModuleMapping metamoduleMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-Create-all')")
@ApiOperation(value = "新建模块", tags = {"模块" }, notes = "新建模块")
@RequestMapping(method = RequestMethod.POST, value = "/metamodules")
public ResponseEntity<MetaModuleDTO> create(@Validated @RequestBody MetaModuleDTO metamoduledto) {
MetaModule domain = metamoduleMapping.toDomain(metamoduledto);
metamoduleService.create(domain);
MetaModuleDTO dto = metamoduleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-Create-all')")
@ApiOperation(value = "批量新建模块", tags = {"模块" }, notes = "批量新建模块")
@RequestMapping(method = RequestMethod.POST, value = "/metamodules/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<MetaModuleDTO> metamoduledtos) {
metamoduleService.createBatch(metamoduleMapping.toDomain(metamoduledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-Update-all')")
@ApiOperation(value = "更新模块", tags = {"模块" }, notes = "更新模块")
@RequestMapping(method = RequestMethod.PUT, value = "/metamodules/{metamodule_id}")
public ResponseEntity<MetaModuleDTO> update(@PathVariable("metamodule_id") String metamodule_id, @RequestBody MetaModuleDTO metamoduledto) {
MetaModule domain = metamoduleMapping.toDomain(metamoduledto);
domain .setId(metamodule_id);
metamoduleService.update(domain );
MetaModuleDTO dto = metamoduleMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-Update-all')")
@ApiOperation(value = "批量更新模块", tags = {"模块" }, notes = "批量更新模块")
@RequestMapping(method = RequestMethod.PUT, value = "/metamodules/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<MetaModuleDTO> metamoduledtos) {
metamoduleService.updateBatch(metamoduleMapping.toDomain(metamoduledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-Remove-all')")
@ApiOperation(value = "删除模块", tags = {"模块" }, notes = "删除模块")
@RequestMapping(method = RequestMethod.DELETE, value = "/metamodules/{metamodule_id}")
public ResponseEntity<Boolean> remove(@PathVariable("metamodule_id") String metamodule_id) {
return ResponseEntity.status(HttpStatus.OK).body(metamoduleService.remove(metamodule_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-Remove-all')")
@ApiOperation(value = "批量删除模块", tags = {"模块" }, notes = "批量删除模块")
@RequestMapping(method = RequestMethod.DELETE, value = "/metamodules/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
metamoduleService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-Get-all')")
@ApiOperation(value = "获取模块", tags = {"模块" }, notes = "获取模块")
@RequestMapping(method = RequestMethod.GET, value = "/metamodules/{metamodule_id}")
public ResponseEntity<MetaModuleDTO> get(@PathVariable("metamodule_id") String metamodule_id) {
MetaModule domain = metamoduleService.get(metamodule_id);
MetaModuleDTO dto = metamoduleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取模块草稿", tags = {"模块" }, notes = "获取模块草稿")
@RequestMapping(method = RequestMethod.GET, value = "/metamodules/getdraft")
public ResponseEntity<MetaModuleDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(metamoduleMapping.toDto(metamoduleService.getDraft(new MetaModule())));
}
@ApiOperation(value = "检查模块", tags = {"模块" }, notes = "检查模块")
@RequestMapping(method = RequestMethod.POST, value = "/metamodules/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody MetaModuleDTO metamoduledto) {
return ResponseEntity.status(HttpStatus.OK).body(metamoduleService.checkKey(metamoduleMapping.toDomain(metamoduledto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-Save-all')")
@ApiOperation(value = "保存模块", tags = {"模块" }, notes = "保存模块")
@RequestMapping(method = RequestMethod.POST, value = "/metamodules/save")
public ResponseEntity<Boolean> save(@RequestBody MetaModuleDTO metamoduledto) {
return ResponseEntity.status(HttpStatus.OK).body(metamoduleService.save(metamoduleMapping.toDomain(metamoduledto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-Save-all')")
@ApiOperation(value = "批量保存模块", tags = {"模块" }, notes = "批量保存模块")
@RequestMapping(method = RequestMethod.POST, value = "/metamodules/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<MetaModuleDTO> metamoduledtos) {
metamoduleService.saveBatch(metamoduleMapping.toDomain(metamoduledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"模块" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/metamodules/fetchdefault")
public ResponseEntity<List<MetaModuleDTO>> fetchDefault(MetaModuleSearchContext context) {
Page<MetaModule> domains = metamoduleService.searchDefault(context) ;
List<MetaModuleDTO> list = metamoduleMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaModule-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"模块" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/metamodules/searchdefault")
public ResponseEntity<Page<MetaModuleDTO>> searchDefault(@RequestBody MetaModuleSearchContext context) {
Page<MetaModule> domains = metamoduleService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(metamoduleMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.lite.domain.MetaRelationship;
import cn.ibizlab.core.lite.service.IMetaRelationshipService;
import cn.ibizlab.core.lite.filter.MetaRelationshipSearchContext;
import cn.ibizlab.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"实体关系" })
@RestController("api-metarelationship")
@RequestMapping("")
public class MetaRelationshipResource {
@Autowired
public IMetaRelationshipService metarelationshipService;
@Autowired
@Lazy
public MetaRelationshipMapping metarelationshipMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-Create-all')")
@ApiOperation(value = "新建实体关系", tags = {"实体关系" }, notes = "新建实体关系")
@RequestMapping(method = RequestMethod.POST, value = "/metarelationships")
public ResponseEntity<MetaRelationshipDTO> create(@Validated @RequestBody MetaRelationshipDTO metarelationshipdto) {
MetaRelationship domain = metarelationshipMapping.toDomain(metarelationshipdto);
metarelationshipService.create(domain);
MetaRelationshipDTO dto = metarelationshipMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-Create-all')")
@ApiOperation(value = "批量新建实体关系", tags = {"实体关系" }, notes = "批量新建实体关系")
@RequestMapping(method = RequestMethod.POST, value = "/metarelationships/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<MetaRelationshipDTO> metarelationshipdtos) {
metarelationshipService.createBatch(metarelationshipMapping.toDomain(metarelationshipdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-Update-all')")
@ApiOperation(value = "更新实体关系", tags = {"实体关系" }, notes = "更新实体关系")
@RequestMapping(method = RequestMethod.PUT, value = "/metarelationships/{metarelationship_id}")
public ResponseEntity<MetaRelationshipDTO> update(@PathVariable("metarelationship_id") String metarelationship_id, @RequestBody MetaRelationshipDTO metarelationshipdto) {
MetaRelationship domain = metarelationshipMapping.toDomain(metarelationshipdto);
domain .setId(metarelationship_id);
metarelationshipService.update(domain );
MetaRelationshipDTO dto = metarelationshipMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-Update-all')")
@ApiOperation(value = "批量更新实体关系", tags = {"实体关系" }, notes = "批量更新实体关系")
@RequestMapping(method = RequestMethod.PUT, value = "/metarelationships/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<MetaRelationshipDTO> metarelationshipdtos) {
metarelationshipService.updateBatch(metarelationshipMapping.toDomain(metarelationshipdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-Remove-all')")
@ApiOperation(value = "删除实体关系", tags = {"实体关系" }, notes = "删除实体关系")
@RequestMapping(method = RequestMethod.DELETE, value = "/metarelationships/{metarelationship_id}")
public ResponseEntity<Boolean> remove(@PathVariable("metarelationship_id") String metarelationship_id) {
return ResponseEntity.status(HttpStatus.OK).body(metarelationshipService.remove(metarelationship_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-Remove-all')")
@ApiOperation(value = "批量删除实体关系", tags = {"实体关系" }, notes = "批量删除实体关系")
@RequestMapping(method = RequestMethod.DELETE, value = "/metarelationships/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
metarelationshipService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-Get-all')")
@ApiOperation(value = "获取实体关系", tags = {"实体关系" }, notes = "获取实体关系")
@RequestMapping(method = RequestMethod.GET, value = "/metarelationships/{metarelationship_id}")
public ResponseEntity<MetaRelationshipDTO> get(@PathVariable("metarelationship_id") String metarelationship_id) {
MetaRelationship domain = metarelationshipService.get(metarelationship_id);
MetaRelationshipDTO dto = metarelationshipMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取实体关系草稿", tags = {"实体关系" }, notes = "获取实体关系草稿")
@RequestMapping(method = RequestMethod.GET, value = "/metarelationships/getdraft")
public ResponseEntity<MetaRelationshipDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(metarelationshipMapping.toDto(metarelationshipService.getDraft(new MetaRelationship())));
}
@ApiOperation(value = "检查实体关系", tags = {"实体关系" }, notes = "检查实体关系")
@RequestMapping(method = RequestMethod.POST, value = "/metarelationships/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody MetaRelationshipDTO metarelationshipdto) {
return ResponseEntity.status(HttpStatus.OK).body(metarelationshipService.checkKey(metarelationshipMapping.toDomain(metarelationshipdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-Save-all')")
@ApiOperation(value = "保存实体关系", tags = {"实体关系" }, notes = "保存实体关系")
@RequestMapping(method = RequestMethod.POST, value = "/metarelationships/save")
public ResponseEntity<Boolean> save(@RequestBody MetaRelationshipDTO metarelationshipdto) {
return ResponseEntity.status(HttpStatus.OK).body(metarelationshipService.save(metarelationshipMapping.toDomain(metarelationshipdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-Save-all')")
@ApiOperation(value = "批量保存实体关系", tags = {"实体关系" }, notes = "批量保存实体关系")
@RequestMapping(method = RequestMethod.POST, value = "/metarelationships/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<MetaRelationshipDTO> metarelationshipdtos) {
metarelationshipService.saveBatch(metarelationshipMapping.toDomain(metarelationshipdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"实体关系" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/metarelationships/fetchdefault")
public ResponseEntity<List<MetaRelationshipDTO>> fetchDefault(MetaRelationshipSearchContext context) {
Page<MetaRelationship> domains = metarelationshipService.searchDefault(context) ;
List<MetaRelationshipDTO> list = metarelationshipMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaRelationship-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"实体关系" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/metarelationships/searchdefault")
public ResponseEntity<Page<MetaRelationshipDTO>> searchDefault(@RequestBody MetaRelationshipSearchContext context) {
Page<MetaRelationship> domains = metarelationshipService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(metarelationshipMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册