Browse Source

revert application.yml
revert pom

jay 1 năm trước cách đây
mục cha
commit
1229b668b9

+ 9 - 9
iot-common/iot-common-dao/iot-data-serviceImpl-rdb/pom.xml

@@ -48,10 +48,10 @@
             <artifactId>yitter-idgenerator</artifactId>
         </dependency>
 
-<!--        <dependency>-->
-<!--            <groupId>com.h2database</groupId>-->
-<!--            <artifactId>h2</artifactId>-->
-<!--        </dependency>-->
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+        </dependency>
 
 <!--        <dependency>-->
 <!--            <groupId>mysql</groupId>-->
@@ -59,11 +59,11 @@
 <!--            <version>8.0.32</version>-->
 <!--        </dependency>-->
 <!--        -->
-        <dependency>
-            <groupId>org.postgresql</groupId>
-            <artifactId>postgresql</artifactId>
-            <version>42.2.9</version>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>org.postgresql</groupId>-->
+<!--            <artifactId>postgresql</artifactId>-->
+<!--            <version>42.2.9</version>-->
+<!--        </dependency>-->
 
         <dependency>
             <groupId>commons-io</groupId>

+ 187 - 2
iot-starter/src/main/resources/application.yml

@@ -7,9 +7,9 @@ spring:
       enabled: true
       max-file-size: 10MB
       max-request-size: 12MB
-  profiles:
-    active: postgres
 
+  #注: 切换数据库时需要将项目根目录中的.init文件删除再重启
+  # <<=======内置H2数据库连接设置开始==========
   jpa:
     show-sql: true
     hibernate:
@@ -17,7 +17,186 @@ spring:
     properties:
       hibernate:
         format_sql: true
+  sql:
+    init:
+      schema-locations: classpath:sql/schema.sql
+      mode: ALWAYS
+  datasource:
+    url: jdbc:h2:./data/iotkit;MODE=MySQL
+    username: sa
+    password: 123456
+    driverClassName: org.h2.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
+    dynamic:
+      hikari:
+        connection-timeout: 5000
+        idle-timeout: 30000 # 经过idle-timeout时间如果连接还处于空闲状态, 该连接会被回收
+        min-idle: 5 # 池中维护的最小空闲连接数, 默认为 10 个
+        max-pool-size: 16 # 池中最大连接数, 包括闲置和使用中的连接, 默认为 10 个
+        max-lifetime: 60000 # 如果一个连接超过了时长,且没有被使用, 连接会被回收
+        is-auto-commit: true
+      primary: master #设置默认的数据源或者数据源组,默认值即为master
+      strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+      datasource:
+        # 主库数据源
+        master:
+          type: ${spring.datasource.type}
+          driverClassName: org.h2.Driver
+          # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
+          # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
+          url: jdbc:h2:./data/iotkit;MODE=MySQL
+          username: sa
+          password: 123456
+        # 从库数据源
+        slave:
+          lazy: true
+          type: ${spring.datasource.type}
+          driverClassName: org.h2.Driver
+          url: jdbc:h2:./data/iotkit;MODE=MySQL
+          username: sa
+          password: 123456
 
+    # 内置h2 web console设置
+    platform: h2
+  h2:
+    console:
+      enabled: true
+      path: /h2
+      settings:
+        web-allow-others: true
+  #=======内置H2数据库连接设置结束==========>>
+
+  # <<==========mysql配置开始==============
+  #  jpa:
+  #    database: MySQL
+  #    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+  #    show-sql: true
+  #    hibernate:
+  #      ddl-auto: update
+  #    properties:
+  #      hibernate:
+  #        format_sql: true
+  #  datasource:
+  #    type: com.zaxxer.hikari.HikariDataSource
+  #    dynamic:
+  #      hikari:
+  #        connection-timeout: 5000
+  #        idle-timeout: 30000 # 经过idle-timeout时间如果连接还处于空闲状态, 该连接会被回收
+  #        min-idle: 5 # 池中维护的最小空闲连接数, 默认为 10 个
+  #        max-pool-size: 16 # 池中最大连接数, 包括闲置和使用中的连接, 默认为 10 个
+  #        max-lifetime: 60000 # 如果一个连接超过了时长,且没有被使用, 连接会被回收
+  #        is-auto-commit: true
+  #      primary: master #设置默认的数据源或者数据源组,默认值即为master
+  #      strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+  #      datasource:
+  #        # 主库数据源
+  #        master:
+  #          type: ${spring.datasource.type}
+  #          driverClassName: com.mysql.cj.jdbc.Driver
+  #          # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
+  #          url: jdbc:mysql://192.168.31.136:3306/iotkit?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false
+  #          username: root
+  #          password: 123456
+  # ============mysql配置结束============>>
+
+  #<<================es时序数据配置开始===============
+  elasticsearch:
+    rest:
+      #使用内置es的配置
+      #uris: http://elasticsearch:9200
+      uris: http://127.0.0.1:9200
+      username:
+      password:
+      connection-timeout: 10s
+  #================es时序数据配置结束===============>>
+
+  #<<===========tdengine时序数据库配置开始============
+  #  td-datasource:
+  #    url: jdbc:TAOS-RS://127.0.0.1:6041/iotkit?timezone=UTC-8&charset=UTF-8&locale=en_US.UTF-8
+  #    username: root
+  #    password: taosdata
+  #    driverClassName: com.taosdata.jdbc.rs.RestfulDriver
+  #===========tdengine时序数据库配置开始============>>
+
+  redis:
+    #使用内置redis的配置
+    #host: redis
+    host: 127.0.0.1
+    port: 6379
+    database: 0
+
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+#  profiles:
+#    active: mysql
+
+#application.yml中打开注释支持rocketMq作为消息总线,pom.xml中打开注释使用rocketmq消息总线
+#rocketmq:
+#  name-server: 172.16.1.113:9876
+#  producer:
+#        group: iotkit
+
+#图片存储用的是阿里云oss,如果需要上传产品图片才需要配置
+aliyun:
+  bucketId:
+  endpoint:
+  accessKeyId:
+  accessKeySecret:
+
+sa-token:
+  # token名称 (同时也是cookie名称)
+  token-name: token
+  # token有效期,单位s 默认30天, -1代表永不过期
+  timeout: 2592000
+  # token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
+  activity-timeout: -1
+  # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
+  is-concurrent: true
+  # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
+  is-share: false
+  # token风格
+  token-style: uuid
+  # 是否输出操作日志
+  is-log: false
+
+captcha:
+  enable: true
+  # 页面 <参数设置> 可开启关闭 验证码校验
+  # 验证码类型 math 数组计算 char 字符验证
+  type: MATH
+  # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
+  category: CIRCLE
+  # 数字验证码位数
+  numberLength: 1
+  # 字符验证码长度
+  charLength: 4
+
+# 用户配置
+user:
+  password:
+    # 密码最大错误次数
+    maxRetryCount: 5
+    # 密码锁定时间(默认10分钟)
+    lockTime: 10
+
+# openapi配置
+openapi:
+  appid: 123456789
+  password: 123456
+
+oss:
+  region: xxxxx
+  endpoint: xxxxx
+  accessKey: xxxxx
+  secretKey: xxxxx
+  buckName: xxxx
+baetyl:
+  api-type: feign
+  service-url: http://116.168.30.140:30004
+
+# MyBatisPlus配置
 # https://baomidou.com/config/
 mybatis-plus:
   # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
@@ -33,3 +212,9 @@ mybatis-plus:
       # AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
       # 如需改为自增 需要将数据库表全部设置为自增
       idType: ASSIGN_ID
+
+#微信小程序配置
+weixin:
+  appid: xx
+  secret: xx
+  authUrl: xx