This commit is contained in:
parent
e8fe91ed6e
commit
17358bf2cd
|
|
@ -98,14 +98,12 @@ public class InterTableController extends HcyBaseController {
|
|||
@GetMapping("/modulepreview/{id}")
|
||||
public AjaxResult modulePreview(@PathVariable("id") Long id){
|
||||
try {
|
||||
Map<String,String> dataMap = new HashMap<>();
|
||||
dataMap.put("Test00.java","Test00.java");
|
||||
dataMap.put("Test01.java","Test01.java");
|
||||
dataMap.put("Test02.java","Test02.java");
|
||||
dataMap.put("Test03.java","Test03.java");
|
||||
dataMap.put("Test04.java","Test04.java");
|
||||
ServerResult<Map<String,Object>> serverResult = interTableService.previewCodeMoudle(id);
|
||||
return AjaxResult.success(dataMap);
|
||||
if (serverResult.isStart()){
|
||||
return AjaxResult.success(serverResult.getData());
|
||||
}else {
|
||||
return AjaxResult.error(serverResult.getMsg());
|
||||
}
|
||||
}catch (RuntimeException e){
|
||||
logger.error(e.getMessage());
|
||||
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||
|
|
|
|||
|
|
@ -219,14 +219,13 @@ public class InterTableServiceImpl implements InterTableService {
|
|||
List<InterTable> interTableList = interTableDao.selectInterTableModule(mid);
|
||||
VelocityInitializer.initVelocity();
|
||||
List<VelocityContext> contextList = InterTableUtils.prepareMoudleContext(interTableList);
|
||||
String templates = InterTableUtils.getTemplateList(1);
|
||||
String templates = InterTableUtils.getTemplateList(2);
|
||||
for (VelocityContext context : contextList){
|
||||
StringWriter sw = new StringWriter();
|
||||
Template template = Velocity.getTemplate(templates, Constants.UTF8);
|
||||
template.merge(context,sw);
|
||||
dataMap.put(getJavaClassName(context.get("ClassName")),sw.toString());
|
||||
dataMap.put(getJavaClassName((String) context.get("ClassName")),sw.toString());
|
||||
}
|
||||
dataMap.put("data",contextList);
|
||||
return new ServerResult<Map<String,Object>>(true,dataMap);
|
||||
}catch (RuntimeException e){
|
||||
logger.error(e.getMessage());
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package ${packageName}controller;
|
||||
package ${packageName}.controller;
|
||||
|
||||
/**
|
||||
* ${ClassName} ${functionName}
|
||||
|
|
@ -7,9 +7,13 @@ package ${packageName}controller;
|
|||
* @Email ${emali}
|
||||
* @Date ${time}
|
||||
*/
|
||||
import com.hchyun.common.annotation.Log;
|
||||
import com.hchyun.common.constant.ReturnConstants;
|
||||
import com.hchyun.common.core.controller.BaseController;
|
||||
import com.hchyun.common.core.entity.AjaxResult;
|
||||
import com.hchyun.common.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
|
@ -23,7 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import java.util.Map;
|
||||
#if($Permission)
|
||||
@Api("${functionName}")
|
||||
@Api(value = "${functionName}",tags = "${functionName}")
|
||||
#end
|
||||
@RestController
|
||||
@RequestMapping("${reqMapping}")
|
||||
|
|
@ -42,7 +46,11 @@ public class ${ClassName}Controller extends BaseController{
|
|||
@Log(title = "${column.itDescribe}", businessType = BusinessType.INSERT)
|
||||
#end
|
||||
@${column.method}Mapping("/${column.requrl}")
|
||||
#if($column.method.equals("Get"))
|
||||
public AjaxResult ${InterName} ( Map<String,String> parms){
|
||||
#else
|
||||
public AjaxResult ${InterName} (@RequestBody Map<String,String> parms){
|
||||
#end
|
||||
try {
|
||||
return AjaxResult.success("${column.itDescribe}测试!");
|
||||
}catch (RuntimeException e){
|
||||
|
|
|
|||
Loading…
Reference in New Issue