mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
同步 dev 分支
This commit is contained in:
@ -1,21 +1,27 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
dynamic:
|
||||
#设置默认的数据源或者数据源组,默认值即为 master
|
||||
primary: master
|
||||
datasource:
|
||||
# 主库数据源
|
||||
master:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
username: root
|
||||
password: root
|
||||
# 从库数据源
|
||||
slave:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
username: root
|
||||
password: root
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
@ -35,6 +41,8 @@ spring:
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
# 注意这个值和druid原生不一致,默认启动了stat
|
||||
filters: stat
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
|
@ -1,21 +1,27 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
dynamic:
|
||||
#设置默认的数据源或者数据源组,默认值即为 master
|
||||
primary: master
|
||||
datasource:
|
||||
# 主库数据源
|
||||
master:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
username: root
|
||||
password: root
|
||||
# 从库数据源
|
||||
slave:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
username: root
|
||||
password: root
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
@ -35,6 +41,8 @@ spring:
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
# 注意这个值和druid原生不一致,默认启动了stat
|
||||
filters: stat
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
@ -58,7 +66,7 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.0.222
|
||||
host: localhost
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
|
@ -11,7 +11,7 @@ ruoyi:
|
||||
# 文件路径
|
||||
profile: ./ruoyi/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
addressEnabled: true
|
||||
|
||||
captcha:
|
||||
# 验证码开关
|
||||
@ -86,6 +86,17 @@ spring:
|
||||
thymeleaf:
|
||||
# 将系统模板放置到最前面 否则会与 springboot-admin 页面冲突
|
||||
template-resolver-order: 1
|
||||
jackson:
|
||||
# 日期格式化
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
serialization:
|
||||
# 格式化输出
|
||||
indent_output: false
|
||||
# 忽略无法转换的对象
|
||||
fail_on_empty_beans: false
|
||||
deserialization:
|
||||
# 允许对象忽略json中不存在的属性
|
||||
fail_on_unknown_properties: false
|
||||
|
||||
# token配置
|
||||
token:
|
||||
@ -242,9 +253,16 @@ feign:
|
||||
enabled: true
|
||||
okhttp:
|
||||
enabled: true
|
||||
hystrix:
|
||||
circuitbreaker:
|
||||
enabled: true
|
||||
|
||||
--- # 分布式锁 lock4j 全局配置
|
||||
lock4j:
|
||||
# 获取分布式锁超时时间,默认为 3000 毫秒
|
||||
acquire-timeout: 3000
|
||||
# 分布式锁的超时时间,默认为 30 毫秒
|
||||
expire: 30000
|
||||
|
||||
--- # 定时任务配置
|
||||
spring:
|
||||
quartz:
|
||||
|
@ -9,11 +9,4 @@
|
||||
<result property="deptId" column="dept_id"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchRoleDept">
|
||||
insert into sys_role_dept(role_id, dept_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.roleId},#{item.deptId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
@ -9,11 +9,4 @@
|
||||
<result property="menuId" column="menu_id"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchRoleMenu">
|
||||
insert into sys_role_menu(role_id, menu_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.roleId},#{item.menuId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
@ -9,11 +9,4 @@
|
||||
<result property="postId" column="post_id"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchUserPost">
|
||||
insert into sys_user_post(user_id, post_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.userId},#{item.postId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
@ -9,11 +9,4 @@
|
||||
<result property="roleId" column="role_id"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchUserRole">
|
||||
insert into sys_user_role(user_id, role_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.userId},#{item.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
@ -2,7 +2,6 @@ package ${packageName}.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import javax.validation.constraints.*;
|
||||
@ -27,9 +26,6 @@ public class ${ClassName}AddBo {
|
||||
|
||||
/** $column.columnComment */
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
#if($column.javaType == 'Date')
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
#end
|
||||
#if($column.isRequired==1)
|
||||
#if($column.javaType == 'String')
|
||||
@NotBlank(message = "$column.columnComment不能为空")
|
||||
|
@ -7,7 +7,6 @@ import lombok.experimental.Accessors;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* ${functionName}对象 ${tableName}
|
||||
|
@ -2,7 +2,6 @@ package ${packageName}.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import javax.validation.constraints.*;
|
||||
@ -26,9 +25,6 @@ public class ${ClassName}EditBo {
|
||||
|
||||
/** $column.columnComment */
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
#if($column.javaType == 'Date')
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
#end
|
||||
#if($column.isRequired==1)
|
||||
#if($column.javaType == 'String')
|
||||
@NotBlank(message = "$column.columnComment不能为空")
|
||||
|
@ -1,8 +1,8 @@
|
||||
package ${packageName}.mapper;
|
||||
|
||||
import ${packageName}.domain.${ClassName};
|
||||
import com.ruoyi.common.core.page.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mybatisplus.MybatisPlusRedisCache;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
|
||||
/**
|
||||
@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.CacheNamespace;
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}> {
|
||||
|
||||
|
@ -50,9 +50,6 @@ public class ${ClassName}QueryBo extends ${Entity} {
|
||||
#foreach ($column in $columns)
|
||||
#if(!$table.isSuperColumn($column.javaField) && $column.query)
|
||||
/** $column.columnComment */
|
||||
#if($column.javaType == 'Date')
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
#end
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
private $column.javaType $column.javaField;
|
||||
#end
|
||||
|
@ -5,7 +5,7 @@ import ${packageName}.vo.${ClassName}Vo;
|
||||
import ${packageName}.bo.${ClassName}QueryBo;
|
||||
import ${packageName}.bo.${ClassName}AddBo;
|
||||
import ${packageName}.bo.${ClassName}EditBo;
|
||||
import com.ruoyi.common.core.page.IServicePlus;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
#if($table.crud || $table.sub)
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
#end
|
||||
@ -58,5 +58,5 @@ public interface I${ClassName}Service extends IServicePlus<${ClassName}> {
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
Boolean deleteWithValidByIds(Collection<${pkColumn.javaType}> ids, Boolean isValid);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import com.ruoyi.common.core.page.PagePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
#end
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import ${packageName}.bo.${ClassName}AddBo;
|
||||
@ -30,7 +30,7 @@ import java.util.Collection;
|
||||
* @date ${datetime}
|
||||
*/
|
||||
@Service
|
||||
public class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${ClassName}> implements I${ClassName}Service {
|
||||
public class ${ClassName}ServiceImpl extends ServicePlusImpl<${ClassName}Mapper, ${ClassName}> implements I${ClassName}Service {
|
||||
|
||||
@Override
|
||||
public ${ClassName}Vo queryById(${pkColumn.javaType} ${pkColumn.javaField}){
|
||||
@ -101,7 +101,7 @@ public class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${C
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
public Boolean deleteWithValidByIds(Collection<${pkColumn.javaType}> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package ${packageName}.vo;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
#foreach ($import in $importList)
|
||||
import ${import};
|
||||
#end
|
||||
@ -41,7 +40,6 @@ public class ${ClassName}Vo {
|
||||
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
|
||||
#elseif($column.javaType == 'Date')
|
||||
@Excel(name = "${comment}" , width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
#else
|
||||
@Excel(name = "${comment}")
|
||||
#end
|
||||
|
@ -148,7 +148,6 @@
|
||||
#foreach($column in $columns)
|
||||
#set($field=$column.javaField)
|
||||
#if($column.insert && !$column.pk)
|
||||
#if(($column.usableColumn) || (!$column.superColumn))
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
@ -243,7 +242,6 @@
|
||||
</el-form-item>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -259,19 +257,19 @@ import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${Busin
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "imageUpload")
|
||||
import ImageUpload from '@/components/ImageUpload';
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "fileUpload")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "fileUpload")
|
||||
import FileUpload from '@/components/FileUpload';
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "editor")
|
||||
import Editor from '@/components/Editor';
|
||||
#break
|
||||
#end
|
||||
@ -281,19 +279,19 @@ export default {
|
||||
name: "${BusinessName}",
|
||||
components: {
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "imageUpload")
|
||||
ImageUpload,
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "fileUpload")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "fileUpload")
|
||||
FileUpload,
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "editor")
|
||||
Editor,
|
||||
#break
|
||||
#end
|
||||
|
@ -174,7 +174,6 @@
|
||||
#foreach($column in $columns)
|
||||
#set($field=$column.javaField)
|
||||
#if($column.insert && !$column.pk)
|
||||
#if(($column.usableColumn) || (!$column.superColumn))
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
@ -266,7 +265,6 @@
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
@ -311,19 +309,19 @@
|
||||
<script>
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "imageUpload")
|
||||
import ImageUpload from '@/components/ImageUpload';
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "fileUpload")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "fileUpload")
|
||||
import FileUpload from '@/components/FileUpload';
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "editor")
|
||||
import Editor from '@/components/Editor';
|
||||
#break
|
||||
#end
|
||||
@ -333,19 +331,19 @@ export default {
|
||||
name: "${BusinessName}",
|
||||
components: {
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "imageUpload")
|
||||
ImageUpload,
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "fileUpload")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "fileUpload")
|
||||
FileUpload,
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
|
||||
#if($column.insert && !$column.pk && $column.htmlType == "editor")
|
||||
Editor,
|
||||
#break
|
||||
#end
|
||||
|
Reference in New Issue
Block a user