接入nacos

This commit is contained in:
俞扬
2023-07-17 17:04:26 +08:00
parent aab46306de
commit 7f38fb7e63
11 changed files with 51 additions and 174 deletions

View File

@@ -29,6 +29,16 @@
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
</dependency>
<!-- 服务注册与发现依赖 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
</dependencies>
<build>

View File

@@ -6,8 +6,7 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.annotation.EnableAsync;
@@ -20,6 +19,7 @@ import javax.sql.DataSource;
* @Description: C端web层
* @date 2023-05-17 11:28
*/
@EnableDiscoveryClient
@SpringBootApplication
@EnableAsync
@MapperScan("com.cool.store.mapper")

View File

@@ -1,93 +0,0 @@
#mysql config
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_hy?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
default.datasource.username=hsay
default.datasource.password=Z3J7xBbgouMD
#redis
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
spring.redis.port=6379
spring.redis.password=Cx111111
spring.redis.database=0
spring.redis.timeout=2000ms
spring.redis.lettuce.pool.max-wait=100ms
spring.redis.lettuce.pool.max-active=1024
spring.redis.lettuce.pool.max-idle=200
spring.redis.lettuce.pool.min-idle=0
spring.redis.lettuce.shutdown-timeout=100ms
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
#pagehelper
pagehelper.helper-dialect=mysql
pagehelper.reasonable=false
pagehelper.returnPageInfo=check
pagehelper.support-methods-arguments=false
pagehelper.params=count=countSql
pagehelper.page-size-zero=true
spring.mvc.async.request-timeout=60000
# mybatis config
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
#subtable size
customize_sub_table_size=10
mybatis.configuration.call-setters-on-nulls=true
mybatis.configuration.map-underscore-to-camel-case=true
isv.domain = https://abstore-isv.coolstore.cn/isv
#rocketmq \u914D\u7F6E
rocketmq.accessKey=zK2oVEz4G1ts23d2
rocketmq.secretKey=0UstLCS0mh2ASgBh
rocketmq.nameSrvAdder=http://rmq-cn-9lb38l1rx04.cn-hangzhou.rmq.aliyuncs.com:8080
rocketmq.topic=simple_message
#oss配置
oss.accessKeyId=LTAI5tRSXy2MrqaaBJ6gReur
oss.accessKeySecret=FFsl8d9batprJ0vXr0k4Y8ada40Wm2
oss.endpoint=oss-cn-hangzhou.aliyuncs.com
oss.bucket=cool-store-hsay
oss.file.dir = partner/171cddee76471740/
#企业corpId
corp.id = 171cddee76471740
#cdn地址
cdn.url=https://testhsaypic.coolstore.cn
#TRTC
trtc.sdkAppId=1400811820
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
trtc.video.callback.secretKey=1ECEAD34DBD84E838BF07FC7360EA4D8
weixin.appId=wx6f984e535e571818
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
signKey=77fea013c3a6459685b83c21a2fc3411
fixMobileOpenid=HSAY5531DA7
#MDM
hs.mdm.baseUrl=http://10.56.21.30
hs.mdm.appkey = HSAYPartner
hs.mdm.appsec = ab39fedb886fa3587c7f517551976de8b2606f5511fd8f8675266825d74c5cd3
#sms
hs.sms.accessKeyId = LTAI4GEZKz9PBqqKa3hjup3W
hs.sms.accessKeySecret = iVOiK74k7C1wVbuUbipgJbfpAh1Zdb
hs.sms.templateCode = SMS_461530041
xxl.job.admin.addresses =
xxl.job.executor.appname = ${spring.application.name}
xxl.job.executor.ip =
xxl.job.executor.port = 30201
xxl.job.executor.logpath = logs/xxl-job/jobhandler
xxl.job.executor.logretentiondays = 30
xxl.job.accessToken =
ec.baseUrl=http://127.0.0.1:8017
#飞书通知
feishu.notice.link.url = https://applink.feishu.cn/client/web_app/open?appId=cli_a4f3e24dc73a100c&lk_target_url=https%3A%2F%2Ftest-hsay-web.coolstore.cn%2F%23%2Fwork%2Fbench
#阿里云ak sk
aliyun.accessKeyId=LTAI5t9RaXvABZbHvoXjDFJ1
aliyun.accessKeySecret=zhOK7WWo3yGoUWkOMaatty19k25CMd
aliyun.authCode=Y81FVZepk6

View File

@@ -0,0 +1,3 @@
spring.cloud.nacos.discovery.server-addr=192.168.1.202:8848
spring.cloud.nacos.config.server-addr=192.168.1.202:8848
spring.cloud.nacos.config.file-extension=properties

View File

@@ -1,5 +1,5 @@
spring.application.name=coolstore-partner-webb
spring.profiles.active=@profileActive@
spring.application.name=hsay-partner-webb
spring.profiles.active=dev
server.port=31000
server.servlet.context-path=/partner/pc

View File

@@ -33,6 +33,16 @@
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
</dependency>
<!-- 服务注册与发现依赖 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
</dependencies>
<build>

View File

@@ -8,6 +8,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.annotation.EnableAsync;
@@ -20,6 +21,7 @@ import javax.sql.DataSource;
* @Description: B端web层
* @date 2023-05-17 11:28
*/
@EnableDiscoveryClient
@SpringBootApplication
@MapperScan("com.cool.store.mapper")
@EnableAsync

View File

@@ -1,74 +0,0 @@
#mysql config
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_hy?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
default.datasource.username=hsay
default.datasource.password=Z3J7xBbgouMD
#redis
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
spring.redis.port=6379
spring.redis.password=Cx111111
spring.redis.database=0
spring.redis.timeout=2000ms
spring.redis.lettuce.pool.max-wait=100ms
spring.redis.lettuce.pool.max-active=1024
spring.redis.lettuce.pool.max-idle=200
spring.redis.lettuce.pool.min-idle=0
spring.redis.lettuce.shutdown-timeout=100ms
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
#pagehelper
pagehelper.helper-dialect=mysql
pagehelper.reasonable=false
pagehelper.returnPageInfo=check
pagehelper.support-methods-arguments=false
pagehelper.params=count=countSql
pagehelper.page-size-zero=true
spring.mvc.async.request-timeout=60000
# mybatis config
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
#subtable size
customize_sub_table_size=10
mybatis.configuration.call-setters-on-nulls=true
mybatis.configuration.map-underscore-to-camel-case=true
isv.domain = https://abstore-isv.coolstore.cn/isv
#rocketmq \u914D\u7F6E
rocketmq.accessKey=LTAI5t5ouXZuFgxJMbQea3b2
rocketmq.secretKey=yuomDstRjSdihtN5zo8viDbWu8Z0ig
rocketmq.nameSrvAdder=http://MQ_INST_1947409023213164_BX3sLZnA.cn-hangzhou.mq-internal.aliyuncs.com:8080
rocketmq.topic=simple_message
#oss配置
oss.accessKeyId=LTAI5tRSXy2MrqaaBJ6gReur
oss.accessKeySecret=FFsl8d9batprJ0vXr0k4Y8ada40Wm2
oss.endpoint=oss-cn-hangzhou.aliyuncs.com
oss.bucket=cool-store-hsay
oss.file.dir = partner/171cddee76471740/
#企业corpId
corp.id = 171cddee76471740
#cdn地址
cdn.url=https://testhsaypic.coolstore.cn
#TRTC
trtc.sdkAppId=1400811820
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
weixin.appId=wxb2a0addf956ad4b7
weixin.appSecret=77abdcae754add92889566b543e5ad79
signKey=77fea013c3a6459685b83c21a2fc3411
fixMobileOpenid=HSAY5531DA7
#飞书通知
feishu.notice.link.url = https://applink.feishu.cn/client/web_app/open?appId=cli_a4f3e24dc73a100c&lk_target_url=https%3A%2F%2Ftest-hsay-web.coolstore.cn%2F%23%2Fwork%2Fbench
#阿里云ak sk
aliyun.accessKeyId=LTAI5t9RaXvABZbHvoXjDFJ1
aliyun.accessKeySecret=zhOK7WWo3yGoUWkOMaatty19k25CMd
aliyun.authCode=Y81FVZepk6

View File

@@ -0,0 +1,3 @@
spring.cloud.nacos.discovery.server-addr=192.168.1.202:8848
spring.cloud.nacos.config.server-addr=192.168.1.202:8848
spring.cloud.nacos.config.file-extension=properties

View File

@@ -1,6 +1,5 @@
spring.application.name=coolstore-partner-webc
spring.profiles.active=@profileActive@
spring.application.name=hsay-partner-webc
spring.profiles.active=dev
server.port=30900
server.servlet.context-path=/partner/mini/program

17
pom.xml
View File

@@ -26,6 +26,8 @@
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<spring-cloud.version>Hoxton.SR4</spring-cloud.version>
<spring-cloud-alibaba.version>2.2.0.RELEASE</spring-cloud-alibaba.version>
</properties>
<dependencyManagement>
@@ -196,6 +198,21 @@
<artifactId>aspectjweaver</artifactId>
<version>1.9.5</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!--Spring Cloud Alibaba 相关依赖-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>