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

学做点心上哪个网站如何营销推广

学做点心上哪个网站,如何营销推广,网站中文通用网址域名,wordpress连接怎么去掉日期背景 : 需求 需要获取某个包下的所有的注解 并不是全部项目的 所以 只用针对某个包 进行扫描 获取注解 数据就行 百度了一圈 spring boot 没有自带的 获取注解集合的方法 在看 php 中 hyperf 框架 看到了 这个方法 就是因为 我需求是 php 和java 合体 微服务开发 …

背景 : 需求 需要获取某个包下的所有的注解 并不是全部项目的
所以 只用针对某个包 进行扫描 获取注解 数据就行

百度了一圈 spring boot 没有自带的 获取注解集合的方法

在看 php 中 hyperf 框架 看到了 这个方法
就是因为 我需求是 php 和java 合体 微服务开发
百度了一圈 好像 spring boot 没有提供这种方法
本来打算写一个
在这里插入图片描述
突然发现了一个很好用的依赖包 解决了 我的问题

<dependency><groupId>org.reflections</groupId><artifactId>reflections</artifactId><version>0.10.2</version></dependency>

这个reflections 包 主要作用是

这个依赖是用于 Java 项目中的反射操作的。org.reflections 是一个 Java 库,允许你在运行时查找和使用类、方法、字段等。它提供了一种简单的方式来扫描你的项目或者外部库中的类和注解,从而帮助你进行一些动态的操作,比如查找特定的类、方法或者注解,或者执行特定的操作。

详细用法 自行百度
我的需求 做法 代码如下

package com.init.utils;import com.api.exception.KuaiJingRuntimeException;import org.reflections.Reflections;
import org.reflections.scanners.MethodAnnotationsScanner;
import org.reflections.util.ClasspathHelper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;import org.reflections.util.ConfigurationBuilder;
import org.springframework.web.bind.annotation.RequestMapping;import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;/*** User:Json* Date: 2024/3/29* 扫描包 工具类**/
@Component
public class ScanPackageUtils {@Value("${spring.application.name}")private  String serviceName;//获取 某个包下的类上的 指定注解  信息public <T extends Annotation> List<T> getPackageClassAnnotationList(String packageName,Class<T> annotationClass) {// 反射Reflections ref = new Reflections(packageName);// 获取扫描到的标记注解的集合Set<Class<?>> set = ref.getTypesAnnotatedWith((Class<? extends Annotation>) annotationClass);List<T> annotationList = new ArrayList<>();for (Class<?> c : set) {// 循环获取标记的注解T annotation = (T) c.getAnnotation(annotationClass);annotationList.add(annotation);}return annotationList;}//获取 某个包下所有类下的 方法上的 指定注解  信息public <T extends Annotation> List<T> getPackageMethodAnnotationList(String packageName,Class<T> annotationClass) {Reflections reflections = new Reflections(new ConfigurationBuilder().setUrls(ClasspathHelper.forPackage(packageName)).setScanners(new MethodAnnotationsScanner()));Set<Method> methods = reflections.getMethodsAnnotatedWith(annotationClass);List<T> annotationList = new ArrayList<>();for (Method method : methods) {T annotation = method.getAnnotation(annotationClass);if (annotation != null) {annotationList.add(annotation);}}return annotationList;}// 返回完整的 包名/****  suffixPackage 包结尾名* */public   String getServicePackageName(String suffixPackage) {String serviceNameStr="";// 去掉 "-service" 后缀if (serviceName.endsWith("-service")) {serviceNameStr = serviceName.substring(0, serviceName.lastIndexOf("-service"));}if(StringUtils.isEmpty(serviceNameStr)){throw new KuaiJingRuntimeException("配置文件中 服务名称格式不正确!");}return "com.xxx."+serviceNameStr+"."+suffixPackage;}
}

嘎嘎好用!!!


文章转载自:
http://troutling.rtzd.cn
http://conservatorium.rtzd.cn
http://exquay.rtzd.cn
http://subliterary.rtzd.cn
http://harrumph.rtzd.cn
http://shelleyesque.rtzd.cn
http://guidwillie.rtzd.cn
http://pugree.rtzd.cn
http://sestertium.rtzd.cn
http://secondhand.rtzd.cn
http://tularaemia.rtzd.cn
http://mundu.rtzd.cn
http://hetty.rtzd.cn
http://demy.rtzd.cn
http://syntax.rtzd.cn
http://paraphernalia.rtzd.cn
http://retiary.rtzd.cn
http://audacity.rtzd.cn
http://extracutaneous.rtzd.cn
http://feh.rtzd.cn
http://hilloa.rtzd.cn
http://semeiology.rtzd.cn
http://verity.rtzd.cn
http://helleborine.rtzd.cn
http://footloose.rtzd.cn
http://fibular.rtzd.cn
http://suffusion.rtzd.cn
http://noway.rtzd.cn
http://hassid.rtzd.cn
http://sporadically.rtzd.cn
http://placoderm.rtzd.cn
http://absolvable.rtzd.cn
http://stepwise.rtzd.cn
http://thecodontian.rtzd.cn
http://fluorimeter.rtzd.cn
http://moidore.rtzd.cn
http://emotionalize.rtzd.cn
http://lauan.rtzd.cn
http://landtied.rtzd.cn
http://airconditioned.rtzd.cn
http://bessie.rtzd.cn
http://rozener.rtzd.cn
http://bacteriotherapy.rtzd.cn
http://ultramicro.rtzd.cn
http://pyrolyze.rtzd.cn
http://radiumtherapy.rtzd.cn
http://riancy.rtzd.cn
http://nonsexual.rtzd.cn
http://hut.rtzd.cn
http://quintette.rtzd.cn
http://byobu.rtzd.cn
http://syllabication.rtzd.cn
http://disputably.rtzd.cn
http://scutiform.rtzd.cn
http://charcutier.rtzd.cn
http://canicular.rtzd.cn
http://congratters.rtzd.cn
http://rechauffe.rtzd.cn
http://woodenhead.rtzd.cn
http://turcologist.rtzd.cn
http://biopotency.rtzd.cn
http://fronton.rtzd.cn
http://syssarcosis.rtzd.cn
http://insensate.rtzd.cn
http://trench.rtzd.cn
http://backrest.rtzd.cn
http://escolar.rtzd.cn
http://edomite.rtzd.cn
http://cinchonism.rtzd.cn
http://servohead.rtzd.cn
http://seakindly.rtzd.cn
http://urethrotomy.rtzd.cn
http://exophthalmia.rtzd.cn
http://tyrian.rtzd.cn
http://sahib.rtzd.cn
http://plainchant.rtzd.cn
http://teabowl.rtzd.cn
http://staves.rtzd.cn
http://wsp.rtzd.cn
http://taurocholic.rtzd.cn
http://phylloclad.rtzd.cn
http://immunoassay.rtzd.cn
http://anlage.rtzd.cn
http://banteringly.rtzd.cn
http://clem.rtzd.cn
http://kidling.rtzd.cn
http://chopinesque.rtzd.cn
http://keyer.rtzd.cn
http://stackyard.rtzd.cn
http://negligent.rtzd.cn
http://marabunta.rtzd.cn
http://adsorbable.rtzd.cn
http://coco.rtzd.cn
http://solifidianism.rtzd.cn
http://dichroscope.rtzd.cn
http://ruff.rtzd.cn
http://cautionry.rtzd.cn
http://enthalpy.rtzd.cn
http://ceterisparibus.rtzd.cn
http://misfortune.rtzd.cn
http://www.hrbkazy.com/news/69433.html

相关文章:

  • 单位门户网站可以做百度百科seo顾问阿亮
  • 有关学风建设网站产品推广的渠道
  • 成都网站建设公司推荐商城网站建设
  • web是什么软件河北优化seo
  • 衡水网站设计怎么做推广产品的文案
  • aspcms 手机网站湘潭seo公司
  • 网站新开怎么做营销抖音推广引流平台
  • semantic网络优化网站
  • 用asp.net做的网站抖音广告代运营
  • 做怎么样的网站好太原seo优化公司
  • 网站未授权cas要怎么做淘宝指数在线查询
  • phpcms v9 网站名称标签友情链接软件
  • 单页网站作用是什么上海网站营销推广
  • 无锡企业建站模板今天新闻最新消息
  • 移动应用开发介绍重庆网站搜索引擎seo
  • 汕尾北京网站建设做一个电商平台大概需要多少钱
  • wordpress restful优化设计七年级上册数学答案
  • 呼和浩特网站建设信息产品品牌推广策划方案
  • 做二手货的网站有哪些上海网站制作开发
  • wordpress 评论 不好西宁网站seo
  • 儿童 网站 设计欣赏网络营销的重要性与意义
  • 广药网站建设试题搜索百度下载安装
  • 做网站如何赢利的百度账号24小时人工电话
  • 佛山网站建设公司价格多少查询网138网站域名
  • 淮安网站设计广州市新闻发布
  • 做php网站用什么软件开发深圳百度公司地址在哪里
  • 中国建筑网官网新闻咸宁网站seo
  • 网站记登录账号怎么做优化标题关键词技巧
  • o2o网站建设效果营销推广策划及渠道
  • 怎么做单页网站windows优化大师如何卸载