Commit 96f1adc5 by HaoN

解决Long型精度溢出问题

1 parent c62f08f9
......@@ -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
{
/**
......
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;
}
}
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
......@@ -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;
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!