Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
aa5a1186
Commit
aa5a1186
authored
Mar 08, 2021
by
zhiheng.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jack 采用jackmapp
parent
1a3523cc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
121 additions
and
89 deletions
+121
-89
call-back-service/src/main/java/cn/freemud/config/WebMvcConfig.java
+39
-29
order-application-service/src/main/java/cn/freemud/config/WebMvcConfig.java
+40
-28
order-application-service/src/main/java/cn/freemud/entities/dto/OrderPayResponseDto.java
+1
-1
order-application-service/src/main/java/cn/freemud/entities/dto/pay/CombPayResponse.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/config/WebMvcConfig.java
+39
-29
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/OrderPayResponseDto.java
+1
-1
No files found.
call-back-service/src/main/java/cn/freemud/config/WebMvcConfig.java
View file @
aa5a1186
...
...
@@ -16,12 +16,12 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* WebMvcConfigurer
*/
...
...
@@ -45,35 +45,45 @@ public class WebMvcConfig implements WebMvcConfigurer {
objectMapper
.
registerModule
(
simpleModule
);
return
objectMapper
;
}
// @Bean
// public HttpMessageConverter fastjsonHttpMessageConverter() {
// //定义一个转换消息的对象
// FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
//
// //添加fastjson的配置信息 比如 :是否要格式化返回的json数据
// FastJsonConfig fastJsonConfig = new FastJsonConfig();
//
// //过滤并修改配置返回内容
// fastJsonConfig.setSerializerFeatures(
// //List字段如果为null,输出为[],而非null
// //SerializerFeature.WriteNullListAsEmpty,
// //字符类型字段如果为null,输出为"",而非null
//// SerializerFeature.WriteNullStringAsEmpty,
// //Boolean字段如果为null,输出为false,而非null
//// SerializerFeature.WriteNullBooleanAsFalse,
// //SerializerFeature.WriteNullBooleanAsFalse,
// //消除对同一对象循环引用的问题,默认为false(如果不配置有可能会进入死循环)
// SerializerFeature.DisableCircularReferenceDetect,
// SerializerFeature.PrettyFormat
// );
//
// //在转换器中添加配置信息
// fastConverter.setFastJsonConfig(fastJsonConfig);
// List<MediaType> supportedMediaTypes = new ArrayList<>();
// supportedMediaTypes.add(MediaType.APPLICATION_JSON);
// supportedMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
// fastConverter.setSupportedMediaTypes(supportedMediaTypes);
// return fastConverter;
// }
@Bean
public
HttpMessageConverter
fastjsonHttpMessageConverter
()
{
//定义一个转换消息的对象
FastJsonHttpMessageConverter
fastConverter
=
new
FastJsonHttpMessageConverter
();
//添加fastjson的配置信息 比如 :是否要格式化返回的json数据
FastJsonConfig
fastJsonConfig
=
new
FastJsonConfig
();
//过滤并修改配置返回内容
fastJsonConfig
.
setSerializerFeatures
(
//List字段如果为null,输出为[],而非null
//SerializerFeature.WriteNullListAsEmpty,
//字符类型字段如果为null,输出为"",而非nullF
// SerializerFeature.WriteNullStringAsEmpty,
//Boolean字段如果为null,输出为false,而非null
// SerializerFeature.WriteNullBooleanAsFalse,
//SerializerFeature.WriteNullBooleanAsFalse,
//消除对同一对象循环引用的问题,默认为false(如果不配置有可能会进入死循环)
SerializerFeature
.
DisableCircularReferenceDetect
,
SerializerFeature
.
PrettyFormat
);
//在转换器中添加配置信息
fastConverter
.
setFastJsonConfig
(
fastJsonConfig
);
List
<
MediaType
>
supportedMediaTypes
=
new
ArrayList
<>();
supportedMediaTypes
.
add
(
MediaType
.
APPLICATION_JSON
);
supportedMediaTypes
.
add
(
MediaType
.
APPLICATION_JSON_UTF8
);
fastConverter
.
setSupportedMediaTypes
(
supportedMediaTypes
);
return
fastConverter
;
public
MappingJackson2HttpMessageConverter
getMappingJackson2HttpMessageConverter
()
{
MappingJackson2HttpMessageConverter
mappingJackson2HttpMessageConverter
=
new
MappingJackson2HttpMessageConverter
();
//设置中文编码格式
List
<
MediaType
>
list
=
new
ArrayList
<
MediaType
>();
list
.
add
(
MediaType
.
APPLICATION_JSON_UTF8
);
mappingJackson2HttpMessageConverter
.
setSupportedMediaTypes
(
list
);
return
mappingJackson2HttpMessageConverter
;
}
}
order-application-service/src/main/java/cn/freemud/config/WebMvcConfig.java
View file @
aa5a1186
...
...
@@ -16,9 +16,11 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
java.math.BigInteger
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -45,35 +47,45 @@ public class WebMvcConfig implements WebMvcConfigurer {
objectMapper
.
registerModule
(
simpleModule
);
return
objectMapper
;
}
@Bean
public
HttpMessageConverter
fastjsonHttpMessageConverter
()
{
//定义一个转换消息的对象
FastJsonHttpMessageConverter
fastConverter
=
new
FastJsonHttpMessageConverter
();
//添加fastjson的配置信息 比如 :是否要格式化返回的json数据
FastJsonConfig
fastJsonConfig
=
new
FastJsonConfig
();
// @Bean
// public HttpMessageConverter fastjsonHttpMessageConverter() {
// //定义一个转换消息的对象
// FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
//
// //添加fastjson的配置信息 比如 :是否要格式化返回的json数据
// FastJsonConfig fastJsonConfig = new FastJsonConfig();
//
// //过滤并修改配置返回内容
// fastJsonConfig.setSerializerFeatures(
// //List字段如果为null,输出为[],而非null
// //SerializerFeature.WriteNullListAsEmpty,
// //字符类型字段如果为null,输出为"",而非null
//// SerializerFeature.WriteNullStringAsEmpty,
// //Boolean字段如果为null,输出为false,而非null
//// SerializerFeature.WriteNullBooleanAsFalse,
// //SerializerFeature.WriteNullBooleanAsFalse,
// //消除对同一对象循环引用的问题,默认为false(如果不配置有可能会进入死循环)
// SerializerFeature.DisableCircularReferenceDetect,
// SerializerFeature.PrettyFormat
// );
//
// //在转换器中添加配置信息
// fastConverter.setFastJsonConfig(fastJsonConfig);
// List<MediaType> supportedMediaTypes = new ArrayList<>();
// supportedMediaTypes.add(MediaType.APPLICATION_JSON);
// supportedMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
// fastConverter.setSupportedMediaTypes(supportedMediaTypes);
// return fastConverter;
// }
//过滤并修改配置返回内容
fastJsonConfig
.
setSerializerFeatures
(
//List字段如果为null,输出为[],而非null
//SerializerFeature.WriteNullListAsEmpty,
//字符类型字段如果为null,输出为"",而非null
// SerializerFeature.WriteNullStringAsEmpty,
//Boolean字段如果为null,输出为false,而非null
// SerializerFeature.WriteNullBooleanAsFalse,
//SerializerFeature.WriteNullBooleanAsFalse,
//消除对同一对象循环引用的问题,默认为false(如果不配置有可能会进入死循环)
SerializerFeature
.
DisableCircularReferenceDetect
,
SerializerFeature
.
PrettyFormat
);
//在转换器中添加配置信息
fastConverter
.
setFastJsonConfig
(
fastJsonConfig
);
List
<
MediaType
>
supportedMediaTypes
=
new
ArrayList
<>();
supportedMediaTypes
.
add
(
MediaType
.
APPLICATION_JSON
);
supportedMediaTypes
.
add
(
MediaType
.
APPLICATION_JSON_UTF8
);
fastConverter
.
setSupportedMediaTypes
(
supportedMediaTypes
);
return
fastConverter
;
@Bean
public
MappingJackson2HttpMessageConverter
getMappingJackson2HttpMessageConverter
()
{
MappingJackson2HttpMessageConverter
mappingJackson2HttpMessageConverter
=
new
MappingJackson2HttpMessageConverter
();
//设置中文编码格式
List
<
MediaType
>
list
=
new
ArrayList
<
MediaType
>();
list
.
add
(
MediaType
.
APPLICATION_JSON_UTF8
);
mappingJackson2HttpMessageConverter
.
setSupportedMediaTypes
(
list
);
return
mappingJackson2HttpMessageConverter
;
}
}
order-application-service/src/main/java/cn/freemud/entities/dto/OrderPayResponseDto.java
View file @
aa5a1186
...
...
@@ -72,7 +72,7 @@ public class OrderPayResponseDto {
private
String
appid
;
@J
SONField
(
name
=
"package"
)
@J
sonProperty
(
"package"
)
private
String
packageX
;
@JsonProperty
(
"nonce_str"
)
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/pay/CombPayResponse.java
View file @
aa5a1186
...
...
@@ -74,7 +74,7 @@ public class CombPayResponse {
*/
private
String
appId
;
@J
SONField
(
name
=
"package"
)
@J
sonProperty
(
"package"
)
private
String
packageX
;
//@JsonProperty("nonce_str")
...
...
shopping-cart-application-service/src/main/java/cn/freemud/config/WebMvcConfig.java
View file @
aa5a1186
...
...
@@ -16,12 +16,12 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* WebMvcConfigurer
*/
...
...
@@ -45,35 +45,45 @@ public class WebMvcConfig implements WebMvcConfigurer {
objectMapper
.
registerModule
(
simpleModule
);
return
objectMapper
;
}
// @Bean
// public HttpMessageConverter fastjsonHttpMessageConverter() {
// //定义一个转换消息的对象
// FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
//
// //添加fastjson的配置信息 比如 :是否要格式化返回的json数据
// FastJsonConfig fastJsonConfig = new FastJsonConfig();
//
// //过滤并修改配置返回内容
// fastJsonConfig.setSerializerFeatures(
// //List字段如果为null,输出为[],而非null
// //SerializerFeature.WriteNullListAsEmpty,
// //字符类型字段如果为null,输出为"",而非null
//// SerializerFeature.WriteNullStringAsEmpty,
// //Boolean字段如果为null,输出为false,而非null
//// SerializerFeature.WriteNullBooleanAsFalse,
// //SerializerFeature.WriteNullBooleanAsFalse,
// //消除对同一对象循环引用的问题,默认为false(如果不配置有可能会进入死循环)
// SerializerFeature.DisableCircularReferenceDetect,
// SerializerFeature.PrettyFormat
// );
//
// //在转换器中添加配置信息
// fastConverter.setFastJsonConfig(fastJsonConfig);
// List<MediaType> supportedMediaTypes = new ArrayList<>();
// supportedMediaTypes.add(MediaType.APPLICATION_JSON);
// supportedMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
// fastConverter.setSupportedMediaTypes(supportedMediaTypes);
// return fastConverter;
// }
@Bean
public
HttpMessageConverter
fastjsonHttpMessageConverter
()
{
//定义一个转换消息的对象
FastJsonHttpMessageConverter
fastConverter
=
new
FastJsonHttpMessageConverter
();
//添加fastjson的配置信息 比如 :是否要格式化返回的json数据
FastJsonConfig
fastJsonConfig
=
new
FastJsonConfig
();
//过滤并修改配置返回内容
fastJsonConfig
.
setSerializerFeatures
(
//List字段如果为null,输出为[],而非null
//SerializerFeature.WriteNullListAsEmpty,
//字符类型字段如果为null,输出为"",而非null
// SerializerFeature.WriteNullStringAsEmpty,
//Boolean字段如果为null,输出为false,而非null
// SerializerFeature.WriteNullBooleanAsFalse,
//SerializerFeature.WriteNullBooleanAsFalse,
//消除对同一对象循环引用的问题,默认为false(如果不配置有可能会进入死循环)
SerializerFeature
.
DisableCircularReferenceDetect
,
SerializerFeature
.
PrettyFormat
);
//在转换器中添加配置信息
fastConverter
.
setFastJsonConfig
(
fastJsonConfig
);
List
<
MediaType
>
supportedMediaTypes
=
new
ArrayList
<>();
supportedMediaTypes
.
add
(
MediaType
.
APPLICATION_JSON
);
supportedMediaTypes
.
add
(
MediaType
.
APPLICATION_JSON_UTF8
);
fastConverter
.
setSupportedMediaTypes
(
supportedMediaTypes
);
return
fastConverter
;
public
MappingJackson2HttpMessageConverter
getMappingJackson2HttpMessageConverter
()
{
MappingJackson2HttpMessageConverter
mappingJackson2HttpMessageConverter
=
new
MappingJackson2HttpMessageConverter
();
//设置中文编码格式
List
<
MediaType
>
list
=
new
ArrayList
<
MediaType
>();
list
.
add
(
MediaType
.
APPLICATION_JSON_UTF8
);
mappingJackson2HttpMessageConverter
.
setSupportedMediaTypes
(
list
);
return
mappingJackson2HttpMessageConverter
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/OrderPayResponseDto.java
View file @
aa5a1186
...
...
@@ -72,7 +72,7 @@ public class OrderPayResponseDto {
private
String
appid
;
@J
SONField
(
name
=
"package"
)
@J
sonProperty
(
"package"
)
private
String
packageX
;
@JsonProperty
(
"nonce_str"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment