This commit is contained in:
parent
62b4f2ddf8
commit
8f7ea27575
|
|
@ -75,7 +75,7 @@ public class InterTableController extends HcyBaseController {
|
||||||
* 预览代码(工作流)
|
* 预览代码(工作流)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ApiOperation("预览代码测试")
|
@ApiOperation("预览代码(工作流)")
|
||||||
@GetMapping("/classpreview/{id}")
|
@GetMapping("/classpreview/{id}")
|
||||||
public AjaxResult classPreview(@PathVariable("id") Long id){
|
public AjaxResult classPreview(@PathVariable("id") Long id){
|
||||||
try {
|
try {
|
||||||
|
|
@ -94,7 +94,7 @@ public class InterTableController extends HcyBaseController {
|
||||||
/**
|
/**
|
||||||
* 预览代码(工作台)
|
* 预览代码(工作台)
|
||||||
*/
|
*/
|
||||||
@ApiOperation("预览代码,工作台")
|
@ApiOperation("预览代码(工作台)")
|
||||||
@GetMapping("/modulepreview/{id}")
|
@GetMapping("/modulepreview/{id}")
|
||||||
public AjaxResult modulePreview(@PathVariable("id") Long id){
|
public AjaxResult modulePreview(@PathVariable("id") Long id){
|
||||||
try {
|
try {
|
||||||
|
|
@ -104,6 +104,7 @@ public class InterTableController extends HcyBaseController {
|
||||||
dataMap.put("Test02.java","Test02.java");
|
dataMap.put("Test02.java","Test02.java");
|
||||||
dataMap.put("Test03.java","Test03.java");
|
dataMap.put("Test03.java","Test03.java");
|
||||||
dataMap.put("Test04.java","Test04.java");
|
dataMap.put("Test04.java","Test04.java");
|
||||||
|
ServerResult<Map<String,String>> serverResult = interTableService.previewCodeMoudle(id);
|
||||||
return AjaxResult.success(dataMap);
|
return AjaxResult.success(dataMap);
|
||||||
}catch (RuntimeException e){
|
}catch (RuntimeException e){
|
||||||
logger.error(e.getMessage());
|
logger.error(e.getMessage());
|
||||||
|
|
|
||||||
|
|
@ -63,5 +63,15 @@ public interface InterTableService
|
||||||
*/
|
*/
|
||||||
ServerResult<Integer> deleteInterTableById(Long id);
|
ServerResult<Integer> deleteInterTableById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览代码(工作流)
|
||||||
|
*
|
||||||
|
* @param cid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
ServerResult<Map<String,String>> previewCodeCalss(Long cid);
|
ServerResult<Map<String,String>> previewCodeCalss(Long cid);
|
||||||
|
|
||||||
|
ServerResult<Map<String,String>> previewCodeMoudle(Long mid);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -17,7 +17,6 @@ import com.hchyun.generator.entity.Apiclass;
|
||||||
import com.hchyun.generator.entity.Module;
|
import com.hchyun.generator.entity.Module;
|
||||||
import com.hchyun.generator.util.InterTableUtils;
|
import com.hchyun.generator.util.InterTableUtils;
|
||||||
import com.hchyun.generator.util.VelocityInitializer;
|
import com.hchyun.generator.util.VelocityInitializer;
|
||||||
import com.sun.org.apache.regexp.internal.RE;
|
|
||||||
import org.apache.velocity.Template;
|
import org.apache.velocity.Template;
|
||||||
import org.apache.velocity.VelocityContext;
|
import org.apache.velocity.VelocityContext;
|
||||||
import org.apache.velocity.app.Velocity;
|
import org.apache.velocity.app.Velocity;
|
||||||
|
|
@ -212,6 +211,22 @@ public class InterTableServiceImpl implements InterTableService {
|
||||||
return new ServerResult<Map<String,String>>(false,ReturnConstants.DB_EX);
|
return new ServerResult<Map<String,String>>(false,ReturnConstants.DB_EX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServerResult<Map<String, String>> previewCodeMoudle(Long mid) {
|
||||||
|
try {
|
||||||
|
Map<String,String> dataMap = new LinkedHashMap<String,String>();
|
||||||
|
List<InterTable> interTableList = interTableDao.selectInterTableModule(mid);
|
||||||
|
VelocityInitializer.initVelocity();
|
||||||
|
VelocityContext context = InterTableUtils.prepareMoudleContext(interTableList);
|
||||||
|
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return new ServerResult<Map<String,String>>(false,ReturnConstants.DB_EX);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public String getJavaClassName(String cName){
|
public String getJavaClassName(String cName){
|
||||||
return InterTableUtils.getUpperCase(cName) + "Controller.java";
|
return InterTableUtils.getUpperCase(cName) + "Controller.java";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class InterTableUtils {
|
public class InterTableUtils {
|
||||||
|
public static VelocityContext prepareMoudleContext(List<InterTable> interTableList){
|
||||||
|
|
||||||
|
return new VelocityContext();
|
||||||
|
}
|
||||||
public static VelocityContext prepareClassContext(Apiclass apiclass) {
|
public static VelocityContext prepareClassContext(Apiclass apiclass) {
|
||||||
VelocityContext velocityContext = new VelocityContext();
|
VelocityContext velocityContext = new VelocityContext();
|
||||||
boolean permission = false;
|
boolean permission = false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue