From 66138bfe7dcf203199107e6b91d9e2c7c519d945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E6=B2=90?= Date: Fri, 20 Jan 2023 15:33:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/template/java/Controller.java.ftl | 5 +- .../src/main/resources/template/java/Dao.java.ftl | 2 +- .../main/resources/template/java/Service.java.ftl | 4 +- .../resources/template/java/ServiceImpl.java.ftl | 4 +- .../resources/template/vue/add-or-update.vue.ftl | 2 +- .../src/main/resources/template/vue/index.vue.ftl | 231 ++++++++++----------- 6 files changed, 113 insertions(+), 135 deletions(-) diff --git a/maku-boot-module/maku-module-generator/src/main/resources/template/java/Controller.java.ftl b/maku-boot-module/maku-module-generator/src/main/resources/template/java/Controller.java.ftl index 2f3ed57..7c6f2c0 100644 --- a/maku-boot-module/maku-module-generator/src/main/resources/template/java/Controller.java.ftl +++ b/maku-boot-module/maku-module-generator/src/main/resources/template/java/Controller.java.ftl @@ -3,13 +3,14 @@ package ${package}.${moduleName}.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.AllArgsConstructor; -import ${package}.framework.common.page.PageResult; +import ${package}.framework.common.utils.PageResult; import ${package}.framework.common.utils.Result; import ${package}.${moduleName}.convert.${ClassName}Convert; import ${package}.${moduleName}.entity.${ClassName}Entity; import ${package}.${moduleName}.service.${ClassName}Service; import ${package}.${moduleName}.query.${ClassName}Query; import ${package}.${moduleName}.vo.${ClassName}VO; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -32,7 +33,7 @@ public class ${ClassName}Controller { @GetMapping("page") @Operation(summary = "分页") @PreAuthorize("hasAuthority('${moduleName}:${functionName}:page')") - public Result> page(@Valid ${ClassName}Query query){ + public Result> page(@ParameterObject @Valid ${ClassName}Query query){ PageResult<${ClassName}VO> page = ${className}Service.page(query); return Result.ok(page); diff --git a/maku-boot-module/maku-module-generator/src/main/resources/template/java/Dao.java.ftl b/maku-boot-module/maku-module-generator/src/main/resources/template/java/Dao.java.ftl index 1e947de..ebf94e9 100644 --- a/maku-boot-module/maku-module-generator/src/main/resources/template/java/Dao.java.ftl +++ b/maku-boot-module/maku-module-generator/src/main/resources/template/java/Dao.java.ftl @@ -1,6 +1,6 @@ package ${package}.${moduleName}.dao; -import ${package}.framework.common.dao.BaseDao; +import ${package}.framework.mybatis.dao.BaseDao; import ${package}.${moduleName}.entity.${ClassName}Entity; import org.apache.ibatis.annotations.Mapper; diff --git a/maku-boot-module/maku-module-generator/src/main/resources/template/java/Service.java.ftl b/maku-boot-module/maku-module-generator/src/main/resources/template/java/Service.java.ftl index 2b20601..736759d 100644 --- a/maku-boot-module/maku-module-generator/src/main/resources/template/java/Service.java.ftl +++ b/maku-boot-module/maku-module-generator/src/main/resources/template/java/Service.java.ftl @@ -1,7 +1,7 @@ package ${package}.${moduleName}.service; -import ${package}.framework.common.page.PageResult; -import ${package}.framework.common.service.BaseService; +import ${package}.framework.common.utils.PageResult; +import ${package}.framework.mybatis.service.BaseService; import ${package}.${moduleName}.vo.${ClassName}VO; import ${package}.${moduleName}.query.${ClassName}Query; import ${package}.${moduleName}.entity.${ClassName}Entity; diff --git a/maku-boot-module/maku-module-generator/src/main/resources/template/java/ServiceImpl.java.ftl b/maku-boot-module/maku-module-generator/src/main/resources/template/java/ServiceImpl.java.ftl index d7d5fa4..4f61914 100644 --- a/maku-boot-module/maku-module-generator/src/main/resources/template/java/ServiceImpl.java.ftl +++ b/maku-boot-module/maku-module-generator/src/main/resources/template/java/ServiceImpl.java.ftl @@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.AllArgsConstructor; -import ${package}.framework.common.page.PageResult; -import ${package}.framework.common.service.impl.BaseServiceImpl; +import ${package}.framework.common.utils.PageResult; +import ${package}.framework.mybatis.service.impl.BaseServiceImpl; import ${package}.${moduleName}.convert.${ClassName}Convert; import ${package}.${moduleName}.entity.${ClassName}Entity; import ${package}.${moduleName}.query.${ClassName}Query; diff --git a/maku-boot-module/maku-module-generator/src/main/resources/template/vue/add-or-update.vue.ftl b/maku-boot-module/maku-module-generator/src/main/resources/template/vue/add-or-update.vue.ftl index 0ab3074..22dff76 100644 --- a/maku-boot-module/maku-module-generator/src/main/resources/template/vue/add-or-update.vue.ftl +++ b/maku-boot-module/maku-module-generator/src/main/resources/template/vue/add-or-update.vue.ftl @@ -79,7 +79,7 @@ const visible = ref(false) const dataFormRef = ref() const dataForm = reactive({ - <#list formList as field> + <#list fieldList as field> ${field.attrName}: ''<#sep>, }) diff --git a/maku-boot-module/maku-module-generator/src/main/resources/template/vue/index.vue.ftl b/maku-boot-module/maku-module-generator/src/main/resources/template/vue/index.vue.ftl index 322399f..e8626e8 100644 --- a/maku-boot-module/maku-module-generator/src/main/resources/template/vue/index.vue.ftl +++ b/maku-boot-module/maku-module-generator/src/main/resources/template/vue/index.vue.ftl @@ -1,136 +1,113 @@