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