Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/xml parser #3

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b4111bb
修改xml结构、驱动数据,增加占位符替换功能
vincent-ren Jan 31, 2018
64fa2c0
支持Generator单例
vincent-ren Feb 2, 2018
d6c3e05
eureka组件整合
vincent-ren Feb 6, 2018
04a0975
添加zipkin组件
vincent-ren Feb 7, 2018
7513e1d
提取组件配置文件位置为常量
vincent-ren Feb 7, 2018
f2d4a53
增加springmvc组件
vincent-ren Feb 7, 2018
51cfda9
初步提交sc-config 配置项目类的相关模板信息和配置信息。
zhongzunfa Feb 9, 2018
e2de133
添加Zuul 组件信息。
zhongzunfa Feb 9, 2018
6362235
修改zuul 和 父里面的pom。
zhongzunfa Feb 9, 2018
7dfaa09
common组件添加
vincent-ren Feb 10, 2018
685b715
修改包名和类名
SoftwareKing Feb 10, 2018
592c19a
动态目录设置为临时目录
SoftwareKing Feb 10, 2018
c1dbeca
支持common组件
vincent-ren Feb 10, 2018
4350669
fix conflict
vincent-ren Feb 10, 2018
c7c20f8
fix conflict
vincent-ren Feb 10, 2018
e7b7bdf
接口文档说明
vincent-ren Feb 28, 2018
f9b29eb
修改组件id
vincent-ren Feb 28, 2018
14438e2
修改接口说明
vincent-ren Feb 28, 2018
fbc208e
增加接口说明
vincent-ren Feb 28, 2018
aaaf275
fixed ziputils
lyl2008dsg Mar 1, 2018
a12dd64
Merge branch 'feature/xmlParser' of https://github.com/venusteam/code…
lyl2008dsg Mar 1, 2018
223e51a
fixed ziputils
lyl2008dsg Mar 1, 2018
965ca2e
修改web请求入参为entity
vincent-ren Mar 8, 2018
4a1911d
修改请求入参实体
Jun 7, 2018
f352b4e
切换入参模型
vincent-ren Jun 10, 2018
cb9d500
定义chooseComponent组件值
vincent-ren Jun 11, 2018
8f8ec17
随机生成目录
vincent-ren Jul 3, 2018
2088806
修改响应contentType
vincent-ren Jul 3, 2018
d49514e
修改生成目录,添加springboot打包插件
vincent-ren Jul 3, 2018
c7df240
修改类加载器
vincent-ren Jul 4, 2018
2bcce39
删除多余log
vincent-ren Jul 4, 2018
27672c1
新增返回byte接口
vincent-ren Jul 10, 2018
ab6ef56
fixed cannot unizp
Jul 22, 2018
90532a9
fixed cannot unizp
Jul 22, 2018
9c8df02
更改为get方式
Sep 11, 2018
450387e
更改为get方式
Sep 11, 2018
3ae994b
更改为get方式
Sep 11, 2018
3cb3c5f
Re initialization
lyl2008dsg Oct 26, 2018
ea445ea
Re initialization
lyl2008dsg Oct 26, 2018
dd1370e
删除,调试前端
SoftwareKing Oct 26, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ __pycache__/
# SVN metadata
.svn/

/codegen-ui/node_modules/

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ public ProjectConfig deepClone() throws IOException, ClassNotFoundException {
dc = (ProjectConfig)bis.readObject();
return dc;
}

}
17 changes: 17 additions & 0 deletions codegen-component-common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>codegen-component-common</artifactId>

<name>codegen-component-common</name>
<description>codegen common componet </description>

<parent>
<artifactId>codegen</artifactId>
<groupId>cn.springcloud.codegen</groupId>
<version>1.0.0</version>
<relativePath>..</relativePath>
</parent>

</project>
42 changes: 42 additions & 0 deletions codegen-component-common/src/main/resources/componentConfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<component id= "FileCommon" type= "common">
<generator>
<templateData>
<templateName>file.gitattributes.ftl</templateName>
<templateDir>templates/common/</templateDir>
<templateConfigEncode>UTF-8</templateConfigEncode>
</templateData>
<fileData>
<fileType>gitattributes</fileType>
<fileName>file</fileName>
<isJavaOrResourcesOrOtherCode>CodeOutType.NONE</isJavaOrResourcesOrOtherCode>
</fileData>
</generator>
<generator>
<templateData>
<templateName>file.gitignore.ftl</templateName>
<templateDir>templates/common/</templateDir>
<templateConfigEncode>UTF-8</templateConfigEncode>
</templateData>
<fileData>
<fileType>gitignore</fileType>
<fileName>file</fileName>
<isJavaOrResourcesOrOtherCode>CodeOutType.NONE</isJavaOrResourcesOrOtherCode>
</fileData>
</generator>
<generator>
<templateData>
<templateName>logback.xml.ftl</templateName>
<templateDir>templates/common/</templateDir>
<templateConfigEncode>UTF-8</templateConfigEncode>
</templateData>
<variableData>
<templateVariable key="serviceName" value="${projectName}"/>
</variableData>
<fileData>
<fileType>xml</fileType>
<fileName>logback</fileName>
<isJavaOrResourcesOrOtherCode>CodeOutType.RESOURCES</isJavaOrResourcesOrOtherCode>
</fileData>
</generator>
</component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Declare files that will always have UNIX line endings on checkout.
*.sh text eol=lf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Compiled class file
*.class
.classpath
.springBeans
# Mobile Tools for Java (J2ME)
.mtj.tmp/

*.class
*.classpath
*.project
*.springBeans
log/
test-output/

# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
*.swp
*.log
*.ctxt
# nodejs local modules
.tags*
.idea/
*.iml
.gradle/
.settings/
target/
hs_err_pid*
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
<configuration scan="true" scanPeriod="10 seconds">
<!-- Simple file output -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>${serviceName} %date %level [%thread] %logger{10} [%file:%line] - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>log/${serviceName}-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
</rollingPolicy>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<!-- Safely log to the same file from multiple JVMs. Degrades performance! -->
<prudent>true</prudent>
</appender>

<appender name ="FILE_ASYNC" class= "ch.qos.logback.classic.AsyncAppender">
<discardingThreshold>0</discardingThreshold>
<queueSize>512</queueSize>
<appender-ref ref ="FILE"/>
</appender>

<!-- Console output -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>${serviceName} %date %level [%thread] %logger{10} [%file:%line] - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- Only log level WARN and above -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
</appender>

<!-- For loggers in the these namespaces, log at all levels. -->
<logger name="pedestal" level="ALL" />
<logger name="hammock-cafe" level="ALL" />
<logger name="user" level="ALL" />

<root level="INFO">
<!-- <appender-ref ref="FILE_ASYNC" /> -->
<appender-ref ref="STDOUT" />
</root>
</configuration>
14 changes: 14 additions & 0 deletions codegen-component-config/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>codegen</artifactId>
<groupId>cn.springcloud.codegen</groupId>
<version>1.0.0</version>
<relativePath>..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>codegen-component-config</artifactId>
</project>
53 changes: 53 additions & 0 deletions codegen-component-config/src/main/resources/componentConfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<component id="config-server">
<generator>
<templateData>
<templateName>ConfigApplication.java.ftl</templateName>
<templateDir>templates/config/java/</templateDir>
<templateConfigEncode>UTF-8</templateConfigEncode>
</templateData>
<variableData>
<templateVariable key="packageName" value="${basePackage}.config"/>
</variableData>
<fileData>
<packageName>${basePackage}.config</packageName>
<fileType>java</fileType>
<fileName>ConfigApplication</fileName>
<isJavaOrResourcesOrOtherCode>CodeOutType.JAVA</isJavaOrResourcesOrOtherCode>
</fileData>
</generator>
<generator>
<templateData>
<templateName>application.properties.ftl</templateName>
<templateDir>templates/config/resources/</templateDir>
<templateConfigEncode>UTF-8</templateConfigEncode>
</templateData>
<variableData>
<templateVariable key="serviceName" value="${projectName}"/>
</variableData>
<fileData>
<fileType>properties</fileType>
<fileName>application</fileName>
<isJavaOrResourcesOrOtherCode>CodeOutType.RESOURCES</isJavaOrResourcesOrOtherCode>
</fileData>
</generator>
<generator>
<templateData>
<templateName>pom.xml.ftl</templateName>
<templateDir>templates/config/</templateDir>
<templateConfigEncode>UTF-8</templateConfigEncode>
</templateData>
<variableData>
<templateVariable key="pomArtifactId" value="${pomArtifactId}"/>
<templateVariable key="projectName" value="${projectName}"/>
<templateVariable key="springBootVersion" value="${springBootVersion}"/>
<templateVariable key="javaVersion" value="${javaVersion}"/>
<templateVariable key="groupId" value="${groupId}"/>
</variableData>
<fileData>
<fileType>xml</fileType>
<fileName>pom</fileName>
<isJavaOrResourcesOrOtherCode>CodeOutType.NONE</isJavaOrResourcesOrOtherCode>
</fileData>
</generator>
</component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>${groupId}</groupId>
<artifactId>${pomArtifactId}</artifactId>
<name>${projectName}</name>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${springBootVersion}.RELEASE</version>
</parent>

<properties>
<spring.cloud.version>Dalston.SR4</spring.cloud.version>
<java.version>${javaVersion}</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${r"$"}{spring.cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
</dependencies>


<build>
<finalName>${r"$"}{project.artifactId}-${r"$"}{project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
<encoding>${r"$"}{project.build.sourceEncoding}</encoding>
<source>${r"$"}{java.version}</source>
<target>${r"$"}{java.version}</target>
</configuration>
</plugin>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
<mainClass>${mainClass}</mainClass>
<layout>JAR</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<attach>false</attach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
spring.application.name=${serviceName}
server.port=8762

# 换成实际开发地址即可
spring.cloud.config.server.git.uri=你git的地址

# 下面三个参数根据实际情况配置
# spring.cloud.config.server.git.username=
# spring.cloud.config.server.git.password=
# spring.cloud.config.server.git.search-paths=
13 changes: 13 additions & 0 deletions codegen-component-eureka/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>codegen</artifactId>
<groupId>cn.springcloud.codegen</groupId>
<version>1.0.0</version>
<relativePath>..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>codegen-component-eureka</artifactId>
</project>
Loading