当前位置: 首页 > wzjs >正文

临沂网站设计公司王湛简历

临沂网站设计公司,王湛简历,广州最近有流感吗,常平网站公司代码资料链接:https://download.csdn.net/download/ly1h1/90881498 场景说明:本次测试是springboot项目,可以链接上ncaos,将对应命名空间下的配置信息读取出俩,然后可以在接口进行返回显示。 0.环境配置 1.代码结构 …

代码资料链接:https://download.csdn.net/download/ly1h1/90881498

场景说明:本次测试是springboot项目,可以链接上ncaos,将对应命名空间下的配置信息读取出俩,然后可以在接口进行返回显示。

0.环境配置

1.代码结构

2.POM配置

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.2.2.RELEASE</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.itheima</groupId><artifactId>demonacostest</artifactId><version>0.0.1-SNAPSHOT</version><name>demonacostest</name><description>demonacostest</description><properties><java.version>8</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.28</version></dependency>
<!--        <dependency>-->
<!--            <groupId>org.springframework.cloud</groupId>-->
<!--            <artifactId>spring-cloud-starter-bootstrap</artifactId>-->
<!--            <version>3.0.3</version>-->
<!--        </dependency>--></dependencies><dependencyManagement><dependencies><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-alibaba-dependencies</artifactId><version>2.2.5.RELEASE</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build></project>

3.bootstrap.yml如下,不需要application.yml

spring:application:name: nacos-testcloud:nacos:config:server-addr: 43.162.118.209:8848username: nacospassword: nacosnamespace: f90776be-d19e-41c4-b55f-4cdcae33fa57file-extension: yaml
# 本地配置示例
app:local-config: 这是本地配置

4.配置属性模型

ConfigProperties
package com.itheima.demonacostest.config;import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;import java.io.Serializable;@Data
@Component
@RefreshScope
@ConfigurationProperties(prefix = "base.config")
public class ConfigProperties implements Serializable {private String appKey;private String appKey2;
}

5.接口如下

package com.itheima.demonacostest.controller;import com.itheima.demonacostest.config.ConfigProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;@RestController
@RequestMapping("/api/config")
public class ConfigController {@Autowiredprivate ConfigProperties nacosConfigProperties;@RequestMapping(value = "getConfig", method = RequestMethod.GET)public String getConfig() {return nacosConfigProperties.getAppKey();}@RequestMapping(value = "getConfig2", method = RequestMethod.GET)public String getConfig2() {return nacosConfigProperties.getAppKey2();}
}

6.nacos配置如下

7.效果


文章转载自:

http://2RHX0IFv.cbmpL.cn
http://h27YyDa6.cbmpL.cn
http://To1R28L4.cbmpL.cn
http://DnIuSDYz.cbmpL.cn
http://0in9ohJj.cbmpL.cn
http://jItQvNnQ.cbmpL.cn
http://YUJZ06og.cbmpL.cn
http://M2vjjj6n.cbmpL.cn
http://zAKqRiKm.cbmpL.cn
http://OBdMDody.cbmpL.cn
http://FLa8oIHo.cbmpL.cn
http://GTXE8RxL.cbmpL.cn
http://xvH96RvG.cbmpL.cn
http://C7W3pVCx.cbmpL.cn
http://toiAndky.cbmpL.cn
http://TqtFUfvb.cbmpL.cn
http://OdL4iB9j.cbmpL.cn
http://nA9JmfqN.cbmpL.cn
http://Ak5Urs1R.cbmpL.cn
http://THE0dH7s.cbmpL.cn
http://jSXk7qw5.cbmpL.cn
http://0aAuyIk2.cbmpL.cn
http://cMN09p3n.cbmpL.cn
http://3elUo6qb.cbmpL.cn
http://Ka9lpOhK.cbmpL.cn
http://Rm0NyMXg.cbmpL.cn
http://57kPfTOo.cbmpL.cn
http://SyegM947.cbmpL.cn
http://2JudO7n7.cbmpL.cn
http://vPL4n7E5.cbmpL.cn
http://www.dtcms.com/wzjs/676884.html

相关文章:

  • 深圳品牌营销网站app后期维护与运营成本
  • 商城网站微信支付接口申请流程深圳中高端网站建设
  • 做数据收集网站设计师网上接单兼职
  • 怎么在本地搭建网站android显示wordpress
  • 淄博营销型网站建设公司哪个网站微博做的最好
  • 做网站选大公司好还是小公司郑州网站推广公司
  • 广州短视频网站开发wordpress 美橙互联
  • 网站的性能特点个人简历制作
  • dede5.7微电影网站模板图书购物网站开发总结
  • 吴忠住房和城乡建设网站百度医疗网站建设
  • 领优惠券的网站是怎么做的百度云做.net网站
  • 西乡建网站wordpress背景代码
  • 建立网站后怎样收费ssh蒙语网站开发
  • 学生网站建设可行性分析wordpress 微信 登录
  • 广州航海学院门户网站北京旅游网站建设
  • 外贸做网站公司百度网站建设工资
  • 网站备案情况查询旅行社网站建设
  • 做定制网站网推拉新怎么做
  • 怎么做网站搜索引擎自己做的网站网页打开速度慢
  • 网站建设视频教程 百度云新网站建设怎么样
  • seo网站建设培训有名的网站
  • 如何做网站内容架构分析网站服务器怎么看是哪个厂家的
  • 网站建设系统哪个好wordpress添加文字广告框架
  • 国家外汇管理局网站怎么做报告群晖wordpress图片
  • 网站中弹出广告怎么做建设个网站需要多少钱
  • 企业网站规划要求北京大兴网站建设公司咨询
  • 科网站建设网络行业做什么挣钱
  • 环保网站建设的主题tiktok国际版网页入口
  • 国外网站加速神器做一个网站美工多少钱
  • 樟木头的建网站公司渠县网站建设