Ver código fonte

Merge branch 'dev' of http://192.168.1.220:10080/jiwei/wlyy2.0 into dev

Conflicts:
	svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java
yeshijie 6 anos atrás
pai
commit
b886642e30

+ 28 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/module/ModuleDO.java

@ -103,6 +103,34 @@ public class ModuleDO extends UuidIdentityEntityWithOperator {
		}
	}
    public enum End {
        have("有子节点", 0),
        no("没有子节点", 1);
        private String name;
        private Integer value;
        End(String name, Integer value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public Integer getValue() {
            return value;
        }
        public void setValue(Integer value) {
            this.value = value;
        }
    }
	//模块名称
	private String name;
	//模块连接

+ 170 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/module/SaasInterfaceDO.java

@ -0,0 +1,170 @@
package com.yihu.jw.entity.base.module;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;
/**
 * 租户接口
 * @author yeshijie on 2018/10/11.
 */
@Entity
@Table(name = "base_saas_interface")
public class SaasInterfaceDO extends UuidIdentityEntity {
    private String name;//接口名称
    private String saasId;//saas_id
    private String interfaceId;//接口id
    private String moduleId;//模块id
    private String moduleName;//模块名称
    private String methodName;//方法名
    private Integer protocolType;//协议类型(2restful,1webservice)
    private Integer openLevel;//开发程度(1公开,2私有)
    private Integer checkLevel;//审计程度(1审计,2不审计)
    private Integer status;//状态(1生效中,0已失效)
    private String remark;//接口说明
    private String url;//https请求地址
    private List<SaasInterfaceParamDO> entryParams;//入参
    private List<SaasInterfaceParamDO> outParams;//出参
    private List<SaasInterfaceErrorCodeDO> errorCodes;//错误说明
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "interface_id")
    public String getInterfaceId() {
        return interfaceId;
    }
    public void setInterfaceId(String interfaceId) {
        this.interfaceId = interfaceId;
    }
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "module_id")
    public String getModuleId() {
        return moduleId;
    }
    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }
    @Column(name = "module_name")
    public String getModuleName() {
        return moduleName;
    }
    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }
    @Column(name = "method_name")
    public String getMethodName() {
        return methodName;
    }
    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }
    @Column(name = "protocol_type")
    public Integer getProtocolType() {
        return protocolType;
    }
    public void setProtocolType(Integer protocolType) {
        this.protocolType = protocolType;
    }
    @Column(name = "open_level")
    public Integer getOpenLevel() {
        return openLevel;
    }
    public void setOpenLevel(Integer openLevel) {
        this.openLevel = openLevel;
    }
    @Column(name = "check_level")
    public Integer getCheckLevel() {
        return checkLevel;
    }
    public void setCheckLevel(Integer checkLevel) {
        this.checkLevel = checkLevel;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Column(name = "url")
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    @Transient
    public List<SaasInterfaceParamDO> getEntryParams() {
        return entryParams;
    }
    public void setEntryParams(List<SaasInterfaceParamDO> entryParams) {
        this.entryParams = entryParams;
    }
    @Transient
    public List<SaasInterfaceParamDO> getOutParams() {
        return outParams;
    }
    public void setOutParams(List<SaasInterfaceParamDO> outParams) {
        this.outParams = outParams;
    }
    @Transient
    public List<SaasInterfaceErrorCodeDO> getErrorCodes() {
        return errorCodes;
    }
    public void setErrorCodes(List<SaasInterfaceErrorCodeDO> errorCodes) {
        this.errorCodes = errorCodes;
    }
}

+ 87 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/module/SaasInterfaceErrorCodeDO.java

@ -0,0 +1,87 @@
package com.yihu.jw.entity.base.module;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 接口错误说明
 * @author yeshijie on 2018/10/11.
 */
@Entity
@Table(name = "base_saas_interface_error_code")
public class SaasInterfaceErrorCodeDO extends UuidIdentityEntity {
    private String saasId;//saas_id
    private String saasInterfaceId;//接口id
    private String name;//错误码名称
    private String description;//错误码描述
    private String solution;//解决方案
    private Integer sort;//排序
    private Integer del;//删除标志
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "saas_interface_id")
    public String getSaasInterfaceId() {
        return saasInterfaceId;
    }
    public void setSaasInterfaceId(String saasInterfaceId) {
        this.saasInterfaceId = saasInterfaceId;
    }
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "description")
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    @Column(name = "solution")
    public String getSolution() {
        return solution;
    }
    public void setSolution(String solution) {
        this.solution = solution;
    }
    @Column(name = "sort")
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 137 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/module/SaasInterfaceParamDO.java

@ -0,0 +1,137 @@
package com.yihu.jw.entity.base.module;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 接口入参出参
 * @author yeshijie on 2018/10/11.
 */
@Entity
@Table(name = "base_saas_interface_param")
public class SaasInterfaceParamDO extends UuidIdentityEntity {
    private String saasId;//saas_id
    private String saasInterfaceId;//接口id
    private String name;//参数名
    private Integer paramType;//参数类型
    private Integer dataType;//数据类型
    private Integer isRequire;//是否必填(1是,0否)
    private Integer maxLength;//最大长度
    private String description;//描述
    private String example;//示例
    private Integer type;//类型(1入参,2出参)
    private Integer sort;//排序
    private Integer del;//删除标志
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "saas_interface_id")
    public String getSaasInterfaceId() {
        return saasInterfaceId;
    }
    public void setSaasInterfaceId(String saasInterfaceId) {
        this.saasInterfaceId = saasInterfaceId;
    }
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "param_type")
    public Integer getParamType() {
        return paramType;
    }
    public void setParamType(Integer paramType) {
        this.paramType = paramType;
    }
    @Column(name = "data_type")
    public Integer getDataType() {
        return dataType;
    }
    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }
    @Column(name = "is_require")
    public Integer getIsRequire() {
        return isRequire;
    }
    public void setIsRequire(Integer isRequire) {
        this.isRequire = isRequire;
    }
    @Column(name = "max_length")
    public Integer getMaxLength() {
        return maxLength;
    }
    public void setMaxLength(Integer maxLength) {
        this.maxLength = maxLength;
    }
    @Column(name = "description")
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    @Column(name = "example")
    public String getExample() {
        return example;
    }
    public void setExample(String example) {
        this.example = example;
    }
    @Column(name = "type")
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    @Column(name = "sort")
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 84 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/module/SaasInterfaceErrorCodeVO.java

@ -0,0 +1,84 @@
package com.yihu.jw.restmodel.base.module;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * 接口错误说明
 * @author yeshijie on 2018/9/28.
 */
@ApiModel(value = "SaasInterfaceErrorCodeVO", description = "接口错误说明")
public class SaasInterfaceErrorCodeVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saas_id", example = "saas_id")
    private String saasId;
    @ApiModelProperty(value = "接口id", example = "接口id")
    private String saasInterfaceId;
    @ApiModelProperty(value = "错误码名称", example = "错误码名称")
    private String name;
    @ApiModelProperty(value = "错误码描述", example = "错误码描述")
    private String description;
    @ApiModelProperty(value = "解决方案", example = "解决方案")
    private String solution;
    @ApiModelProperty(value = "排序", example = "1")
    private Integer sort;
    @ApiModelProperty(value = "删除标志", example = "1")
    private Integer del;
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getSaasInterfaceId() {
        return saasInterfaceId;
    }
    public void setSaasInterfaceId(String saasInterfaceId) {
        this.saasInterfaceId = saasInterfaceId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getSolution() {
        return solution;
    }
    public void setSolution(String solution) {
        this.solution = solution;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 134 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/module/SaasInterfaceParamVO.java

@ -0,0 +1,134 @@
package com.yihu.jw.restmodel.base.module;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * 接口入参出参
 * @author yeshijie on 2018/10/11.
 */
@ApiModel(value = "SaasInterfaceParamVO", description = "接口入参出参")
public class SaasInterfaceParamVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saas_id", example = "saas_id")
    private String saasId;
    @ApiModelProperty(value = "接口id", example = "接口id")
    private String saasInterfaceId;
    @ApiModelProperty(value = "参数名", example = "user")
    private String name;
    @ApiModelProperty(value = "参数类型", example = "HEADER")
    private Integer paramType;
    @ApiModelProperty(value = "数据类型", example = "VERCHAR")
    private Integer dataType;
    @ApiModelProperty(value = "是否必填(1是,0否)", example = "1")
    private Integer isRequire;
    @ApiModelProperty(value = "最大长度", example = "1")
    private Integer maxLength;
    @ApiModelProperty(value = "描述", example = "")
    private String description;
    @ApiModelProperty(value = "示例", example = "")
    private String example;
    @ApiModelProperty(value = "类型(1入参,2出参)", example = "1")
    private Integer type;
    @ApiModelProperty(value = "排序", example = "1")
    private Integer sort;
    @ApiModelProperty(value = "删除标志", example = "1")
    private Integer del;
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getSaasInterfaceId() {
        return saasInterfaceId;
    }
    public void setSaasInterfaceId(String saasInterfaceId) {
        this.saasInterfaceId = saasInterfaceId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getParamType() {
        return paramType;
    }
    public void setParamType(Integer paramType) {
        this.paramType = paramType;
    }
    public Integer getDataType() {
        return dataType;
    }
    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }
    public Integer getIsRequire() {
        return isRequire;
    }
    public void setIsRequire(Integer isRequire) {
        this.isRequire = isRequire;
    }
    public Integer getMaxLength() {
        return maxLength;
    }
    public void setMaxLength(Integer maxLength) {
        this.maxLength = maxLength;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getExample() {
        return example;
    }
    public void setExample(String example) {
        this.example = example;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 167 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/module/SaasInterfaceVO.java

@ -0,0 +1,167 @@
package com.yihu.jw.restmodel.base.module;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
/**
 * 租户接口
 * @author yeshijie on 2018/10/11.
 */
@ApiModel(value = "SaasInterfaceVO", description = "租户接口")
public class SaasInterfaceVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saas_id", example = "saas_id")
    private String saasId;
    @ApiModelProperty(value = "接口id", example = "接口id")
    private String interfaceId;
    @ApiModelProperty(value = "接口名称", example = "接口1")
    private String name;
    @ApiModelProperty(value = "模块id", example = "模块1d")
    private String moduleId;
    @ApiModelProperty(value = "模块名称", example = "模块名称")
    private String moduleName;
    @ApiModelProperty(value = "方法名", example = "方法1")
    private String methodName;
    @ApiModelProperty(value = "协议类型(2restful,1webservice)", example = "1")
    private Integer protocolType;
    @ApiModelProperty(value = "开发程度(1公开,2私有)", example = "1")
    private Integer openLevel;
    @ApiModelProperty(value = "审计程度(1审计,2不审计)", example = "1")
    private Integer checkLevel;
    @ApiModelProperty(value = "状态(1生效中,0已失效)", example = "1")
    private Integer status;
    @ApiModelProperty(value = "接口说明", example = "明")
    private String remark;
    @ApiModelProperty(value = "https请求地址", example = "")
    private String url;
    @ApiModelProperty(value = "入参", example = "")
    private List<SaasInterfaceParamVO> entryParams;
    @ApiModelProperty(value = "出参", example = "")
    private List<SaasInterfaceParamVO> outParams;
    @ApiModelProperty(value = "错误说明", example = "")
    private List<SaasInterfaceErrorCodeVO> errorCodes;
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getInterfaceId() {
        return interfaceId;
    }
    public void setInterfaceId(String interfaceId) {
        this.interfaceId = interfaceId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getModuleId() {
        return moduleId;
    }
    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }
    public String getModuleName() {
        return moduleName;
    }
    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }
    public String getMethodName() {
        return methodName;
    }
    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }
    public Integer getProtocolType() {
        return protocolType;
    }
    public void setProtocolType(Integer protocolType) {
        this.protocolType = protocolType;
    }
    public Integer getOpenLevel() {
        return openLevel;
    }
    public void setOpenLevel(Integer openLevel) {
        this.openLevel = openLevel;
    }
    public Integer getCheckLevel() {
        return checkLevel;
    }
    public void setCheckLevel(Integer checkLevel) {
        this.checkLevel = checkLevel;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public List<SaasInterfaceParamVO> getEntryParams() {
        return entryParams;
    }
    public void setEntryParams(List<SaasInterfaceParamVO> entryParams) {
        this.entryParams = entryParams;
    }
    public List<SaasInterfaceParamVO> getOutParams() {
        return outParams;
    }
    public void setOutParams(List<SaasInterfaceParamVO> outParams) {
        this.outParams = outParams;
    }
    public List<SaasInterfaceErrorCodeVO> getErrorCodes() {
        return errorCodes;
    }
    public void setErrorCodes(List<SaasInterfaceErrorCodeVO> errorCodes) {
        this.errorCodes = errorCodes;
    }
}

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/module/SaasInterfaceDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.base.dao.module;
import com.yihu.jw.entity.base.module.SaasInterfaceDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 租户接口
 * @author yeshijie on 2018/10/11.
 */
public interface SaasInterfaceDao extends PagingAndSortingRepository<SaasInterfaceDO, String>, JpaSpecificationExecutor<SaasInterfaceDO> {
}

+ 15 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/module/SaasInterfaceErrorCodeDao.java

@ -0,0 +1,15 @@
package com.yihu.jw.base.dao.module;
import com.yihu.jw.entity.base.module.SaasInterfaceErrorCodeDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 接口错误说明
 * @author yeshijie on 2018/10/11.
 */
public interface SaasInterfaceErrorCodeDao extends PagingAndSortingRepository<SaasInterfaceErrorCodeDO, String>,
        JpaSpecificationExecutor<SaasInterfaceErrorCodeDO> {
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/module/SaasInterfaceParamDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.dao.module;
import com.yihu.jw.entity.base.module.SaasInterfaceParamDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 接口入参出参
 * @author yeshijie on 2018/10/11.
 */
public interface SaasInterfaceParamDao extends PagingAndSortingRepository<SaasInterfaceParamDO, String>, JpaSpecificationExecutor<SaasInterfaceParamDO> {
}

+ 10 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/module/ModuleService.java

@ -50,7 +50,17 @@ public class ModuleService extends BaseJpaService<ModuleDO, ModuleDao> {
            moduleDO.setParentId(CommonContant.DEFAULT_PARENTID);
        }
        moduleDO.setDel(1);
        moduleDO.setIsEnd(1);
        moduleDao.save(moduleDO);
        //父节点设置非根节点
        if(!CommonContant.DEFAULT_PARENTID.equals(moduleDO.getParentId())){
            ModuleDO parentModule = moduleDao.findOne(moduleDO.getParentId());
            if(ModuleDO.End.no.getValue().equals(parentModule.getIsEnd())){
                parentModule.setIsEnd(ModuleDO.End.have.getValue());
                moduleDao.save(parentModule);
            }
        }
        //若新增某必选业务模块,则需为所有已创建的租户和租户类型添加此业务模块
        addSubModule(moduleDO);