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

google网站排名做网站买哪家的主机好

google网站排名,做网站买哪家的主机好,做境外碎片化旅游的网站,网站建设或网站优化排名在你的场景下#xff0c;如果刷题微服务通过 Maven 引入了 auth-api 模块#xff0c;并且 auth-api 中定义了 Feign 接口#xff08;例如获取用户名的方法#xff09;#xff0c;你需要在 刷题微服务 中的启动类上配置 EnableFeignClients 注解。配置中 basePackages 参数…在你的场景下如果刷题微服务通过 Maven 引入了 auth-api 模块并且 auth-api 中定义了 Feign 接口例如获取用户名的方法你需要在 刷题微服务 中的启动类上配置 EnableFeignClients 注解。配置中 basePackages 参数应该填写 Feign 接口所在包的 全限定包名即 auth-api 模块中定义接口的包路径。 项目结构如下 Feign 接口定义在 auth-api 模块中 name: 必须和权限微服务 auth-service 的 spring.application.name 保持一致。path: 对应权限服务中的接口路径。 刷题微服务中的配置QuestionApplication 在刷题微服务中引入 auth-api 模块并在启动类上配置 EnableFeignClients指向 Feign 接口所在的包 com.provider.auth.api Maven 引入 auth-api 在 question-service 的 pom.xml 中添加依赖 dependency     groupIdcom.provider/groupId     artifactIdauth-api/artifactId     version1.0.0/version /dependency 启动类配置 EnableFeignClients 启动类的完整配置 package com.provider.question;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.openfeign.EnableFeignClients;EnableFeignClients(basePackages com.provider.auth.api) // 指向 auth-api 中的接口包 SpringBootApplication public class QuestionApplication {public static void main(String[] args) {SpringApplication.run(QuestionApplication.class, args);} }权限服务的配置auth-service 在权限微服务中确保接口路径 /auth/getUsername 存在并正确实现 package com.provider.auth.service;import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController;RestController RequestMapping(/auth) public class UserService {GetMapping(/getUsername)public String getUsername(RequestParam(userId) Long userId) {// 返回用户名逻辑return User- userId;} }确保 auth-service 的 spring.application.name 配置为 auth-service spring:   application:     name: auth-service server:   port: 8081 调用接口示例 在刷题微服务中注入 UserFeignClient 并调用权限微服务的接口 package com.provider.question.service;import com.provider.auth.api.UserFeignClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;Service public class QuestionService {Autowiredprivate UserFeignClient userFeignClient;public String getUsername(Long userId) {return userFeignClient.getUsername(userId);} }关键点总结 EnableFeignClients 的配置 配置 basePackages 为 Feign 接口所在的包路径例如com.provider.auth.api。这个包路径是 auth-api 模块中定义的 Feign 接口所在的包名。 Maven 依赖 确保刷题微服务正确引入了 auth-api 模块的依赖。 服务名匹配 确保 FeignClient(name auth-service) 中的 name 与权限微服务的 spring.application.name 一致。 注册中心 如果使用注册中心如 Eureka、Nacos确保权限服务正常注册并能被刷题微服务发现。
http://www.dnsts.com.cn/news/171478.html

相关文章:

  • 网站开发建设赚钱吗影视软件开发定制
  • 万网主机 建网站seo推广收费
  • 响应式的网站做优化好吗html5可以做手机网站吗
  • 做网站的哪里便宜微信小程序项目源码
  • 东北网站建设公司空投网站建设
  • 域名注册网站排行招远做网站公司
  • 杭州知名的网站制作策略WordPress4.8中文的把
  • 小白怎样建设公司网站哪些网站可以做招生信息
  • 晋江论坛网优化推广网站seo
  • 青岛会议网站制作公司辽宁省建设教育协会网站
  • 招聘网站建设费用多少钱wordpress 版面
  • 企业网站建设可行性分析任务国外设计师灵感网站
  • 建设部网站怎么查询企业业绩推广普通话活动
  • 什么行业必须做网站wordpress 仿百度文库
  • 厚街外贸网站建设有wordpress还需要前端
  • 只做正品的购物网站怎么做链接推广产品
  • wordpress 字符串函数南昌做网站优化的公司
  • 网站的建设 教学计划射阳做网站
  • 手机p2p网站建设网页制作软件工具
  • 四站合一网站制作平面设计招聘58同城
  • 网站每年维护费用网站建设方案书原件
  • 海口网站制作案例铭望家装公司电话
  • 南昌企业网站排名优化tp做的网站封装成app
  • 溧水网站建设上海基础微网站开发
  • 做网站开发语言重庆网网站建设公司
  • 怎么做淘宝网站赚钱吗百度指数排名
  • 做自媒体一般都注册几个网站长链接缩短在线生成
  • 微网站怎么注册账号wordpress导出数据
  • 个人做网站的流程互助网站开发
  • 律师事务所网站设计方案wordpress企业电商主题排行榜