提交 6257426b 编写于 作者: X xiongchun

修改范例 将参数配置中心配置改为本地配置,方便演示和阅读代码。仅保留演示配置中心功能的范例使用配置中心来配置参数。

上级 bff4bc62
......@@ -19,8 +19,10 @@ spring.profiles.active=${spring.profiles.active:dev}
nacos.config.bootstrap.enable=true
nacos.config.bootstrap.log-enable=true
nacos.config.auto-refresh=true
#对应Nacos配置中心的命名空间ID
#\u5BF9\u5E94Nacos\u914D\u7F6E\u4E2D\u5FC3\u7684\u547D\u540D\u7A7A\u95F4ID
nacos.config.namespace=${nacos.namespace:pangu-dev}
nacos.config.server-addr=${nacos.server-addr:127.0.0.1:8848}
nacos.config.type=properties
nacos.config.data-id=${spring.application.name}.properties
\ No newline at end of file
nacos.config.data-id=${spring.application.name}.properties
#nacos.config.type=yaml
#nacos.config.data-id=${spring.application.name}.yaml
\ No newline at end of file
......@@ -5,13 +5,14 @@ import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 用户信息表
* <p>此文件由代码生成器自动生成</p>
*
* @author 普蓝开源社区
* @date 2021-11-15 21:54:22
* @date 2021-12-09 22:30:48
*/
@Data
@Accessors(chain = true)
......@@ -21,39 +22,48 @@ public class UserEntity implements Serializable {
private static final long serialVersionUID=1L;
/**
* 流水号
* 流水号
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 姓名
* 姓名
*/
@TableField(value = "name")
private String name;
/**
* 年龄
* 生日
*/
@TableField(value = "birthday")
@JsonFormat(pattern="yyyy-MM-dd")
private Date birthday;
/**
* 年龄
*/
@TableField(value = "age")
private Integer age;
/**
* 用户类型
* 用户类型
*/
@TableField(value = "user_type")
private String userType;
/**
* 创建时间
* 创建时间
*/
@TableField(value = "gmt_create")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date gmtCreate;
/**
* 更新时间
* 更新时间
*/
@TableField(value = "gmt_update")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date gmtUpdate;
}
......@@ -9,7 +9,7 @@ import com.gitee.pulanos.pangu.showcases.crud.dao.entity.UserEntity;
* <p>此文件由代码生成器自动生成</p>
*
* @author 普蓝开源社区
* @date 2021-11-15 21:54:22
* @date 2021-12-09 22:30:48
*/
@Mapper
public interface UserMapper extends BaseMapper<UserEntity> {
......
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.application.name=pangu-examples-dubbo-consumer
dubbo.protocol.name=dubbo
#dubbo.protocol.port=-1 # \u8BBE\u7F6E\u7AEF\u53E3\u4E3A -1 \u8868\u793A dubbo \u81EA\u52A8\u626B\u63CF\u5E76\u4F7F\u7528\u53EF\u7528\u7AEF\u53E3\uFF08\u4ECE20880\u5F00\u59CB\u9012\u589E\uFF09\uFF0C\u907F\u514D\u4E86\u7AEF\u53E3\u51B2\u7A81\u7684\u95EE\u9898\u3002
dubbo.protocol.port=20880
dubbo.consumer.timeout=5000
dubbo.registry.address=nacos://${nacos.server-addr}?namespace=${nacos.namespace}
dubbo.consumer.check=false
logging.level.root=INFO
logging.level.com.gitee.pulanos.pangu=INFO
\ No newline at end of file
......@@ -14,13 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.application.name=pangu-examples-dubbo-consumer
spring.profiles.active=${spring.profiles.active:dev}
nacos.config.bootstrap.enable=true
nacos.config.bootstrap.log-enable=true
nacos.config.auto-refresh=true
#对应Nacos配置中心的命名空间ID
nacos.config.namespace=${nacos.namespace:pangu-dev}
nacos.config.server-addr=${nacos.server-addr:127.0.0.1:8848}
nacos.config.type=properties
nacos.config.data-id=${spring.application.name}.properties
\ No newline at end of file
spring.profiles.active=${spring.profiles.active:dev}
\ No newline at end of file
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.application.name=pangu-examples-dubbo-gateway-service
dubbo.protocol.name=dubbo
#dubbo.protocol.port=-1 # \u8BBE\u7F6E\u7AEF\u53E3\u4E3A -1 \u8868\u793A dubbo \u81EA\u52A8\u626B\u63CF\u5E76\u4F7F\u7528\u53EF\u7528\u7AEF\u53E3\uFF08\u4ECE20880\u5F00\u59CB\u9012\u589E\uFF09\uFF0C\u907F\u514D\u4E86\u7AEF\u53E3\u51B2\u7A81\u7684\u95EE\u9898\u3002
dubbo.protocol.port=20880
dubbo.consumer.timeout=5000
dubbo.registry.address=nacos://${nacos.server-addr}?namespace=${nacos.namespace}
dubbo.consumer.check=false
shenyu.client.register-type=http
shenyu.client.server-lists=${shenyu.server-lists:http://localhost:9095}
shenyu.client.props.contextPath=/dubbo
logging.level.root=INFO
logging.level.com.gitee.pulanos.pangu=INFO
\ No newline at end of file
......@@ -14,13 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.application.name=pangu-examples-dubbo-gateway-service
spring.profiles.active=${spring.profiles.active:dev}
nacos.config.bootstrap.enable=true
nacos.config.bootstrap.log-enable=true
nacos.config.auto-refresh=true
#对应Nacos配置中心的命名空间ID
nacos.config.namespace=${nacos.namespace:pangu-dev}
nacos.config.server-addr=${nacos.server-addr:127.0.0.1:8848}
nacos.config.type=properties
nacos.config.data-id=${spring.application.name}.properties
\ No newline at end of file
spring.profiles.active=${spring.profiles.active:dev}
\ No newline at end of file
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.application.name=pangu-examples-dubbo-service
dubbo.protocol.name=dubbo
#dubbo.protocol.port=-1 # \u8BBE\u7F6E\u7AEF\u53E3\u4E3A -1 \u8868\u793A dubbo \u81EA\u52A8\u626B\u63CF\u5E76\u4F7F\u7528\u53EF\u7528\u7AEF\u53E3\uFF08\u4ECE20880\u5F00\u59CB\u9012\u589E\uFF09\uFF0C\u907F\u514D\u4E86\u7AEF\u53E3\u51B2\u7A81\u7684\u95EE\u9898\u3002
dubbo.protocol.port=20881
dubbo.consumer.timeout=5000
dubbo.registry.address=nacos://${nacos.server-addr}?namespace=${nacos.namespace}
dubbo.consumer.check=false
logging.level.root=INFO
logging.level.com.gitee.pulanos.pangu=INFO
\ No newline at end of file
......@@ -14,13 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.application.name=pangu-examples-dubbo-service
spring.profiles.active=${spring.profiles.active:dev}
nacos.config.bootstrap.enable=true
nacos.config.bootstrap.log-enable=true
nacos.config.auto-refresh=true
#对应Nacos配置中心的命名空间ID
nacos.config.namespace=${nacos.namespace:pangu-dev}
nacos.config.server-addr=${nacos.server-addr:127.0.0.1:8848}
nacos.config.type=properties
nacos.config.data-id=${spring.application.name}.properties
\ No newline at end of file
spring.profiles.active=${spring.profiles.active:dev}
\ No newline at end of file
......@@ -19,8 +19,10 @@ spring.profiles.active=${spring.profiles.active:dev}
nacos.config.bootstrap.enable=true
nacos.config.bootstrap.log-enable=true
nacos.config.auto-refresh=true
#对应Nacos配置中心的命名空间ID
#\u5BF9\u5E94Nacos\u914D\u7F6E\u4E2D\u5FC3\u7684\u547D\u540D\u7A7A\u95F4ID
nacos.config.namespace=${nacos.namespace:pangu-dev}
nacos.config.server-addr=${nacos.server-addr:127.0.0.1:8848}
nacos.config.type=properties
nacos.config.data-id=${spring.application.name}.properties
\ No newline at end of file
nacos.config.data-id=${spring.application.name}.properties
#nacos.config.type=yaml
#nacos.config.data-id=${spring.application.name}.yaml
\ No newline at end of file
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
server:
port: 9090
spring:
main:
allow-bean-definition-overriding: true
management:
health:
defaults:
enabled: false
shenyu:
cross:
enabled: true
allowedHeaders:
allowedMethods: "*"
allowedOrigin: "*"
allowedExpose: "*"
maxAge: "18000"
allowCredentials: true
switchConfig:
local: true
file:
enabled: true
maxSize : 10
sync:
websocket:
urls: ${shenyu.websocket.urls:ws://localhost9095/websocket}
dubbo:
parameter: multi
exclude:
enabled: false
paths:
- /favicon.ico
extPlugin:
path:
enabled: true
threads: 1
scheduleTime: 300
scheduleDelay: 30
scheduler:
enabled: false
type: fixed
threads: 16
upstreamCheck:
enabled: false
timeout: 3000
healthyThreshold: 1
unhealthyThreshold: 1
interval: 5000
printEnabled: true
printInterval: 60000
logging:
level:
root: info
org.springframework.boot: info
org.apache.ibatis: info
org.apache.shenyu.bonuspoint: info
org.apache.shenyu.lottery: info
org.apache.shenyu: info
......@@ -14,13 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.application.name=pangu-examples-webapi-gateway-based
spring.profiles.active=${spring.profiles.active:dev}
nacos.config.bootstrap.enable=true
nacos.config.bootstrap.log-enable=true
nacos.config.auto-refresh=true
#\u5BF9\u5E94Nacos\u914D\u7F6E\u4E2D\u5FC3\u7684\u547D\u540D\u7A7A\u95F4ID
nacos.config.namespace=${nacos.namespace:pangu-dev}
nacos.config.server-addr=${nacos.server-addr:127.0.0.1:8848}
nacos.config.type=yaml
nacos.config.data-id=${spring.application.name}.yaml
spring:
profiles:
active: ${spring.profiles.active:dev}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册