Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 96f1adc5
authored
Sep 13, 2020
by
HaoN
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
解决Long型精度溢出问题
1 parent
c62f08f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
9 deletions
linkwe-framework/src/main/java/com/linkwechat/framework/config/ApplicationConfig.java
linkwe-framework/src/main/java/com/linkwechat/framework/config/JsonSerializerManage.java
linkwe-framework/src/main/java/com/linkwechat/framework/config/ResourcesConfig.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCorpAccount.java
linkwe-framework/src/main/java/com/linkwechat/framework/config/ApplicationConfig.java
View file @
96f1adc
...
...
@@ -16,7 +16,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
// 表示通过aop框架暴露该代理对象,AopContext能够访问
@EnableAspectJAutoProxy
(
exposeProxy
=
true
)
// 指定要扫描的Mapper类的包的路径
@MapperScan
(
"com.
ruoyi
.**.mapper"
)
@MapperScan
(
"com.
linkwechat
.**.mapper"
)
public
class
ApplicationConfig
{
/**
...
...
linkwe-framework/src/main/java/com/linkwechat/framework/config/JsonSerializerManage.java
0 → 100644
View file @
96f1adc
package
com
.
linkwechat
.
framework
.
config
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.module.SimpleModule
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
org.springframework.boot.jackson.JsonComponent
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder
;
/**
* @Author: Robin
* @Description: 解决Long类型精度丢失问题
* @Date: create in 2020/9/13 0013 15:45
*/
@JsonComponent
public
class
JsonSerializerManage
{
@Bean
public
ObjectMapper
jacksonObjectMapper
(
Jackson2ObjectMapperBuilder
builder
)
{
ObjectMapper
objectMapper
=
builder
.
createXmlMapper
(
false
).
build
();
objectMapper
.
setSerializationInclusion
(
JsonInclude
.
Include
.
NON_NULL
);
SimpleModule
module
=
new
SimpleModule
();
module
.
addSerializer
(
Long
.
class
,
ToStringSerializer
.
instance
);
module
.
addSerializer
(
Long
.
TYPE
,
ToStringSerializer
.
instance
);
objectMapper
.
registerModule
(
module
);
return
objectMapper
;
}
}
linkwe-framework/src/main/java/com/linkwechat/framework/config/ResourcesConfig.java
View file @
96f1adc
package
com
.
linkwechat
.
framework
.
config
;
import
com.linkwechat.common.config.RuoYiConfig
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.framework.interceptor.RepeatSubmitInterceptor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -9,9 +12,6 @@ import org.springframework.web.filter.CorsFilter;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
com.linkwechat.common.config.RuoYiConfig
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.framework.interceptor.RepeatSubmitInterceptor
;
/**
* 通用配置
...
...
@@ -63,4 +63,7 @@ public class ResourcesConfig implements WebMvcConfigurer
source
.
registerCorsConfiguration
(
"/**"
,
config
);
return
new
CorsFilter
(
source
);
}
}
\ No newline at end of file
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCorpAccount.java
View file @
96f1adc
...
...
@@ -28,24 +28,27 @@ public class WeCorpAccount extends BaseEntity
private
Long
id
;
/** 企业名称 */
@ApiModelProperty
(
name
=
"企业名称"
)
@ApiModelProperty
(
"企业名称"
)
private
String
companyName
;
/** 企业ID */
@ApiModelProperty
(
name
=
"企业ID"
)
@ApiModelProperty
(
"企业ID"
)
private
String
corpId
;
/** 应用的密钥凭证 */
@ApiModelProperty
(
name
=
"应用的密钥凭证"
)
@ApiModelProperty
(
"应用的密钥凭证"
)
private
String
corpSecret
;
/** 帐号状态(0正常 1停用) */
@ApiModelProperty
(
name
=
"帐号状态(0正常 1停用)"
)
@ApiModelProperty
(
"帐号状态(0正常 1停用)"
)
private
String
status
;
/** 删除标志(0代表存在 2代表删除) */
@ApiModelProperty
(
name
=
"删除标志(0代表存在 2代表删除)"
)
@ApiModelProperty
(
"删除标志(0代表存在 2代表删除)"
)
private
String
delFlag
;
private
String
contactSecret
;
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment