Bladeren bron

添加websocket

gaoxiong 1 jaar geleden
bovenliggende
commit
addb92602c

+ 61 - 0
project_data/config/nacos/application-dev.yml

@@ -0,0 +1,61 @@
+spring:
+  redis:
+    database: 2
+    sentinel:
+      nodes:
+        - "redis://10.87.21.157:26379"
+        - "redis://10.87.21.158:26379"
+        - "redis://10.87.21.159:26379"
+      master: mymaster
+    password: Xunmeizongmu_2019
+  autoconfigure:
+    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  servlet:
+    multipart:
+      max-file-size: 20MB
+# feign 配置
+feign:
+  sentinel:
+    enabled: true
+  okhttp:
+    enabled: true
+  httpclient:
+    enabled: false
+  client:
+    config:
+      default:
+        connectTimeout: 10000
+        readTimeout: 10000
+  compression:
+    request:
+      enabled: true
+    response:
+      enabled: true
+
+# 暴露监控端点
+management:
+  endpoints:
+    web:
+      exposure:
+        include: '*'
+fjnx:
+  host:
+  systemCode:
+  passIP:
+  passPort:
+  appCode:
+  secretName:
+jwt:
+  secretKey: zbcdefghijklmnopqrstuvwxyz
+  issuer: xunmei.com
+
+websocket:
+  # 如果关闭 需要和前端开关一起关闭
+  enabled: true
+  # 路径
+  path: /websocket
+  # 设置访问源地址
+  allowedOrigins: '*'

+ 34 - 0
project_data/config/nacos/soc-auth-dev.yml

@@ -0,0 +1,34 @@
+swagger:
+  title: 认证授权中心接口文档
+  license: Powered By soc
+  licenseUrl:
+#统一运营门户登录信息
+fjnx:
+  #  统一运营门户ip
+  host: 192.111.60.143
+  #  统一运营门户端口
+  port: 9191
+  #  统一运营门户定义的系统编码
+  systemCode: 61303
+  #  密管系统ip
+  passIp: 192.111.7.75
+  #  密管系统端口
+  passPort: 40105
+  #  密管系统对应标识
+  appCode: MSP
+  #  密管系统 秘钥
+  secretName: msp.uop-SM4.zek
+  # 使用token获取用户信息,get方式
+  webInfoUrl: http://{0}:{1}/yusp-group/api/session?systemCode={2}
+  #  用户登录接口 方式post
+  userLoginUrl: http://{0}:{1}/yusp-group/api/login?systemCode={2}
+# 移动运营门户参数
+fjnxApp:
+  #  移动运营平台地址
+  host: 192.111.37.181
+  #根据token获取移动运营平台账号信息 post方式
+  accountUrl: https://{0}/uaa/api/v1.0/user/account?access_token={1}
+  #  根据账号获取人员信息 post方式
+  userInfoUrl: https://{0}/sap/api/v1.0/user/user/find/{1}?access_token={2}
+
+

+ 78 - 0
project_data/config/nacos/soc-core-dev.yml

@@ -0,0 +1,78 @@
+# spring配置
+spring:
+  datasource:
+    druid:
+      stat-view-servlet:
+        enabled: true
+        loginUsername: admin
+        loginPassword: 123456
+    dynamic:
+      druid:
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        maxWait: 60000
+        timeBetweenEvictionRunsMillis: 60000
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        filters: stat,slf4j
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        # 主库数据源
+        master:
+          driver-class-name: com.mysql.cj.jdbc.Driver
+          url: jdbc:mysql://10.87.21.158:3306/soc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
+          username: root
+          password: XM_zm2019
+mybatis-plus:
+  # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
+  # 例如 com.**.**.mapper
+  mapperPackage: com.xunmei.**.mapper
+  # 对应的 XML 文件位置
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.xunmei.**.domain
+  # 启动时是否检查 MyBatis XML 文件的存在,默认不检查
+  checkConfigLocation: false
+  configuration:
+    # 自动驼峰命名规则(camel case)映射
+    mapUnderscoreToCamelCase: true
+    # MyBatis 自动映射策略
+    # NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射
+    autoMappingBehavior: PARTIAL
+    # MyBatis 自动映射时未知列或未知属性处理策
+    # NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息
+    autoMappingUnknownColumnBehavior: NONE
+    # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
+    # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
+    # 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl
+    #logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl
+    logImpl: org.apache.ibatis.logging.stdout.StdOutImpl
+  global-config:
+    # 是否打印 Logo banner
+    banner: true
+    dbConfig:
+      # 主键类型
+      # AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
+      idType: ASSIGN_ID
+      # 逻辑已删除值
+      logicDeleteValue: 2
+      # 逻辑未删除值
+      logicNotDeleteValue: 0
+      # 字段验证策略之 insert,在 insert 的时候的字段验证策略
+      # IGNORED 忽略 NOT_NULL 非NULL NOT_EMPTY 非空 DEFAULT 默认 NEVER 不加入 SQL
+      insertStrategy: NOT_NULL
+      # 字段验证策略之 update,在 update 的时候的字段验证策略
+      updateStrategy: NOT_NULL
+      # 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件
+      where-strategy: NOT_NULL
+# swagger配置
+swagger:
+  title: CORE模块接口文档
+  license: Powered By soc
+  licenseUrl:

+ 6 - 0
project_data/config/nacos/soc-file-dev.yml

@@ -0,0 +1,6 @@
+# 本地文件上传
+file:
+  secretKey: NOYQ4xpRiUM=
+  domain: http://10.87.11.94:9888
+  path: /home/xunmei/uploadPath
+  prefix: /statics

+ 158 - 0
project_data/config/nacos/soc-gateway-dev.yml

@@ -0,0 +1,158 @@
+spring:
+  cloud:
+    gateway:
+      globalcors:
+        corsConfigurations:
+          '[/**]':
+            allowedOriginPatterns: "*"
+            allowed-methods: "*"
+            allowed-headers: "*"
+            allow-credentials: true
+            exposedHeaders: "Content-Disposition,Content-Type,Cache-Control"
+      discovery:
+        locator:
+          lowerCaseServiceId: true
+          enabled: true
+      routes:
+        # 认证中心
+        - id: soc-auth
+          uri: lb://soc-auth
+          predicates:
+            - Path=/auth/**
+          filters:
+            # 验证码处理
+            - CacheRequestFilter
+            - ValidateCodeFilter
+            - StripPrefix=1
+        # 代码生成
+        - id: soc-gen
+          uri: lb://soc-gen
+          predicates:
+            - Path=/code/*/*
+          filters:
+            - StripPrefix=1
+        # 定时任务
+        - id: soc-job
+          uri: lb://soc-job
+          predicates:
+            - Path=/schedule/**
+          filters:
+            - StripPrefix=1
+        # 系统模块
+        - id: soc-system
+          uri: lb://soc-system
+          predicates:
+            - Path=/system/**
+          filters:
+            - StripPrefix=1
+        # 文件服务
+        - id: soc-file
+          uri: lb://soc-file
+          predicates:
+            - Path=/file/**
+          filters:
+            - StripPrefix=1
+        # 核心服务
+        - id: soc-core
+          uri: lb://soc-core
+          predicates:
+            - Path=/core/**
+          filters:
+            - StripPrefix=1
+        # 同步服务
+        - id: soc-sync
+          uri: lb://soc-sync
+          predicates:
+            - Path=/sync/**
+          filters:
+            - StripPrefix=1
+            # 北向服务
+        - id: soc-mediator
+          uri: lb://soc-mediator
+          predicates:
+            - Path=/mediator/**
+          filters:
+            - StripPrefix=1
+        - id: soc-iot
+          uri: lb://soc-iot
+          predicates:
+            - Path=/iot/**
+          filters:
+            - StripPrefix=1
+            # 短信服务
+        - id: soc-sms
+          uri: lb://soc-sms
+          predicates:
+            - Path=/sms/**
+          filters:
+            - StripPrefix=1
+        # 部署中心服务
+        - id: soc-deploy
+          uri: lb://soc-deploy
+          predicates:
+            - Path=/api/deploy/**
+          filters:
+            - StripPrefix=2
+          # websocket模块
+        - id: soc-websocket
+          uri: lb:ws://soc-system
+          predicates:
+            - Path=/websocket/**
+        - id: soc-websocket
+          uri: lb:ws://soc-mediator
+          predicates:
+            - Path=/ws/**
+        - id: soc-websocket
+          uri: lb:ws://soc-mediator
+          predicates:
+            - Path=/ws1/**
+        - id: soc-host
+          uri: lb:ws://soc-host
+          predicates:
+            - Path=/host/**
+        - id: soc-host
+          uri: lb:ws://soc-host
+          predicates:
+            - Path=/host1/**
+
+# 安全配置
+security:
+  # 验证码
+  captcha:
+    enabled: false
+    type: math
+  # 防止XSS攻击
+  xss:
+    enabled: true
+    excludeUrls:
+      - /system/notice
+      - /system/config
+  # 不校验白名单
+  ignore:
+    whites:
+      - /auth/logout
+      - /auth/logoutApp
+      - /auth/tokenlogin
+      - /auth/login
+      - /auth/loginApp
+      - /auth/register
+      - /*/v2/api-docs
+      - /csrf
+      - /mediator/**
+      - /system/version/checkUpdate
+      - /system/version/download/*
+      - /file/file/getFile/*
+      - /api/deploy/register
+      - /api/deploy/accesstoken
+      - /api/deploy/package/download/**
+      - /api/deploy/agent/download/**
+      - /api/deploy/frontend/synchronDate
+      - /api/deploy/heartbeat
+      - /api/deploy/list
+      - /api/deploy/report
+      - /api/deploy/task
+      - /api/deploy/taskReport
+      - /ws/**
+      - /ws1/**
+      - /host/**
+      - /host1/**

+ 56 - 0
project_data/config/nacos/soc-job-dev.yml

@@ -0,0 +1,56 @@
+# spring配置
+spring:
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://10.87.21.158:3306/quartz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+    username: root
+    password: XM_zm2019
+
+# mybatis配置
+mybatis-plus:
+  # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
+  # 例如 com.**.**.mapper
+  mapperPackage: com.xunmei.**.mapper
+  # 对应的 XML 文件位置
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.xunmei.**.domain
+  # 启动时是否检查 MyBatis XML 文件的存在,默认不检查
+  checkConfigLocation: false
+  configuration:
+    # 自动驼峰命名规则(camel case)映射
+    mapUnderscoreToCamelCase: true
+    # MyBatis 自动映射策略
+    # NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射
+    autoMappingBehavior: PARTIAL
+    # MyBatis 自动映射时未知列或未知属性处理策
+    # NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息
+    autoMappingUnknownColumnBehavior: NONE
+    # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
+    # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
+    # 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl
+    #logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl
+    logImpl: org.apache.ibatis.logging.stdout.StdOutImpl
+  global-config:
+    # 是否打印 Logo banner
+    banner: true
+    dbConfig:
+      # 主键类型
+      # AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
+      idType: ASSIGN_ID
+      # 逻辑已删除值
+      logicDeleteValue: 2
+      # 逻辑未删除值
+      logicNotDeleteValue: 0
+      # 字段验证策略之 insert,在 insert 的时候的字段验证策略
+      # IGNORED 忽略 NOT_NULL 非NULL NOT_EMPTY 非空 DEFAULT 默认 NEVER 不加入 SQL
+      insertStrategy: NOT_NULL
+      # 字段验证策略之 update,在 update 的时候的字段验证策略
+      updateStrategy: NOT_NULL
+      # 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件
+      where-strategy: NOT_NULL
+# swagger配置
+swagger:
+  title: 定时任务接口文档
+  license:
+  licenseUrl:

+ 91 - 0
project_data/config/nacos/soc-system-dev.yml

@@ -0,0 +1,91 @@
+# spring配置
+spring:
+  datasource:
+    druid:
+      stat-view-servlet:
+        enabled: true
+        loginUsername: admin
+        loginPassword: 123456
+    dynamic:
+      druid:
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        maxWait: 60000
+        timeBetweenEvictionRunsMillis: 60000
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: true
+        testOnReturn: true
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        filters: stat,slf4j
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        # 主库数据源
+        master:
+          driver-class-name: com.mysql.cj.jdbc.Driver
+          url: jdbc:mysql://10.87.23.48:3306/soc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true&connectTimeout=30000&autoReconnect=true&failOverReadOnly=false
+          username: root
+          password: XM_zm2019
+          # 从库数据源
+          # slave:
+          # username:
+          # password:
+          # url:
+          # driver-class-name:
+
+    # mybatis配置
+    #mybatis:
+    # 搜索指定包别名
+    #typeAliasesPackage: com.xunmei.system
+    # 配置mapper的扫描,找到所有的mapper.xml映射文件
+    #mapperLocations: classpath:mapper/**/*.xml
+mybatis-plus:
+  # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
+  # 例如 com.**.**.mapper
+  mapperPackage: com.xunmei.**.mapper
+  # 对应的 XML 文件位置
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.xunmei.**.domain
+  # 启动时是否检查 MyBatis XML 文件的存在,默认不检查
+  checkConfigLocation: false
+  configuration:
+    # 自动驼峰命名规则(camel case)映射
+    mapUnderscoreToCamelCase: true
+    # MyBatis 自动映射策略
+    # NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射
+    autoMappingBehavior: PARTIAL
+    # MyBatis 自动映射时未知列或未知属性处理策
+    # NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息
+    autoMappingUnknownColumnBehavior: NONE
+    # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
+    # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
+    # 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl
+    #logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl
+    logImpl: org.apache.ibatis.logging.stdout.StdOutImpl
+  global-config:
+    # 是否打印 Logo banner
+    banner: true
+    dbConfig:
+      # 主键类型
+      # AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
+      idType: ASSIGN_ID
+      # 逻辑已删除值
+      logicDeleteValue: 2
+      # 逻辑未删除值
+      logicNotDeleteValue: 0
+      # 字段验证策略之 insert,在 insert 的时候的字段验证策略
+      # IGNORED 忽略 NOT_NULL 非NULL NOT_EMPTY 非空 DEFAULT 默认 NEVER 不加入 SQL
+      insertStrategy: NOT_NULL
+      # 字段验证策略之 update,在 update 的时候的字段验证策略
+      updateStrategy: NOT_NULL
+      # 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件
+      where-strategy: NOT_NULL
+# swagger配置
+swagger:
+  title: 系统模块接口文档
+  license: Powered By soc
+  licenseUrl: