From 3967854cd2f624da88584e2f83398ddf83af13c3 Mon Sep 17 00:00:00 2001 From: "20932067@zju.edu.cn" Date: Thu, 28 Jan 2021 23:17:27 +0800 Subject: [PATCH] 11 --- .../views/tool/apiclass/apiclassInfoForm.vue | 125 +++++------ hchyun-ui/src/views/tool/apiclass/index.vue | 16 +- hchyun-ui/src/views/tool/gen/index.vue | 1 + hchyun-ui/src/views/tool/module/index.vue | 8 +- .../common/constant/ReturnConstants.java | 4 + .../controller/InterTableController.java | 196 +++++++++++------- .../generator/service/InterTableService.java | 14 ++ .../service/impl/InterTableServiceImpl.java | 136 ++++++++---- 8 files changed, 324 insertions(+), 176 deletions(-) diff --git a/hchyun-ui/src/views/tool/apiclass/apiclassInfoForm.vue b/hchyun-ui/src/views/tool/apiclass/apiclassInfoForm.vue index cc6e904..120eeb0 100644 --- a/hchyun-ui/src/views/tool/apiclass/apiclassInfoForm.vue +++ b/hchyun-ui/src/views/tool/apiclass/apiclassInfoForm.vue @@ -52,67 +52,68 @@ diff --git a/hchyun-ui/src/views/tool/apiclass/index.vue b/hchyun-ui/src/views/tool/apiclass/index.vue index 4efb8ef..2bc61e0 100644 --- a/hchyun-ui/src/views/tool/apiclass/index.vue +++ b/hchyun-ui/src/views/tool/apiclass/index.vue @@ -222,7 +222,11 @@ import {queryListModule} from "@/api/tool/module" import {getClassPreview} from "@/api/tool/interTable" import hljs from "highlight.js/lib/highlight"; + import "highlight.js/styles/github-gist.css"; + import {genCode} from "@/api/tool/gen"; + import {downLoadZip} from "@/utils/zipdownload"; hljs.registerLanguage("java", require("highlight.js/lib/languages/java")); + hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql")); export default { name: "Apiclass", components: {}, @@ -307,17 +311,23 @@ methods: { /** 预览代码 */ handlePreview(id){ - getClassPreview(3).then(res =>{ + console.log(id) + getClassPreview(id).then(res =>{ this.preview.data = res.data; this.preview.open = true; var keys = Object.keys(res.data) this.preview.activeName = keys[0] }) }, + /** 生成代码操作 */ + handleGenTable(row) { + downLoadZip("/generator/intertable/classgen/" + row.id, "hchyun"); + }, /** 高亮显示 */ highlightedCode(code, key) { const vmName = key; var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length); + console.log(language) const result = hljs.highlight(language, code || "", true); return result.value || ' '; }, @@ -352,8 +362,8 @@ if (start) { str = '' } - this.form.packageName = 'com.hchyun.' + str +"." - this.form.prefix = str+":"+this.form.cName + ":" + this.form.packageName = 'com.hchyun.' + str + this.form.prefix = str+":"+this.form.cName.toLowerCase() }, // 表单重置 reset() { diff --git a/hchyun-ui/src/views/tool/gen/index.vue b/hchyun-ui/src/views/tool/gen/index.vue index 46b05fb..9a00514 100644 --- a/hchyun-ui/src/views/tool/gen/index.vue +++ b/hchyun-ui/src/views/tool/gen/index.vue @@ -306,6 +306,7 @@ export default { highlightedCode(code, key) { const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm")); var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length); + console.log(language) const result = hljs.highlight(language, code || "", true); return result.value || ' '; }, diff --git a/hchyun-ui/src/views/tool/module/index.vue b/hchyun-ui/src/views/tool/module/index.vue index 524ffbb..97ba1e7 100644 --- a/hchyun-ui/src/views/tool/module/index.vue +++ b/hchyun-ui/src/views/tool/module/index.vue @@ -104,7 +104,7 @@ type="text" size="small" icon="el-icon-view" - @click="handlePreview(scope.row)" + @click="handlePreview(scope.row.id)" v-hasPermi="['tool:apiclass:preview']" >预览 { + console.log(id) + getModulePreview(id).then(res=>{ this.preview.data = res.data; this.preview.open = true; var keys = Object.keys(res.data) @@ -256,6 +259,7 @@ export default { highlightedCode(code, key) { const vmName = key; var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length); + console.log(language) const result = hljs.highlight(language, code || "", true); return result.value || ' '; }, diff --git a/hchyun/hchyun-common/src/main/java/com/hchyun/common/constant/ReturnConstants.java b/hchyun/hchyun-common/src/main/java/com/hchyun/common/constant/ReturnConstants.java index 288e55e..e7c7f33 100644 --- a/hchyun/hchyun-common/src/main/java/com/hchyun/common/constant/ReturnConstants.java +++ b/hchyun/hchyun-common/src/main/java/com/hchyun/common/constant/ReturnConstants.java @@ -18,4 +18,8 @@ public class ReturnConstants { * 操作失败 */ public static final String SYS_FAILL = "数据库异常!"; + /** + * 接口为空 + */ + public static final String INTER_NULL = "该类下接口数据为空,请先添加接口!"; } diff --git a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/InterTableController.java b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/InterTableController.java index 829f022..607257d 100644 --- a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/InterTableController.java +++ b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/InterTableController.java @@ -1,5 +1,6 @@ package com.hchyun.generator.controller; +import java.io.IOException; import java.io.Serializable; import java.util.HashMap; import java.util.List; @@ -14,6 +15,7 @@ import com.hchyun.generator.entity.Apiclass; import com.hchyun.generator.service.ApiclassService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.access.prepost.PreAuthorize; @@ -34,6 +36,8 @@ import com.hchyun.generator.entity.InterTable; import com.hchyun.generator.service.InterTableService; import com.hchyun.common.utils.poi.ExcelUtil; +import javax.servlet.http.HttpServletResponse; + /** * 接口信息Controller * @@ -76,16 +80,18 @@ public class InterTableController extends HcyBaseController { */ @ApiOperation("预览代码(工作流)") + @PreAuthorize("@ss.hasPermi('generator:intertable:classpreview')") + @Log(title = "预览代码(工作流)", businessType = BusinessType.GENCODE) @GetMapping("/classpreview/{id}") - public AjaxResult classPreview(@PathVariable("id") Long id){ + public AjaxResult classPreview(@PathVariable("id") Long id) { try { - ServerResult> serverResult = interTableService.previewCodeCalss(id); - if (serverResult.isStart()){ + ServerResult> serverResult = interTableService.previewCodeCalss(id); + if (serverResult.isStart()) { return AjaxResult.success(serverResult.getData()); - }else { + } else { return AjaxResult.error(serverResult.getMsg()); } - }catch (RuntimeException e){ + } catch (RuntimeException e) { logger.error(e.getMessage()); return AjaxResult.error(ReturnConstants.SYS_ERROR); } @@ -95,54 +101,16 @@ public class InterTableController extends HcyBaseController { * 预览代码(工作台) */ @ApiOperation("预览代码(工作台)") + @PreAuthorize("@ss.hasPermi('generator:intertable:modulepreview')") + @Log(title = "预览代码(工作台)", businessType = BusinessType.GENCODE) @GetMapping("/modulepreview/{id}") - public AjaxResult modulePreview(@PathVariable("id") Long id){ + public AjaxResult modulePreview(@PathVariable("id") Long id) { try { - ServerResult> serverResult = interTableService.previewCodeMoudle(id); - 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); - } - } - -// /** -// * 导出接口信息列表 -// */ -// @PreAuthorize("@ss.hasPermi('generator:intertable:export')") -// @Log(title = "接口信息", businessType = BusinessType.EXPORT) -// @GetMapping("/export") -// public AjaxResult export(InterTable interTable) { -// try { -// ServerResult> serverResult = interTableService.selectInterTableList(interTable); -// ExcelUtil util = new ExcelUtil(InterTable. class); -// if (serverResult.isStart()) { -// return util.exportExcel(serverResult.getData(), "intertable"); -// } else { -// return AjaxResult.error(serverResult.getMsg()); -// } -// } catch (RuntimeException e) { -// logger.error(e.getMessage()); -// return AjaxResult.error(ReturnConstants.SYS_ERROR); -// } -// } - - /** - * 获取接口信息详细信息 - */ - @PreAuthorize("@ss.hasPermi('generator:intertable:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) { - try { - ServerResult serverResult = interTableService.selectInterTableById(id); + ServerResult> serverResult = interTableService.previewCodeMoudle(id); if (serverResult.isStart()) { return AjaxResult.success(serverResult.getData()); } else { - return AjaxResult.info(serverResult.getMsg()); + return AjaxResult.error(serverResult.getMsg()); } } catch (RuntimeException e) { logger.error(e.getMessage()); @@ -150,21 +118,27 @@ public class InterTableController extends HcyBaseController { } } + /** - * 新增接口信息 + * 生成代码(工作流) + * + * @param id + * @return */ - @PreAuthorize("@ss.hasPermi('generator:intertable:add')") - @Log(title = "接口信息", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody InterTable interTable) { + @ApiOperation("生成代码(工作流)") + @PreAuthorize("@ss.hasPermi('generator:intertable:classgen')") + @Log(title = "生成代码(工作流)", businessType = BusinessType.GENCODE) + @GetMapping("/classgen/{id}") + public AjaxResult classGenerator(@PathVariable("id") Long id, HttpServletResponse response) { try { - ServerResult serverResult = interTableService.insertInterTable(interTable); + ServerResult serverResult = interTableService.generatorCodeClass(id); if (serverResult.isStart()) { + genCode(response, serverResult.getData()); return AjaxResult.success(); } else { return AjaxResult.error(serverResult.getMsg()); } - } catch (RuntimeException e) { + } catch (RuntimeException | IOException e) { logger.error(e.getMessage()); return AjaxResult.error(ReturnConstants.SYS_ERROR); } @@ -191,25 +165,99 @@ public class InterTableController extends HcyBaseController { } /** - * 删除接口信息 + * 生成zip文件 */ - @PreAuthorize("@ss.hasPermi('generator:intertable:remove')") - @Log(title = "接口信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) { - try { - if (ids.length<0){ - return AjaxResult.error("id不能为空!"); - } - ServerResult serverResult = interTableService.deleteInterTableByIds(ids); - if (serverResult.isStart()) { - return AjaxResult.success(); - } else { - return AjaxResult.error(serverResult.getMsg()); - } - }catch (RuntimeException e){ - logger.error(e.getMessage()); - return AjaxResult.error(ReturnConstants.SYS_ERROR); - } + private void genCode(HttpServletResponse response, byte[] data) throws IOException { + response.reset(); + response.addHeader("Access-Control-Allow-Origin", "*"); + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition"); + response.setHeader("Content-Disposition", "attachment; filename=\"hchyun.zip\""); + response.addHeader("Content-Length", "" + data.length); + response.setContentType("application/octet-stream; charset=UTF-8"); + IOUtils.write(data, response.getOutputStream()); } + + +// /** +// * 导出接口信息列表 +// */ +// @PreAuthorize("@ss.hasPermi('generator:intertable:export')") +// @Log(title = "接口信息", businessType = BusinessType.EXPORT) +// @GetMapping("/export") +// public AjaxResult export(InterTable interTable) { +// try { +// ServerResult> serverResult = interTableService.selectInterTableList(interTable); +// ExcelUtil util = new ExcelUtil(InterTable. class); +// if (serverResult.isStart()) { +// return util.exportExcel(serverResult.getData(), "intertable"); +// } else { +// return AjaxResult.error(serverResult.getMsg()); +// } +// } catch (RuntimeException e) { +// logger.error(e.getMessage()); +// return AjaxResult.error(ReturnConstants.SYS_ERROR); +// } +// } + +// /** +// * 获取接口信息详细信息 +// */ +// @PreAuthorize("@ss.hasPermi('generator:intertable:query')") +// @GetMapping(value = "/{id}") +// public AjaxResult getInfo(@PathVariable("id") Long id) { +// try { +// ServerResult serverResult = interTableService.selectInterTableById(id); +// if (serverResult.isStart()) { +// return AjaxResult.success(serverResult.getData()); +// } else { +// return AjaxResult.info(serverResult.getMsg()); +// } +// } catch (RuntimeException e) { +// logger.error(e.getMessage()); +// return AjaxResult.error(ReturnConstants.SYS_ERROR); +// } +// } +// +// /** +// * 新增接口信息 +// */ +// @PreAuthorize("@ss.hasPermi('generator:intertable:add')") +// @Log(title = "接口信息", businessType = BusinessType.INSERT) +// @PostMapping +// public AjaxResult add(@RequestBody InterTable interTable) { +// try { +// ServerResult serverResult = interTableService.insertInterTable(interTable); +// if (serverResult.isStart()) { +// return AjaxResult.success(); +// } else { +// return AjaxResult.error(serverResult.getMsg()); +// } +// } catch (RuntimeException e) { +// logger.error(e.getMessage()); +// return AjaxResult.error(ReturnConstants.SYS_ERROR); +// } +// } +// +// /** +// * 删除接口信息 +// */ +// @PreAuthorize("@ss.hasPermi('generator:intertable:remove')") +// @Log(title = "接口信息", businessType = BusinessType.DELETE) +// @DeleteMapping("/{ids}") +// public AjaxResult remove(@PathVariable Long[] ids) { +// try { +// if (ids.length<0){ +// return AjaxResult.error("id不能为空!"); +// } +// ServerResult serverResult = interTableService.deleteInterTableByIds(ids); +// if (serverResult.isStart()) { +// return AjaxResult.success(); +// } else { +// return AjaxResult.error(serverResult.getMsg()); +// } +// }catch (RuntimeException e){ +// logger.error(e.getMessage()); +// return AjaxResult.error(ReturnConstants.SYS_ERROR); +// } +// } } \ No newline at end of file diff --git a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/service/InterTableService.java b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/service/InterTableService.java index d14c611..ee0622f 100644 --- a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/service/InterTableService.java +++ b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/service/InterTableService.java @@ -1,6 +1,7 @@ package com.hchyun.generator.service; import java.util.Map; +import java.util.zip.ZipOutputStream; import com.hchyun.common.utils.ServerResult; import com.hchyun.generator.dto.InterTableDto; @@ -70,7 +71,20 @@ public interface InterTableService */ ServerResult> previewCodeCalss(Long cid); + /** + * 预览代码()工作台 + * @param mid + * @return + */ ServerResult> previewCodeMoudle(Long mid); + /** + * 生成代码(工作流) + * @param cid + * @return + */ + ServerResult generatorCodeClass(Long cid); + + } \ No newline at end of file diff --git a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/service/impl/InterTableServiceImpl.java b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/service/impl/InterTableServiceImpl.java index 5355973..3d8652a 100644 --- a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/service/impl/InterTableServiceImpl.java +++ b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/service/impl/InterTableServiceImpl.java @@ -1,10 +1,14 @@ package com.hchyun.generator.service.impl; +import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.io.StringWriter; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; import com.hchyun.common.constant.Constants; import com.hchyun.common.constant.ReturnConstants; @@ -17,6 +21,7 @@ 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 org.apache.commons.io.IOUtils; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.Velocity; @@ -76,16 +81,16 @@ public class InterTableServiceImpl implements InterTableService { @Override public ServerResult> selectInterTableList(InterTable interTable) { try { - Map modeMap = new HashMap(); - if (interTable.getType()==1){ + Map modeMap = new HashMap(); + if (interTable.getType() == 1) { Module module = moduleDao.selectModuleById(interTable.getmId()); - modeMap.put("info",module); - }else if (interTable.getType() == 2){ + modeMap.put("info", module); + } else if (interTable.getType() == 2) { Apiclass apiclass = apiclassDao.selectApiclassById(interTable.getcId()); - modeMap.put("info",apiclass); + modeMap.put("info", apiclass); } List interTableList = interTableDao.selectInterTableList(interTable); - modeMap.put("rows",interTableList); + modeMap.put("rows", interTableList); return new ServerResult>(true, modeMap); } catch (RuntimeException e) { logger.error(e.getMessage()); @@ -127,20 +132,23 @@ public class InterTableServiceImpl implements InterTableService { try { List interTables = interTableDto.getInterTables(); Integer renewal = 0; - if (interTableDto.getModule() == null){ + if (interTableDto.getModule() == null) { Apiclass apiclass = interTableDto.getApiclass(); renewal = apiclassDao.updateApiclass(apiclass); interTableDao.deleteInterTableByClassId(apiclass.getId()); - }else if (interTableDto.getApiclass() == null){ + } else if (interTableDto.getApiclass() == null) { Module module = interTableDto.getModule(); renewal = moduleDao.updateModule(module); interTableDao.deleteInterTableByModuleId(module.getId()); } - for (int i=0;i 0) { + for (int i = 0; i < interTables.size(); i++) { + interTables.get(i).setCreateBy(SecurityUtils.getUserId()); + } + renewalTables = interTableDao.insertInterTables(interTables); } - Integer renewalTables = interTableDao.insertInterTables(interTables); - if (renewalTables > 0&& renewal>0) { + if (renewalTables > 0 || renewal > 0) { return new ServerResult(true, renewalTables); } else { return new ServerResult(false, ReturnConstants.SYS_FAILL); @@ -196,56 +204,114 @@ public class InterTableServiceImpl implements InterTableService { @Override public ServerResult> previewCodeCalss(Long cid) { try { - Map dataMap = new LinkedHashMap(); + Map dataMap = new LinkedHashMap(); Apiclass apiclass = interTableDao.selectInterTableClass(cid); + if (apiclass == null) { + return new ServerResult>(false, ReturnConstants.INTER_NULL); + } VelocityInitializer.initVelocity(); VelocityContext context = InterTableUtils.prepareClassContext(apiclass); - Map templates = InterTableUtils.getTemplateList(2); + Map templates = InterTableUtils.getTemplateList(2); StringWriter sw = new StringWriter(); Template template = Velocity.getTemplate(templates.get("java"), Constants.UTF8); - template.merge(context,sw); - dataMap.put(getJavaClassName(apiclass.getcName()),sw.toString()); + template.merge(context, sw); + dataMap.put(getJavaClassName(apiclass.getcName()), sw.toString()); sw = new StringWriter(); - template = Velocity.getTemplate(templates.get("sql"),Constants.UTF8); - template.merge(context,sw); - dataMap.put(getSqlName(apiclass.getcName()),sw.toString()); - return new ServerResult>(true,dataMap); - }catch (RuntimeException e){ + template = Velocity.getTemplate(templates.get("sql"), Constants.UTF8); + template.merge(context, sw); + dataMap.put(getSqlName(apiclass.getcName()), sw.toString()); + return new ServerResult>(true, dataMap); + } catch (RuntimeException e) { logger.error(e.getMessage()); - return new ServerResult>(false,ReturnConstants.DB_EX); + return new ServerResult>(false, ReturnConstants.DB_EX); } } @Override public ServerResult> previewCodeMoudle(Long mid) { try { - Map dataMap = new LinkedHashMap(); + Map dataMap = new LinkedHashMap(); List interTableList = interTableDao.selectInterTableModule(mid); + if (interTableList.size() == 0) { + return new ServerResult>(false, "该模块下接口为空,请先创建接口!"); + } VelocityInitializer.initVelocity(); List contextList = InterTableUtils.prepareMoudleContext(interTableList); - Map templates = InterTableUtils.getTemplateList(2); + Map templates = InterTableUtils.getTemplateList(2); StringWriter sqlsw = new StringWriter(); - Template sqltemplate = Velocity.getTemplate(templates.get("sql"),Constants.UTF8); - for (VelocityContext context : contextList){ + Template sqltemplate = Velocity.getTemplate(templates.get("sql"), Constants.UTF8); + for (VelocityContext context : contextList) { StringWriter sw = new StringWriter(); Template template = Velocity.getTemplate(templates.get("java"), Constants.UTF8); - template.merge(context,sw); - sqltemplate.merge(context,sqlsw); - dataMap.put(getJavaClassName((String) context.get("ClassName")),sw.toString()); + template.merge(context, sw); + sqltemplate.merge(context, sqlsw); + dataMap.put(getJavaClassName((String) context.get("ClassName")), sw.toString()); } - dataMap.put(getSqlName("module"),sqlsw.toString()); - return new ServerResult>(true,dataMap); - }catch (RuntimeException e){ + dataMap.put(getSqlName("module"), sqlsw.toString()); + return new ServerResult>(true, dataMap); + } catch (RuntimeException e) { logger.error(e.getMessage()); - return new ServerResult>(false,ReturnConstants.DB_EX); + return new ServerResult>(false, ReturnConstants.DB_EX); } } - public String getJavaClassName(String cName){ + @Override + public ServerResult generatorCodeClass(Long cid) { + try { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + Apiclass apiclass = interTableDao.selectInterTableClass(cid); + VelocityInitializer.initVelocity(); + VelocityContext context = InterTableUtils.prepareClassContext(apiclass); + Map templates = InterTableUtils.getTemplateList(2); + StringWriter sw = new StringWriter(); + Template template = Velocity.getTemplate(templates.get("java"), Constants.UTF8); + template.merge(context, sw); + zip = genCode(getJavaClassName(apiclass.getcName()),zip,sw); + if (zip == null){ + return new ServerResult(false,"代码生成失败!"); + } + sw = new StringWriter(); + template = Velocity.getTemplate(templates.get("sql"), Constants.UTF8); + template.merge(context, sw); + + zip = genCode(getSqlName(apiclass.getcName()),zip,sw); + if (zip == null){ + return new ServerResult(false,"代码生成失败!"); + } + IOUtils.closeQuietly(zip); + return new ServerResult(true,outputStream.toByteArray()); + + }catch (RuntimeException e){ + logger.error(e.getMessage()); + return new ServerResult(false,"代码生成失败!"); + } + } + + + public ZipOutputStream genCode(String className, ZipOutputStream zip,StringWriter sw){ + try { + zip.putNextEntry(new ZipEntry(className)); + IOUtils.write(sw.toString(),zip,Constants.UTF8); + IOUtils.closeQuietly(sw); + zip.flush(); + zip.closeEntry(); + return zip; + }catch (IOException e){ + logger.error(e.getMessage()); + return null; + } + } + + + + + public String getJavaClassName(String cName) { return InterTableUtils.getUpperCase(cName) + "Controller.java"; } - public String getSqlName(String cName){ + + public String getSqlName(String cName) { return InterTableUtils.getUpperCase(cName) + ".sql"; } } \ No newline at end of file