mirror of https://github.com/ZhongFuCheng3y/austin
commit
712de46ec7
@ -0,0 +1,20 @@
|
|||||||
|
package com.java3y.austin.web.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.Documented;
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kl
|
||||||
|
* @version 1.0.0
|
||||||
|
* @description 接口切面注解
|
||||||
|
* @date 2023/2/23 9:01
|
||||||
|
*/
|
||||||
|
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Documented
|
||||||
|
public @interface AustinAspect {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.java3y.austin.web.config;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kl
|
||||||
|
* @version 1.0.0
|
||||||
|
* @description 通用配置
|
||||||
|
* @date 2023/2/23 10:40
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class CommonConfiguration {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FastJson 消息转换器 格式化输出json
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public HttpMessageConverters fastJsonHttpMessageConverters() {
|
||||||
|
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
|
||||||
|
List<MediaType> supportedMediaTypes = Lists.newArrayList();
|
||||||
|
supportedMediaTypes.add(MediaType.APPLICATION_JSON);
|
||||||
|
fastConverter.setSupportedMediaTypes(supportedMediaTypes);
|
||||||
|
return new HttpMessageConverters(fastConverter);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue