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

我wordpress top主题seo简单速排名软件

我wordpress top主题,seo简单速排名软件,吉首公司网站找谁做,51找呀模板网参考文章 作用 用注解的方式动态切换实现类实现方式。 比如我们有多个消息中间件或多个短信服务商&#xff0c;需要动态切换的时候&#xff0c;无需自己写判断逻辑来进行服务商的切换。只用一套注解就可以解决问题 开始使用 引入依赖 <dependency><groupId>io…

参考文章

作用

用注解的方式动态切换实现类实现方式。
比如我们有多个消息中间件或多个短信服务商,需要动态切换的时候,无需自己写判断逻辑来进行服务商的切换。只用一套注解就可以解决问题

开始使用

引入依赖

<dependency><groupId>io.github.burukeyou</groupId><artifactId>spring-smart-di-all</artifactId><version>0.2.0</version>
</dependency>
下载不下来需要拿到jar包打入本地仓库
mvn install:install-file -Dfile=D://spring-smart-di-all-0.2.0.jar -DgroupId=io.github.burukeyou -DartifactId=spring-smart-di-all -Dversion=0.2.0 -Dpackaging=jar

jar包在我的下载里面有上传

开启注解使用

package com.dino;import com.burukeyou.smartdi.annotations.EnableSmartDI;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;@Slf4j
@EnableSmartDI
@SpringBootApplication
public class DinoOaApp {public static void main(String[] args) {log.info("====== Business Starting... ======");ConfigurableApplicationContext ctx = null;try {ctx = new SpringApplicationBuilder(DinoOaApp.class).web(WebApplicationType.SERVLET).run(args);log.info("====== Business Started! ======");} catch (Exception e) {if (ctx != null) {log.error("Business application start failed and exit: {}", e.getMessage(), e);System.exit(SpringApplication.exit(ctx));}}}
}

实现类实现

定义实现类
package com.dino.business.sms;import com.burukeyou.smartdi.proxyspi.spi.EnvironmentProxySPI;
import com.dino.utils.sms.SmsSendRequest;@EnvironmentProxySPI("${sms.impl}")
public interface SmsService {Boolean sendSms(String mobile);
}
实现实现类
package com.dino.business.sms.impl;import com.burukeyou.smartdi.annotations.BeanAliasName;
import com.dino.business.sms.SmsService;
import com.dino.utils.sms.SmsSendRequest;
import com.dino.utils.sms.SmsUtils;
import org.springframework.stereotype.Component;import javax.annotation.Resource;/*** 阿里短信发送*/
@BeanAliasName("ali")
@Component
public class AliSmsServiceImpl implements SmsService {@Resourceprivate SmsUtils smsUtils;@Overridepublic Boolean sendSms(String mobile) {return smsUtils.sendAliSMS(mobile);}
}
package com.dino.business.sms.impl;import com.burukeyou.smartdi.annotations.BeanAliasName;
import com.dino.business.sms.SmsService;
import com.dino.utils.sms.SmsSendRequest;
import com.dino.utils.sms.SmsUtils;
import org.springframework.stereotype.Component;import javax.annotation.Resource;/*** 创蓝短信发送*/
@BeanAliasName("cl")
@Component
public class ClSmsServiceImpl implements SmsService {@Resourceprivate SmsUtils smsUtils;@Overridepublic Boolean sendSms(String mobile) {return smsUtils.sendClSms(mobile);}
}

配置文件配置

# 短信类型  阿里:ali  创蓝 cl
sms:impl: cl
接口调用@AutowiredProxySPIprivate SmsService smsService;public Boolean sendSmsCode(String mobile) {     return smsService.sendSms(mobile);}
http://www.hrbkazy.com/news/33446.html

相关文章:

  • 网站制作 天津搭建网站的软件
  • 做女装批发哪个网站好网址收录大全
  • wordpress蘑菇街满足seo需求的网站
  • 网站域名虚拟主机成都抖音seo
  • 网站开发后如何维护seo流量的提升的软件
  • 没有网站可以做淘宝客吗广告联盟全自动赚钱系统
  • xrea免费 wordpress 加速网站优化seo推广服务
  • 西安网站建设公司排资源网站优化排名优化
  • 网站建设调查表软件外包公司排行
  • 微信做明天展现网站要多少钱信息推广的方式有哪些
  • 雨岑信息科技有限公司做企业型网站做的怎么样_公司规模如何企业网站策划
  • 网站制作需要多少钱百度竞价外包
  • 软件测试工程师月薪多少站长seo综合查询
  • 响应式网站手机手机如何制作网站
  • WordPress总是收到英文评论抖音seo点击软件排名
  • 手机网站用什么域名西安网站seo费用
  • 百度商桥绑定网站南宁seo服务公司
  • 游戏抽奖网站用java怎么做sem工具是什么
  • 定制化网站开发seo薪资水平
  • 网站地图优化网站关键词快速排名工具
  • 企业做网站网络策划是做什么的
  • 网站建设策划案模板厦门seo起梦网络科技
  • 品古典家具网站模板湖南疫情最新消息
  • 嘉兴 网站建设seo初学教程
  • 小企业做网站有没有用公司网站设计报价
  • 品牌建设的过程seo详细教程
  • 建一个英文网站需要多少钱微信软文推广怎么做
  • 日照网站建设网站优化如何优化seo关键词
  • 网站开发的招标参数aso如何优化
  • 网站建设合作方案信息流广告投放公司