-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhangshibin
committed
Jun 16, 2019
1 parent
1d607ce
commit 8ac22ec
Showing
90 changed files
with
1,732 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,5 @@ temp_output/ | |
*.db | ||
.DS_Store | ||
code_output/ | ||
tableModel/ | ||
tableModel/ | ||
molicode_repos/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
molicode-common/src/main/groovy/com/shareyi/molicode/common/vo/git/GitRepoVo.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.shareyi.molicode.common.vo.git; | ||
|
||
/** | ||
* git仓库相关配置 | ||
* | ||
* @author zhangshibin | ||
* @date 2019/6/14 | ||
*/ | ||
class GitRepoVo { | ||
/** | ||
* 远程地址 | ||
*/ | ||
String gitUrl; | ||
|
||
/** | ||
* 分支名称 | ||
*/ | ||
String branchName; | ||
/** | ||
* 用户名 | ||
*/ | ||
String userName; | ||
/** | ||
* 密码 | ||
*/ | ||
String password; | ||
|
||
/** | ||
* 加密密码 | ||
*/ | ||
String encryptPassword; | ||
|
||
/** | ||
* 模板相对路径 | ||
*/ | ||
String templateRelativePath; | ||
|
||
@Override | ||
String toString() { | ||
return "GitRepoVo{" + | ||
"gitUrl='" + gitUrl + '\'' + | ||
", branchName='" + branchName + '\'' + | ||
", userName='" + userName + '\'' + | ||
", password='" + password + '\'' + | ||
", encryptPassword='" + encryptPassword + '\'' + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
molicode-common/src/main/java/com/shareyi/molicode/common/enums/OutputTypeEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.shareyi.molicode.common.enums; | ||
|
||
/** | ||
* 输出方式枚举 | ||
* | ||
* @author zhangshibin | ||
* @date 2019/6/16 | ||
*/ | ||
public enum OutputTypeEnum implements EnumCode<String> { | ||
|
||
LOCAL_DIR("1", "本地文件"), | ||
ZIP_FILE("2", "zip文件"), | ||
FRONT_CONSOLE("3", "前台"); | ||
|
||
String code, desc; | ||
|
||
OutputTypeEnum(String code, String desc) { | ||
this.code = code; | ||
this.desc = desc; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public String getDesc() { | ||
return desc; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
molicode-common/src/main/java/com/shareyi/molicode/common/enums/RepoTypeEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.shareyi.molicode.common.enums; | ||
|
||
/** | ||
* 仓库类型 | ||
* | ||
* @author zhangshibin | ||
* @date 2019/6/10 | ||
*/ | ||
public enum RepoTypeEnum implements EnumCode<String> { | ||
|
||
SAMPLE_PROJECT("sampleProject", "示例工程"), | ||
TEMPLATE("template", "模板仓库"); | ||
|
||
private String code; | ||
private String desc; | ||
|
||
RepoTypeEnum(String code, String desc) { | ||
this.code = code; | ||
this.desc = desc; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public String getDesc() { | ||
return desc; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
molicode-common/src/main/java/com/shareyi/molicode/common/utils/CostWatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package com.shareyi.molicode.common.utils; | ||
|
||
import com.shareyi.molicode.common.valid.Validate; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
/** | ||
* 用时监控表 | ||
* | ||
* @author zhangshibin | ||
* @date 2019/6/15 | ||
*/ | ||
public class CostWatch { | ||
|
||
/** | ||
* 起始时间 | ||
*/ | ||
private Long startTime; | ||
/** | ||
* 结束时间 | ||
*/ | ||
private Long stopTime; | ||
|
||
public Long getStartTime() { | ||
return startTime; | ||
} | ||
|
||
public void setStartTime(Long startTime) { | ||
this.startTime = startTime; | ||
} | ||
|
||
public Long getStopTime() { | ||
return stopTime; | ||
} | ||
|
||
public void setStopTime(Long stopTime) { | ||
this.stopTime = stopTime; | ||
} | ||
|
||
/** | ||
* 创建一个已经启动的表 | ||
* | ||
* @return | ||
*/ | ||
public static CostWatch createStarted() { | ||
CostWatch costWatch = new CostWatch(); | ||
costWatch.start(); | ||
return costWatch; | ||
} | ||
|
||
/** | ||
* 启动 | ||
*/ | ||
public void start() { | ||
this.startTime = System.currentTimeMillis(); | ||
} | ||
|
||
public void stop() { | ||
this.stopTime = System.currentTimeMillis(); | ||
} | ||
|
||
/** | ||
* 获取耗时 | ||
* | ||
* @param timeUnit | ||
* @return | ||
*/ | ||
public long getCost(TimeUnit timeUnit) { | ||
long cost = getCost(); | ||
switch (timeUnit) { | ||
case DAYS: | ||
return cost / (24 * 3600 * 1000); | ||
case HOURS: | ||
return cost / (3600 * 1000); | ||
case MINUTES: | ||
return cost / (60 * 1000); | ||
case SECONDS: | ||
return cost / (1 * 1000); | ||
case MILLISECONDS: | ||
return cost; | ||
default: | ||
Validate.assertTrue(false, "不支持的类型"); | ||
} | ||
return 0; | ||
} | ||
|
||
/** | ||
* 获取耗时 毫秒 | ||
* | ||
* @return | ||
*/ | ||
private long getCost() { | ||
return stopTime - startTime; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.