Pārlūkot izejas kodu

!513 优化代码生成
Merge pull request !513 from xingyu/fix/codegen

芋道源码 1 gadu atpakaļ
vecāks
revīzija
7e6a3d2e36

+ 1 - 1
README.md

@@ -249,7 +249,7 @@ ps:核心功能已经实现,正在对接微信小程序中...
 
 | 框架                                                                                          | 说明               | 版本          | 学习指南                                                           |
 |---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------|
-| [Spring Boot](https://spring.io/projects/spring-boot)                                       | 应用开发框架           | 2.7.11      | [文档](https://github.com/YunaiV/SpringBoot-Labs)                |
+| [Spring Boot](https://spring.io/projects/spring-boot)                                       | 应用开发框架           | 2.7.12      | [文档](https://github.com/YunaiV/SpringBoot-Labs)                |
 | [MySQL](https://www.mysql.com/cn/)                                                          | 数据库服务器           | 5.7 / 8.0+  |                                                                |
 | [Druid](https://github.com/alibaba/druid)                                                   | JDBC 连接池、监控组件    | 1.2.16      | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
 | [MyBatis Plus](https://mp.baomidou.com/)                                                    | MyBatis 增强工具包    | 3.5.3.1     | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao)         |

+ 1 - 1
pom.xml

@@ -39,7 +39,7 @@
         <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
         <!-- 看看咋放到 bom 里 -->
         <lombok.version>1.18.26</lombok.version>
-        <spring.boot.version>2.7.11</spring.boot.version>
+        <spring.boot.version>2.7.12</spring.boot.version>
         <mapstruct.version>1.5.5.Final</mapstruct.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>

+ 3 - 3
yudao-dependencies/pom.xml

@@ -16,7 +16,7 @@
     <properties>
         <revision>1.7.3-snapshot</revision>
         <!-- 统一依赖管理 -->
-        <spring.boot.version>2.7.11</spring.boot.version>
+        <spring.boot.version>2.7.12</spring.boot.version>
         <!-- Web 相关 -->
         <springdoc.version>1.6.15</springdoc.version>
         <knife4j.version>4.1.0</knife4j.version>
@@ -43,7 +43,7 @@
         <!-- Bpm 工作流相关 -->
         <flowable.version>6.8.0</flowable.version>
         <!-- 工具类相关 -->
-        <captcha-plus.version>1.0.2</captcha-plus.version>
+        <captcha-plus.version>1.0.4</captcha-plus.version>
         <jsoup.version>1.15.4</jsoup.version>
         <lombok.version>1.18.26</lombok.version>
         <mapstruct.version>1.5.5.Final</mapstruct.version>
@@ -67,7 +67,7 @@
         <minio.version>8.5.2</minio.version>
         <aliyun-java-sdk-core.version>4.6.3</aliyun-java-sdk-core.version>
         <aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version>
-        <tencentcloud-sdk-java.version>3.1.715</tencentcloud-sdk-java.version>
+        <tencentcloud-sdk-java.version>3.1.758</tencentcloud-sdk-java.version>
         <justauth.version>1.4.0</justauth.version>
         <jimureport.version>1.5.6</jimureport.version>
         <xercesImpl.version>2.12.2</xercesImpl.version>

+ 1 - 1
yudao-example/yudao-sso-demo-by-code/pom.xml

@@ -21,7 +21,7 @@
         <maven.compiler.target>8</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <!-- 统一依赖管理 -->
-        <spring.boot.version>2.7.11</spring.boot.version>
+        <spring.boot.version>2.7.12</spring.boot.version>
     </properties>
 
     <dependencyManagement>

+ 1 - 1
yudao-example/yudao-sso-demo-by-password/pom.xml

@@ -21,7 +21,7 @@
         <maven.compiler.target>8</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <!-- 统一依赖管理 -->
-        <spring.boot.version>2.7.11</spring.boot.version>
+        <spring.boot.version>2.7.12</spring.boot.version>
     </properties>
 
     <dependencyManagement>

+ 14 - 2
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;
 import cn.hutool.core.util.ClassUtil;
 import cn.iocoder.yudao.framework.captcha.core.enums.CaptchaRedisKeyConstants;
 import cn.iocoder.yudao.framework.captcha.core.service.RedisCaptchaServiceImpl;
+import com.xingyuv.captcha.properties.AjCaptchaProperties;
 import com.xingyuv.captcha.service.CaptchaCacheService;
+import com.xingyuv.captcha.service.impl.CaptchaServiceFactory;
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.context.annotation.Bean;
 import org.springframework.data.redis.core.StringRedisTemplate;
 
+import javax.annotation.Resource;
+
 @AutoConfiguration
 public class YudaoCaptchaConfiguration {
 
@@ -17,9 +21,17 @@ public class YudaoCaptchaConfiguration {
         ClassUtil.loadClass(CaptchaRedisKeyConstants.class.getName());
     }
 
+    @Resource
+    private StringRedisTemplate stringRedisTemplate;
+
     @Bean
-    public CaptchaCacheService captchaCacheService(StringRedisTemplate stringRedisTemplate) {
-        return new RedisCaptchaServiceImpl(stringRedisTemplate);
+    public CaptchaCacheService captchaCacheService(AjCaptchaProperties config) {
+        //缓存类型redis/local/....
+        CaptchaCacheService ret = CaptchaServiceFactory.getCache(config.getCacheType().name());
+        if(ret instanceof RedisCaptchaServiceImpl){
+            ((RedisCaptchaServiceImpl)ret).setStringRedisTemplate(stringRedisTemplate);
+        }
+        return ret;
     }
 
 }

+ 4 - 0
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 {
         return "redis";
     }
 
+    public void setStringRedisTemplate(StringRedisTemplate stringRedisTemplate) {
+        this.stringRedisTemplate = stringRedisTemplate;
+    }
+
     @Override
     public void set(String key, String value, long expiresInSeconds) {
         stringRedisTemplate.opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS);

+ 2 - 2
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[] = [
       #end
     }
   #elseif($column.htmlType == "radio")## 单选框
-    component: 'Radio',
+    component: 'RadioButtonGroup',
     componentProps: {
       #if ("" != $dictType)## 有数据字典
         options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number')
@@ -188,7 +188,7 @@ export const updateFormSchema: FormSchema[] = [
       #end
     }
     #elseif($column.htmlType == "radio")## 单选框
-    component: 'Radio',
+    component: 'RadioButtonGroup',
     componentProps: {
       #if ("" != $dictType)## 有数据字典
         options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number')

+ 1 - 1
yudao-server/pom.xml

@@ -111,7 +111,7 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>2.7.11</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 -->
+                <version>2.7.12</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 -->
                 <configuration>
                     <fork>true</fork>
                 </configuration>