main
黄海 9 months ago
parent 669b872cad
commit 0e03d58bba

@ -0,0 +1,10 @@
/**
* 增加维修故障类型字典
* @param type_name 类型名称
*/
@Before({POST.class})
@JwtCheckInterface({})
public void addWxFaultType(String type_name ){
ym.addWxFaultType(type_name );
renderJson(RetKit.renderSuccess());
}

@ -13,6 +13,8 @@ import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
@ -455,6 +457,7 @@ public class GenerateCodeWithFreeMaker {
Configuration cfg = new Configuration(new Version(2, 3, 33));
// 设置模板目录
String path = System.getProperty("user.dir") + "/dsUtils/src/main/resources";
String codePath = System.getProperty("user.dir") + "/dsUtils/src/main/java/com/dsideal/Code";
cfg.setDirectoryForTemplateLoading(new File(path));
// 设置字符编码
cfg.setDefaultEncoding("UTF-8");
@ -462,7 +465,7 @@ public class GenerateCodeWithFreeMaker {
Template template = cfg.getTemplate("Controller.ftl");
// 渲染模板到文件
Writer out = new FileWriter("c:/output_users.txt");
Writer out = new FileWriter(codePath +"/"+ table + ".txt", StandardCharsets.UTF_8);
template.process(dataModel, out);
out.close();
}

@ -1,7 +0,0 @@
列表<br/>
<#list users as user>
<li>${user.name} - ${user.age}</li>
</#list>
变量<br/>
${title}

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>User List</title>
</head>
<body>
<h1>User List</h1>
<ul>
<li>Alice - 25</li>
<li>Bob - 30</li>
<li>Charlie - 35</li>
</ul>
</body>
</html>
Loading…
Cancel
Save