Commit 7e6a3d2e360a79c27c360f3cb9f16e4d6308b35e

Authored by 芋道源码
Committed by Gitee
2 parents f59119bf b892a6d2

!513 优化代码生成

Merge pull request !513 from xingyu/fix/codegen
README.md
@@ -249,7 +249,7 @@ ps:核心功能已经实现,正在对接微信小程序中... @@ -249,7 +249,7 @@ ps:核心功能已经实现,正在对接微信小程序中...
249 249
250 | 框架 | 说明 | 版本 | 学习指南 | 250 | 框架 | 说明 | 版本 | 学习指南 |
251 |---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------| 251 |---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------|
252 -| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.11 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | 252 +| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.12 | [文档](https://github.com/YunaiV/SpringBoot-Labs) |
253 | [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | | 253 | [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | |
254 | [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.16 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | 254 | [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.16 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
255 | [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | 255 | [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) |
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> 39 <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
40 <!-- 看看咋放到 bom 里 --> 40 <!-- 看看咋放到 bom 里 -->
41 <lombok.version>1.18.26</lombok.version> 41 <lombok.version>1.18.26</lombok.version>
42 - <spring.boot.version>2.7.11</spring.boot.version> 42 + <spring.boot.version>2.7.12</spring.boot.version>
43 <mapstruct.version>1.5.5.Final</mapstruct.version> 43 <mapstruct.version>1.5.5.Final</mapstruct.version>
44 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 44 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
45 </properties> 45 </properties>
yudao-dependencies/pom.xml
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 <properties> 16 <properties>
17 <revision>1.7.3-snapshot</revision> 17 <revision>1.7.3-snapshot</revision>
18 <!-- 统一依赖管理 --> 18 <!-- 统一依赖管理 -->
19 - <spring.boot.version>2.7.11</spring.boot.version> 19 + <spring.boot.version>2.7.12</spring.boot.version>
20 <!-- Web 相关 --> 20 <!-- Web 相关 -->
21 <springdoc.version>1.6.15</springdoc.version> 21 <springdoc.version>1.6.15</springdoc.version>
22 <knife4j.version>4.1.0</knife4j.version> 22 <knife4j.version>4.1.0</knife4j.version>
@@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
43 <!-- Bpm 工作流相关 --> 43 <!-- Bpm 工作流相关 -->
44 <flowable.version>6.8.0</flowable.version> 44 <flowable.version>6.8.0</flowable.version>
45 <!-- 工具类相关 --> 45 <!-- 工具类相关 -->
46 - <captcha-plus.version>1.0.2</captcha-plus.version> 46 + <captcha-plus.version>1.0.4</captcha-plus.version>
47 <jsoup.version>1.15.4</jsoup.version> 47 <jsoup.version>1.15.4</jsoup.version>
48 <lombok.version>1.18.26</lombok.version> 48 <lombok.version>1.18.26</lombok.version>
49 <mapstruct.version>1.5.5.Final</mapstruct.version> 49 <mapstruct.version>1.5.5.Final</mapstruct.version>
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
67 <minio.version>8.5.2</minio.version> 67 <minio.version>8.5.2</minio.version>
68 <aliyun-java-sdk-core.version>4.6.3</aliyun-java-sdk-core.version> 68 <aliyun-java-sdk-core.version>4.6.3</aliyun-java-sdk-core.version>
69 <aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version> 69 <aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version>
70 - <tencentcloud-sdk-java.version>3.1.715</tencentcloud-sdk-java.version> 70 + <tencentcloud-sdk-java.version>3.1.758</tencentcloud-sdk-java.version>
71 <justauth.version>1.4.0</justauth.version> 71 <justauth.version>1.4.0</justauth.version>
72 <jimureport.version>1.5.6</jimureport.version> 72 <jimureport.version>1.5.6</jimureport.version>
73 <xercesImpl.version>2.12.2</xercesImpl.version> 73 <xercesImpl.version>2.12.2</xercesImpl.version>
yudao-example/yudao-sso-demo-by-code/pom.xml
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 <maven.compiler.target>8</maven.compiler.target> 21 <maven.compiler.target>8</maven.compiler.target>
22 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 22 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23 <!-- 统一依赖管理 --> 23 <!-- 统一依赖管理 -->
24 - <spring.boot.version>2.7.11</spring.boot.version> 24 + <spring.boot.version>2.7.12</spring.boot.version>
25 </properties> 25 </properties>
26 26
27 <dependencyManagement> 27 <dependencyManagement>
yudao-example/yudao-sso-demo-by-password/pom.xml
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 <maven.compiler.target>8</maven.compiler.target> 21 <maven.compiler.target>8</maven.compiler.target>
22 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 22 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23 <!-- 统一依赖管理 --> 23 <!-- 统一依赖管理 -->
24 - <spring.boot.version>2.7.11</spring.boot.version> 24 + <spring.boot.version>2.7.12</spring.boot.version>
25 </properties> 25 </properties>
26 26
27 <dependencyManagement> 27 <dependencyManagement>
yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java
@@ -3,11 +3,15 @@ package cn.iocoder.yudao.framework.captcha.config; @@ -3,11 +3,15 @@ package cn.iocoder.yudao.framework.captcha.config;
3 import cn.hutool.core.util.ClassUtil; 3 import cn.hutool.core.util.ClassUtil;
4 import cn.iocoder.yudao.framework.captcha.core.enums.CaptchaRedisKeyConstants; 4 import cn.iocoder.yudao.framework.captcha.core.enums.CaptchaRedisKeyConstants;
5 import cn.iocoder.yudao.framework.captcha.core.service.RedisCaptchaServiceImpl; 5 import cn.iocoder.yudao.framework.captcha.core.service.RedisCaptchaServiceImpl;
  6 +import com.xingyuv.captcha.properties.AjCaptchaProperties;
6 import com.xingyuv.captcha.service.CaptchaCacheService; 7 import com.xingyuv.captcha.service.CaptchaCacheService;
  8 +import com.xingyuv.captcha.service.impl.CaptchaServiceFactory;
7 import org.springframework.boot.autoconfigure.AutoConfiguration; 9 import org.springframework.boot.autoconfigure.AutoConfiguration;
8 import org.springframework.context.annotation.Bean; 10 import org.springframework.context.annotation.Bean;
9 import org.springframework.data.redis.core.StringRedisTemplate; 11 import org.springframework.data.redis.core.StringRedisTemplate;
10 12
  13 +import javax.annotation.Resource;
  14 +
11 @AutoConfiguration 15 @AutoConfiguration
12 public class YudaoCaptchaConfiguration { 16 public class YudaoCaptchaConfiguration {
13 17
@@ -17,9 +21,17 @@ public class YudaoCaptchaConfiguration { @@ -17,9 +21,17 @@ public class YudaoCaptchaConfiguration {
17 ClassUtil.loadClass(CaptchaRedisKeyConstants.class.getName()); 21 ClassUtil.loadClass(CaptchaRedisKeyConstants.class.getName());
18 } 22 }
19 23
  24 + @Resource
  25 + private StringRedisTemplate stringRedisTemplate;
  26 +
20 @Bean 27 @Bean
21 - public CaptchaCacheService captchaCacheService(StringRedisTemplate stringRedisTemplate) {  
22 - return new RedisCaptchaServiceImpl(stringRedisTemplate); 28 + public CaptchaCacheService captchaCacheService(AjCaptchaProperties config) {
  29 + //缓存类型redis/local/....
  30 + CaptchaCacheService ret = CaptchaServiceFactory.getCache(config.getCacheType().name());
  31 + if(ret instanceof RedisCaptchaServiceImpl){
  32 + ((RedisCaptchaServiceImpl)ret).setStringRedisTemplate(stringRedisTemplate);
  33 + }
  34 + return ret;
23 } 35 }
24 36
25 } 37 }
yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/core/service/RedisCaptchaServiceImpl.java
@@ -25,6 +25,10 @@ public class RedisCaptchaServiceImpl implements CaptchaCacheService { @@ -25,6 +25,10 @@ public class RedisCaptchaServiceImpl implements CaptchaCacheService {
25 return "redis"; 25 return "redis";
26 } 26 }
27 27
  28 + public void setStringRedisTemplate(StringRedisTemplate stringRedisTemplate) {
  29 + this.stringRedisTemplate = stringRedisTemplate;
  30 + }
  31 +
28 @Override 32 @Override
29 public void set(String key, String value, long expiresInSeconds) { 33 public void set(String key, String value, long expiresInSeconds) {
30 stringRedisTemplate.opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS); 34 stringRedisTemplate.opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS);
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/data.ts.vm
@@ -122,7 +122,7 @@ export const createFormSchema: FormSchema[] = [ @@ -122,7 +122,7 @@ export const createFormSchema: FormSchema[] = [
122 #end 122 #end
123 } 123 }
124 #elseif($column.htmlType == "radio")## 单选框 124 #elseif($column.htmlType == "radio")## 单选框
125 - component: 'Radio', 125 + component: 'RadioButtonGroup',
126 componentProps: { 126 componentProps: {
127 #if ("" != $dictType)## 有数据字典 127 #if ("" != $dictType)## 有数据字典
128 options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number') 128 options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number')
@@ -188,7 +188,7 @@ export const updateFormSchema: FormSchema[] = [ @@ -188,7 +188,7 @@ export const updateFormSchema: FormSchema[] = [
188 #end 188 #end
189 } 189 }
190 #elseif($column.htmlType == "radio")## 单选框 190 #elseif($column.htmlType == "radio")## 单选框
191 - component: 'Radio', 191 + component: 'RadioButtonGroup',
192 componentProps: { 192 componentProps: {
193 #if ("" != $dictType)## 有数据字典 193 #if ("" != $dictType)## 有数据字典
194 options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number') 194 options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number')
yudao-server/pom.xml
@@ -111,7 +111,7 @@ @@ -111,7 +111,7 @@
111 <plugin> 111 <plugin>
112 <groupId>org.springframework.boot</groupId> 112 <groupId>org.springframework.boot</groupId>
113 <artifactId>spring-boot-maven-plugin</artifactId> 113 <artifactId>spring-boot-maven-plugin</artifactId>
114 - <version>2.7.11</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 --> 114 + <version>2.7.12</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 -->
115 <configuration> 115 <configuration>
116 <fork>true</fork> 116 <fork>true</fork>
117 </configuration> 117 </configuration>