diff --git a/blade-core-develop/src/main/resources/templates/controller.java.vm b/blade-core-develop/src/main/resources/templates/controller.java.vm index 8e394e8..743475a 100644 --- a/blade-core-develop/src/main/resources/templates/controller.java.vm +++ b/blade-core-develop/src/main/resources/templates/controller.java.vm @@ -24,7 +24,6 @@ import javax.validation.Valid; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; -import org.springblade.system.feign.IDictClient; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; @@ -63,8 +62,6 @@ public class $!{table.controllerName} { private $!{table.serviceName} $!{table.entityPath}Service; - private IDictClient dictClient; - /** * 详情 */ @@ -73,8 +70,7 @@ public class $!{table.controllerName} { @ApiOperation(value = "详情", notes = "传入$!{table.entityPath}", position = 1) public R<$!{entity}VO> detail($!{entity} $!{table.entityPath}) { $!{entity} detail = $!{table.entityPath}Service.getOne(Condition.getQueryWrapper($!{table.entityPath})); - $!{entity}Wrapper $!{table.entityPath}Wrapper = new $!{entity}Wrapper(dictClient); - return R.data($!{table.entityPath}Wrapper.entityVO(detail)); + return R.data($!{entity}Wrapper.build().entityVO(detail)); } /** @@ -85,8 +81,7 @@ public class $!{table.controllerName} { @ApiOperation(value = "分页", notes = "传入$!{table.entityPath}") public R> list($!{entity} $!{table.entityPath}, Query query) { IPage<$!{entity}> pages = $!{table.entityPath}Service.page(Condition.getPage(query), Condition.getQueryWrapper($!{table.entityPath})); - $!{entity}Wrapper $!{table.entityPath}Wrapper = new $!{entity}Wrapper(dictClient); - return R.data($!{table.entityPath}Wrapper.pageVO(pages)); + return R.data($!{entity}Wrapper.build().pageVO(pages)); } /** diff --git a/blade-core-develop/src/main/resources/templates/wrapper.java.vm b/blade-core-develop/src/main/resources/templates/wrapper.java.vm index 0f79a8e..64a8b01 100644 --- a/blade-core-develop/src/main/resources/templates/wrapper.java.vm +++ b/blade-core-develop/src/main/resources/templates/wrapper.java.vm @@ -19,7 +19,6 @@ package $!{wrapperPackage}; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; -import org.springblade.system.feign.IDictClient; import $!{package.Entity}.$!{entity}; #set($voPackage=$package.Entity.replace("entity","vo")) import $!{voPackage}.$!{entity}VO; @@ -30,21 +29,16 @@ import $!{voPackage}.$!{entity}VO; * @author $!{author} * @since $!{date} */ -@AllArgsConstructor public class $!{entity}Wrapper extends BaseEntityWrapper<$!{entity}, $!{entity}VO> { - private IDictClient dictClient; + public static $!{entity}Wrapper build() { + return new $!{entity}Wrapper(); + } @Override public $!{entity}VO entityVO($!{entity} $!{table.entityPath}) { $!{entity}VO $!{table.entityPath}VO = BeanUtil.copy($!{table.entityPath}, $!{entity}VO.class); - /*R dict = dictClient.getValue("$!{table.entityPath}" , $!{table.entityPath}VO.getCategory()); - if (dict.isSuccess()) { - String categoryName = dict.getData(); - $!{table.entityPath}VO.setCategoryName(categoryName); - }*/ - return $!{table.entityPath}VO; }