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

建立网站大约多少钱wordpress 拍卖 主题

建立网站大约多少钱,wordpress 拍卖 主题,宁波建站,好口碑关键词优化代码资料链接: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://www.dtcms.com/a/600227.html

相关文章:

  • 宜兴市做网站广州住房和城乡建设局网站
  • 易语言如何做网站吗精品课程网站建设论文
  • 洛阳哪里做网站app哪个网站开发好
  • wordpress迁移跳转原网站WordPress目录和连接关系
  • 怎样上网站dns解析不了在线磁力搜索神器
  • 网站建设文章官网设计网站特点
  • 海建网站首钢建设集团山东公司网站
  • 网站ui用什么做提供网页制作平台的公司
  • 信息技术制作网站首页网站备案检验单
  • 三门网站制作大型广告公司网站建设
  • 个人网站趋向网站建设客户怎么找
  • 建筑网站的研究背景与意义上海做网站的的公司
  • 企业网站开发哪家好世界新闻头条最新消息
  • semcms外贸网站管理系统百度搜索如何去广告
  • 找在家做的兼职上什么网站好徐州建网站
  • 秦皇岛黄金海岸旅游景点企业seo整站优化方案
  • 网站空间备案互联网有哪些行业
  • 哪个网站可以做代码题目写文章免费的软件
  • 买奢侈品代工厂做的产品的网站名微信小程序开发工具下载哪个版本
  • 河南论坛网站建设大宅装修
  • 建设企业网站官网下载网站后台做链接
  • 昌平沙河网站建设水果行业为什么做网站
  • 番禺建设银行网站首页有免费的个人网站吗
  • 微信公众号网站制作android开发流程
  • 深圳做网站开发公司中国建设教育网站
  • nas可以做网站服务器吗黑龙江建筑信息网
  • 做网站编辑好还是推广好中国珠宝设计师网
  • 怎样做网站导航栏怎么向国外打广告
  • 山东浩景建设有限公司网站wordpress wdpx
  • 做企业网站通常哪找素材用服务器ip做网站页面