From a21bd914b736ea364de203c5da14b81cee19abec Mon Sep 17 00:00:00 2001 From: 王彬 Date: Wed, 4 Sep 2019 15:21:40 +0800 Subject: [PATCH] update version --- build.gradle | 2 +- src/main/resources/template/bazhuayun/ManageControllerTemplate.ftl | 7 ++++--- src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl | 32 -------------------------------- src/main/resources/template/bazhuayun/ServiceTemplate.ftl | 23 +---------------------- src/main/resources/template/bazhuayun/V1ControllerTemplate.ftl | 14 ++++++++------ 5 files changed, 14 insertions(+), 64 deletions(-) diff --git a/build.gradle b/build.gradle index 81826f9..22ec69c 100644 --- a/build.gradle +++ b/build.gradle @@ -51,7 +51,7 @@ uploadArchives { authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD) } pom.project { - version '1.2.8' + version '1.2.9' artifactId ARTIFACT_Id groupId GROUP_ID packaging TYPE diff --git a/src/main/resources/template/bazhuayun/ManageControllerTemplate.ftl b/src/main/resources/template/bazhuayun/ManageControllerTemplate.ftl index e2a7a3f..f56fc5f 100644 --- a/src/main/resources/template/bazhuayun/ManageControllerTemplate.ftl +++ b/src/main/resources/template/bazhuayun/ManageControllerTemplate.ftl @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.PathVariable; import ${basePackage}.bean.entity.${entityClassSimpleName}; import ${basePackage}.constants.GlobalConstants; @@ -80,7 +81,7 @@ public class ${controllerClassName} { * @apiUse ResultInfo */ @GetMapping("/{ssid}") - public ResultInfo get(String ssid){ + public ResultInfo get(@PathVariable String ssid){ return this.${serviceClassFieldName}.getOneManage(ssid); } @@ -112,7 +113,7 @@ public class ${controllerClassName} { * @apiUse ResultInfo */ @DeleteMapping("/{ssid}") - public ResultInfo delete(String ssid){ + public ResultInfo delete(@PathVariable String ssid){ return this.${serviceClassFieldName}.deleteManage(ssid); } @@ -128,7 +129,7 @@ public class ${controllerClassName} { * @apiUse ResultInfo */ @PutMapping("/{ssid}") - public ResultInfo put(String ssid, HttpServletRequest request){ + public ResultInfo put(@PathVariable String ssid, HttpServletRequest request){ return this.${serviceClassFieldName}.putManage(ssid, UtilHttpRequestMap.getUpdateListByRequestMap(request.getParameterMap(), ${entityClassSimpleName}.class, null)); } diff --git a/src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl b/src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl index f9f2d8c..786fcbd 100644 --- a/src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl +++ b/src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl @@ -40,38 +40,6 @@ public class ${serviceImplClassSimpleName} implements ${serviceClassSimpleName} } @Override - public ResultInfo putV1(String ssid, List updateList) { - try{ - this.${repositoryClassFieldName}.updateEntityBySsid(ssid, updateList); - }catch(Exception e){ - UtilLog.errorForException(e, this.getClass()); - return UtilResultInfo.getFailure(e.getMessage()); - } - return UtilResultInfo.getSuccess("更新成功"); - } - - @Override - public ResultInfo deleteV1(String ssid) { - try{ - this.${repositoryClassFieldName}.deleteEntityBySsid(ssid); - }catch(Exception e){ - UtilLog.errorForException(e, this.getClass()); - return UtilResultInfo.getFailure(e.getMessage()); - } - return UtilResultInfo.getSuccess("删除成功"); - } - - @Override - public ResultInfo postV1(Map data) { - try { - return UtilResultInfo.getSuccess("创建成功", this.${repositoryClassFieldName}.addEntityByMap(data)); - } catch (Exception e) { - UtilLog.errorForException(e, this.getClass()); - return UtilResultInfo.getFailure(e.getMessage()); - } - } - - @Override public ResultInfo getListManage(List condition, Integer page, Integer size) { try { return UtilResultInfo.getSuccess("查询成功", this.${repositoryClassFieldName}.getVoPage(condition, page, size)); diff --git a/src/main/resources/template/bazhuayun/ServiceTemplate.ftl b/src/main/resources/template/bazhuayun/ServiceTemplate.ftl index 4817dee..2868a4c 100644 --- a/src/main/resources/template/bazhuayun/ServiceTemplate.ftl +++ b/src/main/resources/template/bazhuayun/ServiceTemplate.ftl @@ -21,28 +21,7 @@ public interface ${serviceClassSimpleName} { * @return */ public ResultInfo getOneV1(String ssid); - - /** - * 修改ssid对应的数据 - * @param ssid - * @return - */ - public ResultInfo putV1(String ssid, List updateList); - - /** - * 删除ssid对应的数据 - * @param ssid - * @return - */ - public ResultInfo deleteV1(String ssid); - - /** - * 创建数据 - * @param ssid - * @return - */ - public ResultInfo postV1(Map data); - + /** * 获取列表 * @param condition diff --git a/src/main/resources/template/bazhuayun/V1ControllerTemplate.ftl b/src/main/resources/template/bazhuayun/V1ControllerTemplate.ftl index edd0e3a..10af9fe 100644 --- a/src/main/resources/template/bazhuayun/V1ControllerTemplate.ftl +++ b/src/main/resources/template/bazhuayun/V1ControllerTemplate.ftl @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.PathVariable; import ${basePackage}.bean.entity.${entityClassSimpleName}; import ${basePackage}.constants.GlobalConstants; @@ -19,6 +20,7 @@ import ${basePackage}.service.${serviceClassSimpleName}; import com.taover.util.UtilHttpRequestMap; import com.taover.util.bean.ResultInfo; +import com.taover.util.bean.UtilResultInfo; @RestController("v1.${controllerMap}") @RequestMapping("/v1/${controllerMap}") @@ -80,7 +82,7 @@ public class ${controllerClassName} { * @apiUse ResultInfo */ @GetMapping("/{ssid}") - public ResultInfo get(String ssid){ + public ResultInfo get(@PathVariable String ssid){ return this.${serviceClassFieldName}.getOneV1(ssid); } @@ -97,7 +99,7 @@ public class ${controllerClassName} { */ @PostMapping public ResultInfo post(HttpServletRequest request){ - return this.${serviceClassFieldName}.postV1(UtilHttpRequestMap.getMapValueStringByRequestMap(request.getParameterMap())); + return UtilResultInfo.getFailure("没有找到对应处理逻辑"); } /** @@ -112,8 +114,8 @@ public class ${controllerClassName} { * @apiUse ResultInfo */ @DeleteMapping("/{ssid}") - public ResultInfo delete(String ssid){ - return this.${serviceClassFieldName}.deleteV1(ssid); + public ResultInfo delete(@PathVariable String ssid){ + return UtilResultInfo.getFailure("没有找到对应处理逻辑"); } /** @@ -128,8 +130,8 @@ public class ${controllerClassName} { * @apiUse ResultInfo */ @PutMapping("/{ssid}") - public ResultInfo put(String ssid, HttpServletRequest request){ - return this.${serviceClassFieldName}.putV1(ssid, UtilHttpRequestMap.getUpdateListByRequestMap(request.getParameterMap(), ${entityClassSimpleName}.class, null)); + public ResultInfo put(@PathVariable String ssid, HttpServletRequest request){ + return UtilResultInfo.getFailure("没有找到对应处理逻辑"); } } -- libgit2 0.21.2