作者 朱兆平

bugfix:

1. swagger-ui增加密码认证

Signed-off-by: mrz <17966059@qq.com>
  1 +#上传文件的路径,要带斜杠
  2 +web:
  3 + upload-path: /Users/mrz/Pictures/
  4 +server:
  5 + port: 10001
  6 + servlet:
  7 + context-path: ${SERVER_CONTEXTPATH:}
  8 +spring:
  9 + profiles:
  10 + active: dev
  11 + mvc:
  12 + #静态资源,设置上传文件的访问,
  13 + static-path-pattern: /**
  14 + thymeleaf:
  15 + cache: false
  16 + encoding: UTF-8
  17 + mode: XML
  18 + suffix: .xml
  19 + prefix: classpath:/templates/
  20 + resources:
  21 + static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,file:${web.upload-path}
  22 +
  23 + application:
  24 + name: wlpt-nmms-manage
  25 +
  26 + jackson:
  27 + serialization:
  28 + FAIL_ON_EMPTY_BEANS: false
  29 + #springboot2.0之后会把Date类型字段自动给转成UTC字符串 如:1990-11-26T16:00:00.000+0000,如果想转成时间戳在application.properties配置文件增加以下配置
  30 + date-format: yyyy-MM-dd HH:mm:ss
  31 + #时区必须要设置
  32 + time-zone: GMT+8
  33 + #ALWAYS的意思是即时属性为null,仍然也会输出这个key
  34 + default-property-inclusion: always
  35 +
  36 + cloud:
  37 + #eureka主机名,会在控制页面中显示
  38 + #DEV环境关闭注册。
  39 + features:
  40 + enabled: false
  41 + discovery:
  42 + enabled: false
  43 + service-registry:
  44 + auto-registration:
  45 + enabled: false
  46 +
  47 + datasource:
  48 + type: com.alibaba.druid.pool.DruidDataSource
  49 + #oracle
  50 + driver-class-name: oracle.jdbc.OracleDriver
  51 +# url: jdbc:oracle:thin:@192.168.1.199:10069:CGODB
  52 +# username: CGONMS
  53 +# password: 1q2w3e4r
  54 + url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
  55 + username: CGONMS
  56 + password: vmvnv1v2
  57 + #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
  58 +# url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8
  59 +# username: root
  60 +# password:
  61 +# driver-class-name: com.mysql.jdbc.Driver
  62 + max-idle: 20
  63 + max-wait: 10000
  64 + min-idle: 5
  65 + initial-size: 5
  66 + #配置初始化大小/最小/最大
  67 + druid:
  68 + initial-size: 1
  69 + min-idle: 1
  70 + #最大并发连接数
  71 + max-active: 40
  72 + #获取连接等待超时时间
  73 + max-wait: 60000
  74 + #一个连接在池中最小生存的时间
  75 + min-evictable-idle-time-millis: 300000
  76 + #间隔多久进行一次检测,检测需要关闭的空闲连接
  77 + time-between-eviction-runs-millis: 60000
  78 + #mysql
  79 +# validation-query: SELECT 1 FROM DUAL
  80 + #oracle
  81 + validation-query: SELECT 'x' FROM DUAL
  82 + test-while-idle: true
  83 + test-on-borrow: false
  84 + test-on-return: false
  85 + default-auto-commit: true
  86 +
  87 +eureka:
  88 + instance:
  89 + #eureka服务器页面中status的请求路径
  90 + status-page-url: http://${eureka.instance.hostname}:${server.port}/
  91 + prefer-ip-address: true
  92 + instance-id: ${spring.cloud.client.ip-address}:${server.port}
  93 + hostname: ${spring.cloud.client.ip-address}
  94 + client:
  95 + #eureka注册中心服务器地址
  96 + service-url:
  97 +# defaultZone: http://10.50.7.70:12345/eureka/
  98 + defaultZone: http://192.168.1.53:12345/eureka/
  99 + registry-fetch-interval-seconds: 30
  100 + lease-renewal-interval-in-seconds: 15
  101 + lease-expiration-duration-in-seconds: 45
  102 +
  103 +mybatis:
  104 + mapper-locations: classpath:mapping/*.xml
  105 + type-aliases-package: com.tianbo.warehouse.model
  106 +pagehelper:
  107 + #auto-dialect: true
  108 + #auto-runtime-dialect: true
  109 + helper-dialect: oracle
  110 + reasonable: true
  111 + support-methods-arguments: true
  112 + params: count=countSql
  113 +
  114 +#debug配置,debug或者为true的时候,logback才会记录和写入日志文件
  115 +trace: false
  116 +debug: true
  117 +
  118 +swagger:
  119 + production: false
  120 + basic:
  121 + enable: true
  122 + username: jack
  123 + password: Admin2021@999
  124 +
  125 +logging:
  126 + file:
  127 + path: ./logs/
  128 + name: system.log
  129 + config: config/logback-dev.xml
  130 + #转移到logback配置文件中
  131 + #level:
  132 + #org.apache.tomcat: info
  133 + #com.tianbo.warehouse.dao: DEBUG
  134 + #org.springframework.security: trace
  135 + #日志配置,输出到文本,
  136 +#Java Web Token 时效时间,单位秒
  137 +jwt:
  138 + max-alive: 300
  139 +# 舱单生成配置
  140 +customs:
  141 + # 操作员IC卡姓名
  142 + inputOpName: 翟梦一
  143 + # 操作员IC卡号
  144 + inputOpId: 8930000085548
  145 + # 报关公司
  146 + applyName: 河南航空货运发展有限公司
  147 + # 报关公司海关十位编码
  148 + applyCode: 4101888126
  149 + # 报关公司组织机构代码
  150 + copCode: 70678920X
  151 + #生成报文文件夹路径,尾部要带斜杠/
  152 + xml-path: customTemplate/
  153 + # 海关通道数据传输人识别号
  154 + transport-number: 460470678920X
  155 + # 转关运抵相关配置
  156 + transarrive:
  157 + #生成报文文件夹路径,尾部要带斜杠/
  158 + xml-save: transarriveSend/
  159 + # 客户端统一编号
  160 +# clientSeqno: "000000000000002050"
  161 + clientSeqno: "000000000000057246"
  162 +# clientSeqno: 460470678920X_DXPENT0000460002
  163 + # 邮箱客户端id
  164 + hostId: DXPENT0000460002
  165 + # 当前操作员ic卡证书号
  166 + certNo: DXPENT0000460002
  167 +
  168 +sso:
  169 + witheIP: 10.5.14.108,10.5.14.109,10.5.14.110
  170 +mq:
  171 + dir:
  172 + # 从mq队列读取存储到本地的路径
  173 + saveXml-dir:
  174 + # 从本地路径读取报文路径 发送的MQ队列
  175 + sendXml-dir: send
  176 + needSend: true
  177 + queue:
  178 + #发送mq队列名称
  179 + send-to-mq: response
  180 + #读取mq队列名称
  181 + read-from-mq: send
  182 + exchange:
  183 + #TCS回执发送到此交换,交换再把回执消息同步到其他配置的回执订阅队列
  184 + #交换名称
  185 + name: send.broadcast
  186 + #交换类型
  187 + type: fanout
  188 + #routing key名称,此处为空,所有绑定交换的队列都被广播
  189 + routing-key: transarrive
  190 + connection:
  191 + # ip: 218.28.199.134
  192 + # port: 8004
  193 + # vHost: NMMS
  194 + # username: tianbo
  195 + # password: vmvnv1v2VV
  196 + ip: 192.168.1.63
  197 + port: 5672
  198 + vHost: NMMS
  199 + username: admin
  200 + password: admin
  201 +feign:
  202 + hystrix:
  203 + enabled: true
  204 +inport-url: http://nmms1.15miaoo.com:17999
  205 +info:
  206 + version: 1.0
  207 + description: "新舱单辅助管理服务-统一认证、转运管理、提前运抵等"
1 package com.tianbo.analysis; 1 package com.tianbo.analysis;
2 2
  3 +import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
3 import com.google.common.base.Predicates; 4 import com.google.common.base.Predicates;
4 import org.springframework.context.annotation.Bean; 5 import org.springframework.context.annotation.Bean;
5 import org.springframework.context.annotation.Configuration; 6 import org.springframework.context.annotation.Configuration;
@@ -13,6 +14,7 @@ import springfox.documentation.spring.web.plugins.Docket; @@ -13,6 +14,7 @@ import springfox.documentation.spring.web.plugins.Docket;
13 import springfox.documentation.swagger2.annotations.EnableSwagger2; 14 import springfox.documentation.swagger2.annotations.EnableSwagger2;
14 15
15 @Configuration 16 @Configuration
  17 +@EnableSwaggerBootstrapUI
16 @EnableSwagger2 // Swagger的开关,表示已经启用Swagger 18 @EnableSwagger2 // Swagger的开关,表示已经启用Swagger
17 public class SwaggerConfig { 19 public class SwaggerConfig {
18 @Bean 20 @Bean