forked from dyf/fys-Multi-tenant
Compare commits
1 Commits
d97ace42d0
...
main
Author | SHA1 | Date | |
---|---|---|---|
7773cae0ea |
@ -16,4 +16,5 @@ public class MqttPropertiesConfig {
|
|||||||
private String subTopic;
|
private String subTopic;
|
||||||
private String pubClientId;
|
private String pubClientId;
|
||||||
private String pubTopic;
|
private String pubTopic;
|
||||||
|
private String enabled;
|
||||||
}
|
}
|
@ -79,7 +79,8 @@ public class AppRegisterService {
|
|||||||
|
|
||||||
boolean exist = TenantHelper.dynamic(tenantId, () -> {
|
boolean exist = TenantHelper.dynamic(tenantId, () -> {
|
||||||
return appUserMapper.exists(new LambdaQueryWrapper<AppUser>()
|
return appUserMapper.exists(new LambdaQueryWrapper<AppUser>()
|
||||||
.eq(AppUser::getUserName, appUser.getUserName()));
|
.eq(AppUser::getUserName, appUser.getUserName())
|
||||||
|
.eq(AppUser::getUserType, UserType.APP_USER.getUserType()));
|
||||||
});
|
});
|
||||||
if (exist) {
|
if (exist) {
|
||||||
throw new UserException("user.register.save.error", username);
|
throw new UserException("user.register.save.error", username);
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
--- # 临时文件存储位置 避免临时文件被系统清理报错
|
||||||
|
spring.servlet.multipart.location: /fys/server/temp
|
||||||
|
|
||||||
--- # 监控中心配置
|
--- # 监控中心配置
|
||||||
spring.boot.admin.client:
|
spring.boot.admin.client:
|
||||||
# 增加客户端开关
|
# 增加客户端开关
|
||||||
@ -8,8 +11,8 @@ spring.boot.admin.client:
|
|||||||
metadata:
|
metadata:
|
||||||
username: ${spring.boot.admin.client.username}
|
username: ${spring.boot.admin.client.username}
|
||||||
userpassword: ${spring.boot.admin.client.password}
|
userpassword: ${spring.boot.admin.client.password}
|
||||||
username: ${monitor.username}
|
username: @monitor.username@
|
||||||
password: ${monitor.password}
|
password: @monitor.password@
|
||||||
|
|
||||||
--- # snail-job 配置
|
--- # snail-job 配置
|
||||||
snail-job:
|
snail-job:
|
||||||
@ -37,7 +40,7 @@ spring:
|
|||||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||||
dynamic:
|
dynamic:
|
||||||
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
||||||
p6spy: true
|
p6spy: false
|
||||||
# 设置默认的数据源或者数据源组,默认值即为 master
|
# 设置默认的数据源或者数据源组,默认值即为 master
|
||||||
primary: master
|
primary: master
|
||||||
# 严格模式 匹配不到数据源则报错
|
# 严格模式 匹配不到数据源则报错
|
||||||
@ -49,9 +52,9 @@ spring:
|
|||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||||
url: jdbc:mysql://120.79.224.186:3366/fys-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://47.107.152.87:3306/fys-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
username: root
|
username: root
|
||||||
password: 1fys@QWER..
|
password: Jz_5623_cl1
|
||||||
# # 从库数据源
|
# # 从库数据源
|
||||||
# slave:
|
# slave:
|
||||||
# lazy: true
|
# lazy: true
|
||||||
@ -98,13 +101,13 @@ spring:
|
|||||||
spring.data:
|
spring.data:
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: 120.79.224.186
|
host: 47.107.152.87
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 26379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 2
|
database: 1
|
||||||
# redis 密码必须配置
|
# redis 密码必须配置
|
||||||
password: 1fys@QWER..
|
password: re_fs_11520631
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
# 是否开启ssl
|
# 是否开启ssl
|
||||||
@ -115,17 +118,17 @@ redisson:
|
|||||||
# redis key前缀
|
# redis key前缀
|
||||||
keyPrefix:
|
keyPrefix:
|
||||||
# 线程池数量
|
# 线程池数量
|
||||||
threads: 4
|
threads: 16
|
||||||
# Netty线程池数量
|
# Netty线程池数量
|
||||||
nettyThreads: 8
|
nettyThreads: 32
|
||||||
# 单节点配置
|
# 单节点配置
|
||||||
singleServerConfig:
|
singleServerConfig:
|
||||||
# 客户端名称 不能用中文
|
# 客户端名称 不能用中文
|
||||||
clientName: fys-Vue-Plus
|
clientName: fys-Vue-Plus
|
||||||
# 最小空闲连接数
|
# 最小空闲连接数
|
||||||
connectionMinimumIdleSize: 8
|
connectionMinimumIdleSize: 32
|
||||||
# 连接池大小
|
# 连接池大小
|
||||||
connectionPoolSize: 32
|
connectionPoolSize: 64
|
||||||
# 连接空闲超时,单位:毫秒
|
# 连接空闲超时,单位:毫秒
|
||||||
idleConnectionTimeout: 10000
|
idleConnectionTimeout: 10000
|
||||||
# 命令等待超时,单位:毫秒
|
# 命令等待超时,单位:毫秒
|
||||||
@ -182,7 +185,6 @@ sms:
|
|||||||
#模板变量 上述模板的变量
|
#模板变量 上述模板的变量
|
||||||
templateName: code
|
templateName: code
|
||||||
signature: 深圳市富源晟科技
|
signature: 深圳市富源晟科技
|
||||||
# sdk-app-id: 您的sdkAppId
|
|
||||||
config2:
|
config2:
|
||||||
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
||||||
supplier: tencent
|
supplier: tencent
|
||||||
@ -191,7 +193,6 @@ sms:
|
|||||||
signature: 您的短信签名
|
signature: 您的短信签名
|
||||||
sdk-app-id: 您的sdkAppId
|
sdk-app-id: 您的sdkAppId
|
||||||
|
|
||||||
|
|
||||||
--- # 三方授权
|
--- # 三方授权
|
||||||
justauth:
|
justauth:
|
||||||
# 前端外网访问地址
|
# 前端外网访问地址
|
||||||
@ -206,7 +207,7 @@ justauth:
|
|||||||
redirect-uri: ${justauth.address}/social-callback?source=maxkey
|
redirect-uri: ${justauth.address}/social-callback?source=maxkey
|
||||||
topiam:
|
topiam:
|
||||||
# topiam 服务器地址
|
# topiam 服务器地址
|
||||||
server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol
|
server-url: http://127.0.0.1:1989/api/v1/authorize/y0q************spq***********8ol
|
||||||
client-id: 449c4*********937************759
|
client-id: 449c4*********937************759
|
||||||
client-secret: ac7***********1e0************28d
|
client-secret: ac7***********1e0************28d
|
||||||
redirect-uri: ${justauth.address}/social-callback?source=topiam
|
redirect-uri: ${justauth.address}/social-callback?source=topiam
|
||||||
@ -276,6 +277,18 @@ justauth:
|
|||||||
redirect-uri: ${justauth.address}/social-callback?source=gitea
|
redirect-uri: ${justauth.address}/social-callback?source=gitea
|
||||||
|
|
||||||
|
|
||||||
|
# MQTT配置
|
||||||
|
mqtt:
|
||||||
|
username: admin
|
||||||
|
password: fys123456
|
||||||
|
url: tcp://47.107.152.87:1883
|
||||||
|
subClientId: fys_subClient
|
||||||
|
subTopic: worker/location/#
|
||||||
|
pubTopic: B/#
|
||||||
|
pubClientId: fys_pubClient
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
|
||||||
# 文件存储路径
|
# 文件存储路径
|
||||||
file:
|
file:
|
||||||
mac:
|
mac:
|
||||||
@ -297,12 +310,3 @@ file:
|
|||||||
pic: C:\eladmin\file\ #设备图片存储路径
|
pic: C:\eladmin\file\ #设备图片存储路径
|
||||||
#ip: http://fuyuanshen.com:81/ #服务器地址
|
#ip: http://fuyuanshen.com:81/ #服务器地址
|
||||||
ip: https://fuyuanshen.com/ #服务器地址
|
ip: https://fuyuanshen.com/ #服务器地址
|
||||||
# MQTT配置
|
|
||||||
mqtt:
|
|
||||||
username: admin
|
|
||||||
password: fys123456
|
|
||||||
url: tcp://47.107.152.87:1883
|
|
||||||
subClientId: fys_subClient
|
|
||||||
subTopic: worker/location/#
|
|
||||||
pubTopic: B/#
|
|
||||||
pubClientId: fys_pubClient
|
|
@ -99,6 +99,6 @@ public class AppUser extends TenantEntity {
|
|||||||
/**
|
/**
|
||||||
* 地区
|
* 地区
|
||||||
*/
|
*/
|
||||||
private String region;
|
// private String region;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ import java.util.Date;
|
|||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fuyuanshen.app.domain.AppUser;
|
import com.fuyuanshen.app.domain.AppUser;
|
||||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import cn.idev.excel.annotation.ExcelProperty;
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
@ -87,6 +89,8 @@ public class AppUserVo implements Serializable {
|
|||||||
* 密码
|
* 密码
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "密码")
|
@ExcelProperty(value = "密码")
|
||||||
|
@JsonIgnore
|
||||||
|
@JsonProperty
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -177,7 +177,7 @@ public class AppUserServiceImpl implements IAppUserService {
|
|||||||
appUserVo.setNickName(user.getNickName());
|
appUserVo.setNickName(user.getNickName());
|
||||||
appUserVo.setGender(user.getSex());
|
appUserVo.setGender(user.getSex());
|
||||||
appUserVo.setPhone(user.getPhonenumber());
|
appUserVo.setPhone(user.getPhonenumber());
|
||||||
appUserVo.setRegion(user.getRegion());
|
// appUserVo.setRegion(user.getRegion());
|
||||||
if(user.getAvatar() != null){
|
if(user.getAvatar() != null){
|
||||||
SysOssVo oss = sysOssService.getById(user.getAvatar());
|
SysOssVo oss = sysOssService.getById(user.getAvatar());
|
||||||
if(oss != null){
|
if(oss != null){
|
||||||
@ -203,7 +203,7 @@ public class AppUserServiceImpl implements IAppUserService {
|
|||||||
updUser.setAvatar(oss.getOssId());
|
updUser.setAvatar(oss.getOssId());
|
||||||
}
|
}
|
||||||
|
|
||||||
updUser.setRegion(bo.getRegion());
|
// updUser.setRegion(bo.getRegion());
|
||||||
updUser.setSex(bo.getGender());
|
updUser.setSex(bo.getGender());
|
||||||
return baseMapper.update(updUser, new LambdaQueryWrapper<AppUser>().eq(AppUser::getUserId, appUser.getUserId()));
|
return baseMapper.update(updUser, new LambdaQueryWrapper<AppUser>().eq(AppUser::getUserId, appUser.getUserId()));
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
select a.id,a.business_id,a.file_id,b.file_name,b.url fileUrl from app_business_file a left join sys_oss b on a.file_id = b.oss_id
|
select a.id,a.business_id,a.file_id,b.file_name,b.url fileUrl from app_business_file a left join sys_oss b on a.file_id = b.oss_id
|
||||||
where 1=1
|
where 1=1
|
||||||
<if test="createBy != null">
|
<if test="createBy != null">
|
||||||
a.create_by = #{createBy}
|
and a.create_by = #{createBy}
|
||||||
</if>
|
</if>
|
||||||
<if test="businessId != null">
|
<if test="businessId != null">
|
||||||
and a.business_id = #{businessId}
|
and a.business_id = #{businessId}
|
||||||
@ -19,9 +19,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="fileType != null">
|
<if test="fileType != null">
|
||||||
and a.file_type = #{fileType}
|
and a.file_type = #{fileType}
|
||||||
</if>
|
</if>
|
||||||
<if test="createBy != null">
|
|
||||||
and a.create_by = #{createBy}
|
|
||||||
</if>
|
|
||||||
order by a.create_time desc
|
order by a.create_time desc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -57,6 +57,11 @@ public class AppDeviceVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Date bindingTime;
|
private Date bindingTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定人
|
||||||
|
*/
|
||||||
|
private Date bindingBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线状态(0离线,1在线)
|
* 在线状态(0离线,1在线)
|
||||||
*/
|
*/
|
||||||
|
11
pom.xml
11
pom.xml
@ -83,6 +83,10 @@
|
|||||||
<monitor.username>fys</monitor.username>
|
<monitor.username>fys</monitor.username>
|
||||||
<monitor.password>123456</monitor.password>
|
<monitor.password>123456</monitor.password>
|
||||||
</properties>
|
</properties>
|
||||||
|
<activation>
|
||||||
|
<!-- 默认环境 -->
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
<!-- <activation> -->
|
<!-- <activation> -->
|
||||||
<!-- <!– 默认环境 –> -->
|
<!-- <!– 默认环境 –> -->
|
||||||
<!-- <activeByDefault>true</activeByDefault> -->
|
<!-- <activeByDefault>true</activeByDefault> -->
|
||||||
@ -92,14 +96,11 @@
|
|||||||
<id>prod</id>
|
<id>prod</id>
|
||||||
<properties>
|
<properties>
|
||||||
<profiles.active>prod</profiles.active>
|
<profiles.active>prod</profiles.active>
|
||||||
<logging.level>warn</logging.level>
|
<logging.level>info</logging.level>
|
||||||
<monitor.username>fys</monitor.username>
|
<monitor.username>fys</monitor.username>
|
||||||
<monitor.password>123456</monitor.password>
|
<monitor.password>123456</monitor.password>
|
||||||
</properties>
|
</properties>
|
||||||
<activation>
|
|
||||||
<!-- 默认环境 -->
|
|
||||||
<activeByDefault>true</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>jingquan</id>
|
<id>jingquan</id>
|
||||||
|
Reference in New Issue
Block a user