From 165073b66c9bec9c8dac107ce52fd96b16bf78b2 Mon Sep 17 00:00:00 2001
From: mengweijin <1002284406@qq.com>
Date: Sat, 17 Aug 2024 00:08:04 +0800
Subject: [PATCH 1/5] changelog
---
CHANGELOG.md | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8221a2f..31f0eed 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,13 @@
## CHANGELOG
+### [v1.1.1-SNAPSHOT]
+- 【ENHANCEMENT】update template and add module args.
+
+### [v1.1.0] 2024-06-16
+- 【REFACTOR】Refactor all code and templates.
+
### [v1.0.16] 2023-03-12
- 【TEMPLATE】Add Customer template plugin.
--
+
### [v1.0.15] 2022-05-28
- 【TEMPLATE】Change mybatis plus controller template.
--
Gitee
From 50dd17b4639fb3a124a166727c8c8f42d2e44865 Mon Sep 17 00:00:00 2001
From: mengweijin <1002284406@qq.com>
Date: Sun, 15 Sep 2024 03:15:06 +0800
Subject: [PATCH 2/5] pom.xml
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 18adff4..6893875 100644
--- a/pom.xml
+++ b/pom.xml
@@ -249,7 +249,7 @@
Meng Wei Jin
- mengweijin.work@foxmail.com
+ mwjwork@qq.com
--
Gitee
From b2e789d70c6bef2015ac9f1829d9a0213f34115e Mon Sep 17 00:00:00 2001
From: mengweijin <1002284406@qq.com>
Date: Tue, 15 Oct 2024 23:05:19 +0800
Subject: [PATCH 3/5] tpl
---
.../templates/mybatis-plus/${entityName}Controller.java.vm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/resources/templates/mybatis-plus/${entityName}Controller.java.vm b/src/main/resources/templates/mybatis-plus/${entityName}Controller.java.vm
index d1c850e..ceb7d3d 100644
--- a/src/main/resources/templates/mybatis-plus/${entityName}Controller.java.vm
+++ b/src/main/resources/templates/mybatis-plus/${entityName}Controller.java.vm
@@ -105,8 +105,8 @@ public class ${entityName}Controller {
*/
@DeleteMapping("/{ids}")
public R delete(@PathVariable("ids") ${idField.columnType.type}[] ids) {
- int i = ${entityPropertyName}Service.getBaseMapper().deleteByIds(Arrays.asList(ids));
- return R.ajax(i);
+ boolean bool = ${entityPropertyName}Service.removeBatchByIds(Arrays.asList(ids));
+ return R.ajax(bool);
}
}
--
Gitee
From 47d8563cfdb346ed536e6bc51e2d4fafa7b56081 Mon Sep 17 00:00:00 2001
From: mengweijin <1002284406@qq.com>
Date: Thu, 17 Oct 2024 00:04:11 +0800
Subject: [PATCH 4/5] tpl
---
.../resources/templates/jpa/${entityName}Controller.java.vm | 6 ++----
.../templates/mybatis-plus/${entityName}Controller.java.vm | 6 ++----
.../templates/mybatis/${entityName}Controller.java.vm | 6 ++----
3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/src/main/resources/templates/jpa/${entityName}Controller.java.vm b/src/main/resources/templates/jpa/${entityName}Controller.java.vm
index 098d993..28acba5 100644
--- a/src/main/resources/templates/jpa/${entityName}Controller.java.vm
+++ b/src/main/resources/templates/jpa/${entityName}Controller.java.vm
@@ -2,7 +2,6 @@ package ${package};
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
@@ -24,7 +23,6 @@ import java.util.Optional;
* @since ${date}
*/
@Slf4j
-@Validated
@RestController
@RequestMapping("${requestMapping}")
public class ${entityName}Controller {
@@ -52,7 +50,7 @@ public class ${entityName}Controller {
* @param ${entityPropertyName} {@link ${entityName}}
*/
@PostMapping
- public void add(@Valid @RequestBody ${entityName} ${entityPropertyName}) {
+ public void add(@Validated @RequestBody ${entityName} ${entityPropertyName}) {
${entityPropertyName}Repository.save(${entityPropertyName});
}
@@ -63,7 +61,7 @@ public class ${entityName}Controller {
* @param ${entityPropertyName} {@link ${entityName}}
*/
@PutMapping
- public void update(@Valid @RequestBody ${entityName} ${entityPropertyName}) {
+ public void update(@Validated @RequestBody ${entityName} ${entityPropertyName}) {
${entityPropertyName}Repository.save(${entityPropertyName});
}
diff --git a/src/main/resources/templates/mybatis-plus/${entityName}Controller.java.vm b/src/main/resources/templates/mybatis-plus/${entityName}Controller.java.vm
index ceb7d3d..5c50286 100644
--- a/src/main/resources/templates/mybatis-plus/${entityName}Controller.java.vm
+++ b/src/main/resources/templates/mybatis-plus/${entityName}Controller.java.vm
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.mengweijin.framework.domain.R;
-import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
@@ -29,7 +28,6 @@ import java.util.List;
*/
@Slf4j
@AllArgsConstructor
-@Validated
@RestController
@RequestMapping("${requestMapping}")
public class ${entityName}Controller {
@@ -80,7 +78,7 @@ public class ${entityName}Controller {
* @param ${entityPropertyName} {@link ${entityName}}
*/
@PostMapping
- public R add(@Valid @RequestBody ${entityName} ${entityPropertyName}) {
+ public R add(@Validated @RequestBody ${entityName} ${entityPropertyName}) {
boolean bool = ${entityPropertyName}Service.save(${entityPropertyName});
return R.ajax(bool);
}
@@ -92,7 +90,7 @@ public class ${entityName}Controller {
* @param ${entityPropertyName} {@link ${entityName}}
*/
@PutMapping
- public R update(@Valid @RequestBody ${entityName} ${entityPropertyName}) {
+ public R update(@Validated @RequestBody ${entityName} ${entityPropertyName}) {
boolean bool = ${entityPropertyName}Service.updateById(${entityPropertyName});
return R.ajax(bool);
}
diff --git a/src/main/resources/templates/mybatis/${entityName}Controller.java.vm b/src/main/resources/templates/mybatis/${entityName}Controller.java.vm
index 0f15a2d..f34b5f4 100644
--- a/src/main/resources/templates/mybatis/${entityName}Controller.java.vm
+++ b/src/main/resources/templates/mybatis/${entityName}Controller.java.vm
@@ -1,7 +1,6 @@
package ${package};
import com.github.mengweijin.vitality.framework.domain.R;
-import jakarta.validation.Valid;
import java.util.Arrays;
import java.util.List;
import lombok.AllArgsConstructor;
@@ -27,7 +26,6 @@ import org.springframework.web.bind.annotation.RequestParam;
*/
@Slf4j
@AllArgsConstructor
-@Validated
@RestController
@RequestMapping("${requestMapping}")
public class ${entityName}Controller {
@@ -65,7 +63,7 @@ public class ${entityName}Controller {
* @param ${entityPropertyName} {@link ${entityName}}
*/
@PostMapping
- public R add(@Valid @RequestBody ${entityName} ${entityPropertyName}) {
+ public R add(@Validated @RequestBody ${entityName} ${entityPropertyName}) {
int i = ${entityPropertyName}Service.save(${entityPropertyName});
return R.ajax(i);
}
@@ -77,7 +75,7 @@ public class ${entityName}Controller {
* @param ${entityPropertyName} {@link ${entityName}}
*/
@PutMapping
- public R update(@Valid @RequestBody ${entityName} ${entityPropertyName}) {
+ public R update(@Validated @RequestBody ${entityName} ${entityPropertyName}) {
int i = ${entityPropertyName}Service.updateById(${entityPropertyName});
return R.ajax(i);
}
--
Gitee
From 76b30f51fcb5b3edfae1070f3a12a1f9f0945dcb Mon Sep 17 00:00:00 2001
From: mengweijin <1002284406@qq.com>
Date: Sat, 27 Sep 2025 00:02:13 +0800
Subject: [PATCH 5/5] README
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 7ad0166..42a2789 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
Language: [English](README.md)
-
+
--
Gitee