#update
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.maibu;
|
||||
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
||||
import com.dtflys.forest.springboot.annotation.ForestScan;
|
||||
import com.maibu.netty.NettyServer;
|
||||
import com.maibu.websocket.WebsocketHandler;
|
||||
@@ -13,7 +12,7 @@ import org.springframework.context.ConfigurableApplicationContext;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@SpringBootApplication(exclude = { DruidDataSourceAutoConfigure.class })
|
||||
@SpringBootApplication()
|
||||
@ForestScan(basePackages = "com.maibu")
|
||||
public class MiddlePlatformApplication
|
||||
{
|
||||
|
||||
@@ -7,8 +7,6 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.google.zxing.client.j2se.MatrixToImageWriter;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.maibu.config.RuoYiConfig;
|
||||
import com.maibu.config.ServerConfig;
|
||||
import com.maibu.constant.Constants;
|
||||
@@ -17,7 +15,6 @@ import com.maibu.utils.MessageUtils;
|
||||
import com.maibu.utils.StringUtils;
|
||||
import com.maibu.utils.file.FileUploadUtils;
|
||||
import com.maibu.utils.file.FileUtils;
|
||||
import com.maibu.utils.file.QRCodeUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
@@ -175,25 +172,25 @@ public class CommonController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成二维码
|
||||
* @param url url
|
||||
|
||||
* */
|
||||
@GetMapping(value = "/createQrCode")
|
||||
@ApiOperation("根据url生成二维码")
|
||||
public void getCode(String url, HttpServletResponse response) throws IOException {
|
||||
// 设置响应流信息
|
||||
response.setContentType("image/jpg");
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setDateHeader("Expires", 0);
|
||||
|
||||
OutputStream stream = response.getOutputStream();
|
||||
|
||||
//获取一个二维码图片
|
||||
BitMatrix bitMatrix = QRCodeUtils.createCode(url);
|
||||
//以流的形式输出到前端
|
||||
MatrixToImageWriter.writeToStream(bitMatrix , "jpg" , stream);
|
||||
}
|
||||
// /**
|
||||
// * 生成二维码
|
||||
// * @param url url
|
||||
//
|
||||
// * */
|
||||
// @GetMapping(value = "/createQrCode")
|
||||
// @ApiOperation("根据url生成二维码")
|
||||
// public void getCode(String url, HttpServletResponse response) throws IOException {
|
||||
// // 设置响应流信息
|
||||
// response.setContentType("image/jpg");
|
||||
// response.setHeader("Pragma", "no-cache");
|
||||
// response.setHeader("Cache-Control", "no-cache");
|
||||
// response.setDateHeader("Expires", 0);
|
||||
//
|
||||
// OutputStream stream = response.getOutputStream();
|
||||
//
|
||||
// //获取一个二维码图片
|
||||
// BitMatrix bitMatrix = QRCodeUtils.createCode(url);
|
||||
// //以流的形式输出到前端
|
||||
// MatrixToImageWriter.writeToStream(bitMatrix , "jpg" , stream);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -8,10 +8,7 @@ import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.entity.SysUser;
|
||||
import com.maibu.core.domain.model.LoginUser;
|
||||
import com.maibu.enums.BusinessType;
|
||||
import com.maibu.enums.SocialPlatformType;
|
||||
import com.maibu.model.UserSocialProfile;
|
||||
import com.maibu.service.ISysUserService;
|
||||
import com.maibu.service.IUserSocialProfileService;
|
||||
import com.maibu.utils.MessageUtils;
|
||||
import com.maibu.utils.SecurityUtils;
|
||||
import com.maibu.utils.StringUtils;
|
||||
@@ -22,17 +19,9 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 个人信息 业务处理
|
||||
*
|
||||
@@ -49,8 +38,8 @@ public class SysProfileController extends BaseController
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private IUserSocialProfileService iUserSocialProfileService;
|
||||
// @Autowired
|
||||
// private IUserSocialProfileService iUserSocialProfileService;
|
||||
|
||||
/**
|
||||
* 个人信息
|
||||
@@ -64,10 +53,10 @@ public class SysProfileController extends BaseController
|
||||
AjaxResult ajax = AjaxResult.success(user);
|
||||
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
||||
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
||||
List<UserSocialProfile> socialProfileList = iUserSocialProfileService.selectUserSocialProfile(loginUser.getUserId());
|
||||
UserSocialProfile userSocialProfile = socialProfileList.stream().filter(s -> SocialPlatformType.listWechatPlatform.contains(s.getSourceClient()) && "1".equals(s.getStatus())).findFirst().orElse(null);
|
||||
ajax.put("socialGroup", socialProfileList);
|
||||
ajax.put("wxBind", userSocialProfile != null);
|
||||
// List<UserSocialProfile> socialProfileList = iUserSocialProfileService.selectUserSocialProfile(loginUser.getUserId());
|
||||
// UserSocialProfile userSocialProfile = socialProfileList.stream().filter(s -> SocialPlatformType.listWechatPlatform.contains(s.getSourceClient()) && "1".equals(s.getStatus())).findFirst().orElse(null);
|
||||
// ajax.put("socialGroup", socialProfileList);
|
||||
// ajax.put("wxBind", userSocialProfile != null);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,33 +1,11 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
dynamic:
|
||||
primary: master
|
||||
strict: false
|
||||
datasource:
|
||||
master:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/fastbee?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: fastbee
|
||||
password: maibu520
|
||||
# slave:
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/fastbee1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: root
|
||||
# password: fastbee
|
||||
sharding:
|
||||
url: jdbc:shardingsphere:classpath:sharding-sphere-config.yaml
|
||||
driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
|
||||
taos: # 配置 taos 数据源
|
||||
enabled: false
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.taosdata.jdbc.TSDBDriver
|
||||
url: jdbc:TAOS://fastbee:6030/fastbee_log?timezone=UTC-8&charset=utf-8
|
||||
username: root
|
||||
password: taosdata
|
||||
dbName: fastbee_log
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://1.95.137.212:3306/fastbee?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: fastbee
|
||||
password: maibu520
|
||||
|
||||
# redis 配置
|
||||
redis:
|
||||
@@ -58,19 +36,6 @@ spring:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
||||
|
||||
# sip 配置
|
||||
sip:
|
||||
enabled: false # 是否启用视频监控SIP,true为启用
|
||||
## 本地调试时,绑定网卡局域网IP,设备在同一局域网,设备接入IP填写绑定IP
|
||||
## 部署服务端时,默认绑定容器IP,设备接入IP填写服务器公网IP
|
||||
ip: 177.7.0.13
|
||||
port: 5061 # SIP端口(保持默认)
|
||||
domain: 3402000000 # 由省级、市级、区级、基层编号组成
|
||||
id: 34020000002000000001 # 同上,另外增加编号,(可保持默认)
|
||||
password: 12345678 # 监控设备接入的密码
|
||||
log: true
|
||||
zlmRecordPath: /opt/media/bin/www
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
|
||||
@@ -1,44 +1,22 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
dynamic:
|
||||
primary: master
|
||||
strict: false
|
||||
datasource:
|
||||
master:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/fastbee?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: maibu520
|
||||
filters: stat,wall
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
# slave:
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/fastbee1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: root
|
||||
# password: fastbee
|
||||
sharding:
|
||||
url: jdbc:shardingsphere:classpath:sharding-sphere-config.yaml
|
||||
driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
|
||||
taos: # 配置 taos 数据源
|
||||
enabled: true
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.taosdata.jdbc.TSDBDriver
|
||||
url: jdbc:TAOS://fastbee:6030/fastbee_log?timezone=UTC-8&charset=utf-8
|
||||
username: root
|
||||
password: taosdata
|
||||
dbName: fastbee_log
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/fastbee?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: maibu520
|
||||
filters: stat,wall
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
# redis 配置
|
||||
redis:
|
||||
host: 177.7.0.10 # 地址
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
dynamic:
|
||||
primary: master
|
||||
strict: false
|
||||
datasource:
|
||||
master:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/fastbee?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: maibu520
|
||||
filters: stat,wall
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
# slave:
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/fastbee1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: root
|
||||
# password: fastbee
|
||||
sharding:
|
||||
url: jdbc:shardingsphere:classpath:sharding-sphere-config.yaml
|
||||
driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
|
||||
taos: # 配置 taos 数据源
|
||||
enabled: true
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.taosdata.jdbc.TSDBDriver
|
||||
url: jdbc:TAOS://fastbee:6030/fastbee_log?timezone=UTC-8&charset=utf-8
|
||||
username: root
|
||||
password: taosdata
|
||||
dbName: fastbee_log
|
||||
# redis 配置
|
||||
redis:
|
||||
host: localhost # 地址
|
||||
port: 6379 # 端口,默认为6379
|
||||
database: 3 # 数据库索引
|
||||
password: # 密码
|
||||
timeout: 10s # 连接超时时间
|
||||
lettuce:
|
||||
pool:
|
||||
min-idle: 0 # 连接池中的最小空闲连接
|
||||
max-idle: 8 # 连接池中的最大空闲连接
|
||||
max-active: 8 # 连接池的最大数据库连接数
|
||||
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
# mqtt 配置
|
||||
mqtt:
|
||||
username: fastbee # 账号
|
||||
password: fastbee # 密码
|
||||
host-url: tcp://localhost:1883 # mqtt连接tcp地址
|
||||
client-id: ${random.int} # 客户端Id,不能相同,采用随机数 ${random.value}
|
||||
default-topic: test # 默认主题
|
||||
timeout: 30 # 超时时间
|
||||
keepalive: 30 # 保持连接
|
||||
clearSession: true # 清除会话(设置为false,断开连接,重连后使用原来的会话 保留订阅的主题,能接收离线期间的消息)
|
||||
|
||||
# sip 配置
|
||||
sip:
|
||||
enabled: true # 是否启用视频监控SIP,true为启用
|
||||
## 默认为容器IP,IDE启动可以写本地网卡内网IP或者127.0.0.1
|
||||
## 本地调试需保持设备与服务器在同一局域网
|
||||
ip: 192.168.31.165
|
||||
port: 5061 # SIP端口(保持默认)
|
||||
domain: 3402000000 # 由省级、市级、区级、基层编号组成
|
||||
id: 34020000002000000001 # 同上,另外增加编号,(可保持默认)
|
||||
password: 12345678 # 监控设备接入的密码
|
||||
log: true
|
||||
zlmRecordPath: /opt/media/bin/www
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.fastbee: debug
|
||||
com.yomahub: debug
|
||||
org.dromara: warn
|
||||
org.springframework: warn
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
enabled: true # 是否开启swagger
|
||||
pathMapping: /dev-api # 请求前缀
|
||||
|
||||
@@ -107,16 +107,10 @@ token:
|
||||
secret: abcdefghijklfastbeesmartrstuvwxyz # 令牌密钥
|
||||
expireTime: 1440 # 令牌有效期(默认30分钟)1440为一天
|
||||
|
||||
# MyBatis配置
|
||||
#mybatis:
|
||||
# typeAliasesPackage: com.fastbee.**.domain # 搜索指定包别名
|
||||
# mapperLocations: classpath*:mapper/**/*Mapper.xml # 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||
# configLocation: classpath:mybatis/mybatis-config.xml # 加载全局的配置文件
|
||||
|
||||
# mybatis-plus配置
|
||||
mybatis-plus:
|
||||
typeAliasesPackage: com.maibu.**.domain # 搜索指定包别名
|
||||
mapperLocations: classpath*:mapper/**/*Mapper.xml # 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||
mapperLocations: classpath*:mapper/**/*Mapper.xml,classpath*:system/**/*Mapper.xml # 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||
configLocation: classpath:mybatis/mybatis-config.xml # 加载全局的配置文件
|
||||
global-config:
|
||||
db-config:
|
||||
@@ -182,37 +176,3 @@ forest: # Forest配置 版本为1.5.36
|
||||
log-response-status: true # 打开/关闭Forest响应状态日志(默认为 true)
|
||||
log-response-content: true # 打开/关闭Forest响应内容日志(默认为 false)
|
||||
async-mode: platform # [自v1.5.27版本起可用] 异步模式(默认为 platform)
|
||||
|
||||
liteflow:
|
||||
#FlowExecutor的execute2Future的线程数,默认为64
|
||||
main-executor-works: 64
|
||||
#FlowExecutor的execute2Future的自定义线程池Builder
|
||||
main-executor-class: com.fastbee.ruleEngine.config.MainExecutorBuilder
|
||||
#并行节点的线程池Builder
|
||||
thread-executor-class: com.fastbee.ruleEngine.config.WhenExecutorBuilder
|
||||
rule-source-ext-data-map:
|
||||
# 应用名称,规则链和脚本组件名称需要一致,不要修改
|
||||
applicationName: fastbee
|
||||
#是否开启SQL日志
|
||||
sqlLogEnabled: true
|
||||
# 规则多时,启用快速加载模式
|
||||
fast-load: false
|
||||
#是否开启SQL数据轮询自动刷新机制 默认不开启
|
||||
pollingEnabled: false
|
||||
pollingIntervalSeconds: 60
|
||||
pollingStartSeconds: 60
|
||||
#以下是chain表的配置
|
||||
chainTableName: iot_scene
|
||||
chainApplicationNameField: application_name
|
||||
chainNameField: chain_name
|
||||
elDataField: el_data
|
||||
chainEnableField: enable
|
||||
#以下是script表的配置
|
||||
scriptTableName: iot_script
|
||||
scriptApplicationNameField: application_name
|
||||
scriptIdField: script_id
|
||||
scriptNameField: script_name
|
||||
scriptDataField: script_data
|
||||
scriptTypeField: script_type
|
||||
scriptLanguageField: script_language
|
||||
scriptEnableField: enable
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Application Version: ${fastbee.version}
|
||||
Application Version: ${maibu.version}
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
Reference in New Issue
Block a user