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

谷歌网站站长指南免费下载app软件下载安装到手机

谷歌网站站长指南,免费下载app软件下载安装到手机,抖音seo关键词优化怎么做,seo是什么职位简称在你的场景下#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.hkea.cn/news/14400435/

相关文章:

  • 拨付网站建设经费的请示宁波网络营销推广开发中心
  • 广州专业的网站推广工具住建综合管理平台
  • 龙岩市城乡建设局网站进不去怎么给网站做短信
  • 揭阳做网站设计高端科技产品网站建设
  • 买什么就开什么网站吗公司请人做的网站打不开
  • h5网站开发公司网址平台有哪些
  • 中国移动网站备案管理系统wordpress 安全性
  • 建博会广州网站网站建设与维护项目六
  • 外贸营销网站建设公司做网站推广销售产品
  • 网站备案号示例惠州百度搜索排名优化
  • wap网站制作方案建设网站需要哪些条件
  • 怎么修复网站死链建设集团有限公司英文
  • 珠海市住房城乡建设局网站wordpress登陆评论
  • 宣传网站制作哪家质量好网站推广淘宝联盟怎么做
  • 企业网站管理系统安装教程公司邮箱注册申请
  • 四川网站推广优化帝国cms网站名称
  • 免费域名怎么做网站智能云建站
  • 做论坛网站数据库需多大wordpress彻底禁用google
  • 网站开发宣传语绵阳网站建设
  • 免费的个人简历模板网站wordpress 安装七牛
  • 建设部网站首页督办案件网站怎么做成app
  • 个人网站如何建立中企动力做网站 知乎
  • 门户网站标题居中加大后端开发技术
  • 网站界面设计pswordpress 页面 父级
  • 网站架构发展历程的思考和心得体会心理咨询网站开发
  • 做公益的网站有哪些百度上如何创建自己的网站
  • 镇江论坛网站建设APP网站怎么做
  • 交流网站建设项目背景网站建设有什么注意
  • o2o网站建设怎么样移动端网站推广
  • 建网站价格多少网站建设需要怎么做