2

vscode vue常用插件-WebMvcConfigurer中常用

 2 years ago
source link: http://www.hechunbo.com/index.php/archives/423.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

vscode vue常用插件

vue常用插件

vue-fomate -------vue格式化文件
vue-definition----vue跳转事件和跳转到引入的组件位置
vue-peek 查看定义,可以看到定义的源文件

@Slf4j作用

如果不想每次都写private final Logger logger = LoggerFactory.getLogger(当前类名.class); 可以用注解@Slf4j;

WebMvcConfigurer中常用

 /* 拦截器配置 */
void addInterceptors(InterceptorRegistry var1);
/* 视图跳转控制器 */
void addViewControllers(ViewControllerRegistry registry);
/**
     *静态资源处理
**/
void addResourceHandlers(ResourceHandlerRegistry registry);
/* 默认静态资源处理器 */
void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer);
/**
     * 这里配置视图解析器
 **/
void configureViewResolvers(ViewResolverRegistry registry);
/* 配置内容裁决的一些选项*/
void configureContentNegotiation(ContentNegotiationConfigurer configurer);
/** 解决跨域问题 **/
public void addCorsMappings(CorsRegistry registry) ;

HandlerMethodArgumentResolver

此时你需要写一个切面,HandlerMethodArgumentResolver,直译是,处理函数参数的分解器,实现这个接口也很简单,

supportsParameter(支持参数):可以设置一些标志,表示你这个分解器可以处理这些参数,返回ture才执行resolveArgument()函数
resolveArgument(分解实参):处理实参的具体方法

controllr添加authmodel, 然后在调用时根据id取得相应实体进行赋值, 这样在去调用的时候就有值可以直接使用了.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK