|
@@ -1,17 +1,23 @@
|
|
|
package com.yonge.audio;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
+import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
|
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
|
|
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.ComponentScan;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
+import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import com.spring4all.swagger.EnableSwagger2Doc;
|
|
|
+import com.ym.mec.common.config.LocalFastJsonHttpMessageConverter;
|
|
|
|
|
|
@SpringBootApplication
|
|
|
@EnableDiscoveryClient
|
|
@@ -31,4 +37,13 @@ public class AudioAnalysisServerApplication {
|
|
|
public RestTemplate restTemplate() {
|
|
|
return new RestTemplate();
|
|
|
}
|
|
|
+
|
|
|
+ @Bean
|
|
|
+ public HttpMessageConverters fastJsonHttpMessageConverters(){
|
|
|
+ LocalFastJsonHttpMessageConverter converter = new LocalFastJsonHttpMessageConverter();
|
|
|
+ List<MediaType> fastMediaTypes = new ArrayList<MediaType>();
|
|
|
+ fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
|
|
|
+ converter.setSupportedMediaTypes(fastMediaTypes);
|
|
|
+ return new HttpMessageConverters(converter);
|
|
|
+ }
|
|
|
}
|