Compare commits

..

1 Commits

Author SHA1 Message Date
wj 92951209c7 rabbit 2 years ago

@ -307,6 +307,11 @@
<version>3.5.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
</dependencies>
<build>

@ -0,0 +1,103 @@
package com.glxp.sale.admin.config.rabbit;
import cn.hutool.core.util.StrUtil;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
@Configuration
public class RabbitConfig {
// private final static String exchangeName = "sync_direct_exchange";
public final static String topicExchangeName = "sync_topic_exchange";
/**
*
*/
public final static String syncQueueName = "sync";
public final static String uploadQueueName = "upload";
private final static String syncTopicKey = "sync.*";
public final static String syncInsertKey = "sync.insert";
public final static String syncUpdateKey = "sync.update";
public final static String syncDeleteKey = "sync.delete";
private final static String uploadTopicKey = "upload.*";
public final static String uploadInsertKey = "upload.insert";
public final static String uploadUpdateKey = "upload.update";
public final static String uploadDeleteKey = "upload.delete";
/**
* direct
*/
// @Bean
// DirectExchange udiExchange() {
// //设置消息持久化
// return new DirectExchange(exchangeName, true, false);
// }
/**
* topic
*/
@Bean
TopicExchange udiTopicExchange() {
//设置消息持久化
return new TopicExchange(topicExchangeName, true, false);
}
/**
*
*/
@Bean
Queue syncQueue() {
//设置消息持久化
return new Queue(syncQueueName, true);
}
@Bean
Queue uploadQueue() {
//设置消息持久化
return new Queue(uploadQueueName, true);
}
/**
* key
*/
@Bean
Binding bindingSync() {
return BindingBuilder.bind(syncQueue()).to(udiTopicExchange()).with(syncTopicKey);
}
/**
* key
*/
@Bean
Binding bindingUpload() {
return BindingBuilder.bind(uploadQueue()).to(udiTopicExchange()).with(uploadTopicKey);
}
// /**
// * 将根据路由key队列绑定交换机
// */
// @Bean
// Binding bindingSync() {
// return BindingBuilder.bind(syncQueue()).to(udiExchange()).with(syncKey);
// }
//
// @Bean
// Binding bindingUpload() {
// return BindingBuilder.bind(uploadQueue()).to(udiExchange()).with(uploadKey);
// }
}

@ -0,0 +1,103 @@
package com.glxp.sale.admin.config.rabbit;
import cn.hutool.core.util.StrUtil;
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
@Configuration
public class RabbitConnectionConfig {
/*
*rabbitMQ
*/
@Bean(name = "upperConnectionFactory")
public ConnectionFactory upperConnectionFactory(
@Value("${upper.spring.rabbitmq.host}") String host,
@Value("${upper.spring.rabbitmq.port}") int port,
@Value("${upper.spring.rabbitmq.username}") String username,
@Value("${upper.spring.rabbitmq.password}") String password,
@Value("${upper.spring.rabbitmq.virtual-host}") String virtualHost) {
return connectionFactory(host, port, username, password, virtualHost);
}
/*
*rabbitMQ
*/
@Bean(name = "localConnectionFactory")
@Primary
public ConnectionFactory localConnectionFactory(
@Value("${local.spring.rabbitmq.host}") String host,
@Value("${local.spring.rabbitmq.port}") int port,
@Value("${local.spring.rabbitmq.username}") String username,
@Value("${local.spring.rabbitmq.password}") String password,
@Value("${local.spring.rabbitmq.virtual-host}") String virtualHost) {
return connectionFactory(host, port, username, password, virtualHost);
}
/*
*rabbitMQ
*/
// @Bean(name = "localConnectionFactory")
// @Primary
// public ConnectionFactory localConnectionFactory(
// @Value("${listen.rabbitmq.local.host}") String host,
// @Value("${listen.rabbitmq.local.port}") int port,
// @Value("${listen.rabbitmq.local.username}") String username,
// @Value("${listen.rabbitmq.local.password}") String password,
// @Value("${listen.rabbitmq.local.virtual-host}") String virtualHost) {
// return connectionFactory(host, port, username, password, virtualHost);
// }
public CachingConnectionFactory connectionFactory(String host, int port, String username, String password, String virtualHost) {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
connectionFactory.setHost(host);
connectionFactory.setPort(port);
connectionFactory.setUsername(username);
connectionFactory.setPassword(password);
if (StrUtil.isNotBlank(virtualHost)) {
connectionFactory.setVirtualHost(virtualHost);
}
return connectionFactory;
}
@Bean(name = "upperRabbitTemplate")
public RabbitTemplate upperRabbitTemplate(@Qualifier("upperConnectionFactory") ConnectionFactory connectionFactory) {
RabbitTemplate upperRabbitTemplate = new RabbitTemplate(connectionFactory);
return upperRabbitTemplate;
}
@Bean(name = "localRabbitTemplate")
@Primary
public RabbitTemplate localRabbitTemplate(@Qualifier("localConnectionFactory") ConnectionFactory connectionFactory) {
RabbitTemplate localRabbitTemplate = new RabbitTemplate(connectionFactory);
return localRabbitTemplate;
}
@Bean(name = "upperFactory")
public SimpleRabbitListenerContainerFactory upperFactory(
SimpleRabbitListenerContainerFactoryConfigurer configurer,
@Qualifier("upperConnectionFactory") ConnectionFactory connectionFactory) {
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
configurer.configure(factory, connectionFactory);
return factory;
}
@Bean(name = "localFactory")
@Primary
public SimpleRabbitListenerContainerFactory localFactory(
SimpleRabbitListenerContainerFactoryConfigurer configurer,
@Qualifier("localConnectionFactory") ConnectionFactory connectionFactory) {
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
configurer.configure(factory, connectionFactory);
return factory;
}
}

@ -47,17 +47,6 @@ public enum BasicExportTypeEnum {
*/
ORDER_INVOICE("io_order_invoice", "扫码单据发票信息"),
/**
*
*/
// IO_ORDER("io_order", "单据信息"),
/**
*
*/
// ORDER_INVOICE("io_order_invoice", "扫码单据发票信息"),
/**
*
*/

@ -1,14 +1,15 @@
package com.glxp.sale.admin.controller.sync;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.glxp.sale.admin.constant.*;
import com.glxp.sale.admin.dto.RelaySyncDto;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.entity.sync.BasicExportStatusEntity;
import com.glxp.sale.admin.entity.sync.BasicUploadStatusEntity;
import com.glxp.sale.admin.entity.sync.*;
import com.glxp.sale.admin.http.SpGetHttp;
import com.glxp.sale.admin.http.SpPostHttp;
import com.glxp.sale.admin.idc.utils.UriUtils;
@ -256,7 +257,7 @@ public class SpsSyncDataController {
throw new RuntimeException("系统异常,文件名为空");
}
relaySyncResponse = RelaySyncResponse.builder()
.taskId(one.getTaskId())
.taskId(one.getId())
.fileContent(this.readDataFile(one.getCacheFilePath()))
.build();
}

@ -16,6 +16,10 @@ import com.glxp.sale.admin.idc.service.FileService;
import com.glxp.sale.common.res.BaseResponse;
/**
*
*/
@ -28,28 +32,30 @@ public class FileController {
@RequestMapping(value = "/spssync/file/upload")
@ResponseBody
public BaseResponse upload(HttpServletRequest request, @RequestBody Map<String, Object> params) {
return fileService.fileUpload(request, params);
return fileService.fileUpload(request,params);
}
@RequestMapping(value = "/spssync/file/download")
@ResponseBody
public BaseResponse download(HttpServletRequest request, @RequestBody Map<String, Object> params) {
return fileService.fileDownload(request, params);
return fileService.fileDownload(request,params);
}
@RequestMapping(value = "/spssync/file/downloadFile")
@ResponseBody
public BaseResponse downloadFile(HttpServletRequest request, @RequestBody Map<String, Object> params) {
return fileService.downloadFile(request, params);
return fileService.downloadFile(request,params);
}
@RequestMapping(value = "/spssync/file/uploadFile")
public BaseResponse uploadFile(HttpServletRequest request,
@RequestParam(value = "content", required = false) String content,
@RequestParam(value = "files", required = false) MultipartFile[] files) {
@RequestParam(value = "content" , required = false) String content,
@RequestParam(value = "files", required = false) MultipartFile[] files) {
//
return fileService.receiveFile(request, content, files);
}
}

@ -1,37 +1,37 @@
package com.glxp.sale.admin.idc.controller;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.glxp.sale.admin.idc.dao.DbDao;
import com.glxp.sale.admin.idc.service.IdcService;
import com.glxp.sale.admin.idc.utils.UriUtils;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.util.MyStrUtil;
import com.glxp.sale.common.res.BaseResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
/**
@ -149,7 +149,6 @@ public class IdcController {
if (StrUtil.isNotEmpty(upperServerHost)) {
uri = upperServerHost + "/" + uri;
}
uri = changeUri(uri);
log.info(uri);
if (uri.contains("getImage")) {
return redirectIamge(request, httpServletResponse, uri);
@ -158,67 +157,6 @@ public class IdcController {
}
}
// @RequestMapping("/dirImages/**")
// public void images(HttpServletRequest request, HttpServletResponse httpServletResponse) {
// String uri = uriUtils.parseUri(request.getRequestURL().toString());
//
// log.info(uri);
// String imageHost = "http://192.168.0.66:9000";
// String url = "";
//// systemParamConfigService.selectValueByParamKey("is_top_service");
// if (StrUtil.isNotEmpty(imageHost)) {
// String prefix = "dirImages/";
// url = (imageHost.substring(imageHost.length() - 1) == "/" ? imageHost : imageHost + "/")
// + uri.substring(uri.indexOf(prefix) + prefix.length());
//
// }
// log.info(url);
// redirectIamge2(request, httpServletResponse, url);
// }
public String changeUri(String uri) {
String isTopService = systemParamConfigService.selectValueByParamKey("is_top_service");
if (StrUtil.isNotEmpty(isTopService) && isTopService.equals("1")) {
if (uri.contains("SP_SYNC_SERVER")) {
uri = uri.replace("SP_SYNC_SERVER/", "");
}
} else {
uri = MyStrUtil.deDup(uri);
}
log.error("changeUri = " + uri);
return uri;
}
private void redirectIamge2(HttpServletRequest request, HttpServletResponse httpServletResponse, String uri) {
HttpRequest result = HttpUtil.createGet(uri);
HttpResponse execute = result.execute();
execute.headers().forEach((k, v) -> {
httpServletResponse.setHeader(k, v.get(0));
});
ServletOutputStream outputStream = null;
InputStream inputStream = null;
try {
outputStream = httpServletResponse.getOutputStream();
inputStream = execute.bodyStream();
outputStream.write(inputStream.readAllBytes());
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
try {
if (outputStream != null)
outputStream.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
try {
if (inputStream != null)
inputStream.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
private byte[] redirectIamge(HttpServletRequest request, HttpServletResponse httpServletResponse, String uri) {
RestTemplate restTemplate = new RestTemplate();

@ -46,7 +46,7 @@ public class FileServiceImpl implements FileService {
private String apiKey;
@Value("${API_SECRET}")
private String apiSecret;
@Resource
private DbDao dbDao;
@Resource
@ -60,7 +60,7 @@ public class FileServiceImpl implements FileService {
if(map!=null&&map.get("syncIp")!=null)
host = map.get("syncIp").toString();
} catch (Exception ex) {
}
if(StringUtils.isEmpty(host)) {
try {
@ -68,7 +68,7 @@ public class FileServiceImpl implements FileService {
if(config!=null&&config.get("paramValue")!=null)
host = config.get("paramValue").toString();
} catch (Exception ex) {
}
}
if(StringUtils.isEmpty(host))
@ -96,9 +96,9 @@ public class FileServiceImpl implements FileService {
}
return ResultVOUtils.error(9999,"失败");
}
@Override
public BaseResponse fileDownload(HttpServletRequest request,Map<String,Object> params) {
Map<String, Object> map = dbDao.get("select * from sync_data_set limit 1");
@ -109,7 +109,7 @@ public class FileServiceImpl implements FileService {
}
return ResultVOUtils.success(null);
}
@Override
public BaseResponse receiveFile(HttpServletRequest request,String content,MultipartFile[] files) {
boolean isRelay = false;
@ -121,9 +121,9 @@ public class FileServiceImpl implements FileService {
isRelay = true;
host = config.get("paramValue").toString();
}
} catch (Exception ex) {
}
ArrayList<String> saveFiles = new ArrayList<>();
Date startTime = new Date();
@ -157,12 +157,12 @@ public class FileServiceImpl implements FileService {
}
return ResultVOUtils.success(null);
}
/*转发图片*/
private String relayFile(ArrayList<String> files, String ip) {
String host = ip;
String result = "";
if (!StringUtils.isEmpty(host)) {
host += "/spssync/file/uploadFile";
OkHttpClient client = new OkHttpClient().newBuilder()
@ -185,7 +185,7 @@ public class FileServiceImpl implements FileService {
}
}
}
RequestBody body = builder.build();
Request req = new Request.Builder()
@ -211,8 +211,8 @@ public class FileServiceImpl implements FileService {
}
return result;
}
@Override
public BaseResponse downloadFile(HttpServletRequest request,Map<String,Object> params) {
String host = "";
@ -221,11 +221,11 @@ public class FileServiceImpl implements FileService {
if(config!=null&&config.get("paramValue")!=null)
host = config.get("paramValue").toString();
} catch (Exception ex) {
ex.printStackTrace();
}
if(!StringUtils.isEmpty(host)) {
String result = IDCUtils.post(host+"/spssync/file/downloadFile", params);
String result = IDCUtils.post(host+"/spssync/file/downloadFile", params);
JSONObject object = JSON.parseObject(result);
boolean success = false;
if(object.getInteger("code")==20000) {
@ -237,10 +237,10 @@ public class FileServiceImpl implements FileService {
}
}
if(!success)
ResultVOUtils.error(9999,"失败");
ResultVOUtils.error(9999,"失败");
}
return ResultVOUtils.success(null);
return ResultVOUtils.success(null);
}
}
}

@ -0,0 +1,39 @@
package com.glxp.sale.admin.rabbitmq;
import com.glxp.sale.admin.config.rabbit.RabbitConfig;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Slf4j
@Service
@RequiredArgsConstructor
public class SyncListener {
@Resource(name = "localRabbitTemplate")
private RabbitTemplate rabbitTemplate;
@RabbitListener(queues = RabbitConfig.syncQueueName, containerFactory = "upperFactory", concurrency = "20-40")
public void process(Message message, @Payload String str) {
//获取路由key
String routingKey = message.getMessageProperties().getReceivedRoutingKey();
System.out.println(routingKey);
System.out.println(str);
switch (routingKey) {
case RabbitConfig.syncInsertKey:
case RabbitConfig.syncUpdateKey:
case RabbitConfig.syncDeleteKey:
rabbitTemplate.convertSendAndReceive(RabbitConfig.topicExchangeName, routingKey, str);
default:
break;
}
}
}

@ -0,0 +1,44 @@
package com.glxp.sale.admin.rabbitmq;
import com.glxp.sale.admin.config.rabbit.RabbitConfig;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Slf4j
@Service
@RequiredArgsConstructor
public class UploadListener {
@Resource(name = "upperRabbitTemplate")
private RabbitTemplate rabbitTemplate;
@Value("${upper.spring.rabbitmq.exchange}")
private String upperExchange;
@RabbitListener(queues = RabbitConfig.uploadQueueName,containerFactory = "localFactory", concurrency = "20-40")
public void process(Message message, @Payload String str) {
//获取路由key
String routingKey = message.getMessageProperties().getReceivedRoutingKey();
System.out.println(routingKey);
System.out.println(str);
switch (routingKey) {
case RabbitConfig.uploadInsertKey:
case RabbitConfig.uploadUpdateKey:
case RabbitConfig.uploadDeleteKey:
rabbitTemplate.convertSendAndReceive(upperExchange, routingKey, str);
default:
break;
}
}
}

@ -1,7 +1,7 @@
# \u751F\u4EA7\u73AF\u5883
server.port=10001
server.port=10002
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/udispsync?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3333/udispsync?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=123456
#spring.datasource.password=xiamenswan
@ -44,9 +44,9 @@ spring.redis.database=6
# Redis服务器地址
spring.redis.host=127.0.0.1
# Redis服务器连接端口
spring.redis.port=6379
spring.redis.port=6377
# Redis服务器连接密码默认为空
spring.redis.password=
spring.redis.password=123456
#连接池最大连接数(使用负值表示没有限制)
spring.redis.jedis.pool.max-active=8
# 连接池最大阻塞等待时间(使用负值表示没有限制)
@ -57,3 +57,17 @@ spring.redis.jedis.pool.max-idle=8
spring.redis.jedis.pool.min-idle=0
# 连接超时时间(毫秒)
spring.redis.jedis.timeout=300
local.spring.rabbitmq.host=192.168.0.66
local.spring.rabbitmq.port=5672
local.spring.rabbitmq.virtual-host=sync/dev
local.spring.rabbitmq.username=glxp
local.spring.rabbitmq.password=glxp1234
upper.spring.rabbitmq.host=192.168.0.66
upper.spring.rabbitmq.port=5672
upper.spring.rabbitmq.virtual-host=dev
upper.spring.rabbitmq.username=glxp
upper.spring.rabbitmq.password=glxp1234
upper.spring.rabbitmq.exchange=spms_topic_exchange

@ -16,8 +16,8 @@ cors.allowed-Credentials=true
server.tomcat.max-http-form-post-size=100MB
server.max-http-header-size=100MB
#\u6700\u5927\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F(10MB)
spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=100MB
spring.servlet.multipart.max-file-size=104857600
spring.servlet.multipart.max-request-size=104857600
server.connectionTimeout=180000
#logging.level.com.glxp.sale.admin.dao=debug
# \u8F93\u51FA\u65E5\u5FD7\u5230\u9879\u76EE\u6839\u76EE\u5F55\u4E0B\u7684springboot.log\u6587\u4EF6\u4E2D // \u914D\u7F6E logback-spring.xml\u65F6 \u6B64\u65E5\u5FD7\u8F93\u51FA\u65B9\u5F0F\u4F1A\u88AB\u8986\u76D6\u3002

@ -1,4 +1,4 @@
spring.profiles.active=test
spring.profiles.active=dev
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
mybatis.config-location=classpath:mybatis/mybatis-config.xml
mybatis.mapper-locations=classpath:mybatis/mapper/*/*.xml

@ -8,7 +8,7 @@ import lombok.Getter;
@Getter
public enum ResultEnum {
SUCCESS(20000, "success"),
SUCCESS(0, "success"),
NOT_NETWORK(1, "系统繁忙,请稍后再试。"),
LOGIN_VERIFY_FALL(2, "登录失效"),
PARAM_VERIFY_FALL(3, "参数验证错误"),

@ -18,7 +18,7 @@ public class ResultVOUtils {
*/
public static BaseResponse success(Object data) {
BaseResponse<Object> baseResponse = new BaseResponse<>();
baseResponse.setCode(ResultEnum.SUCCESS.getCode());
baseResponse.setCode(20000);
baseResponse.setMessage("success");
baseResponse.setData(data);
return baseResponse;

Loading…
Cancel
Save