Merge remote-tracking branch 'origin/master'
commit
9969a1683f
Binary file not shown.
Binary file not shown.
@ -0,0 +1,57 @@
|
||||
# Elasticsearch plugin descriptor file
|
||||
# This file must exist as 'plugin-descriptor.properties' at
|
||||
# the root directory of all plugins.
|
||||
#
|
||||
# A plugin can be 'site', 'jvm', or both.
|
||||
#
|
||||
### example site plugin for "foo":
|
||||
#
|
||||
# foo.zip <-- zip file for the plugin, with this structure:
|
||||
# _site/ <-- the contents that will be served
|
||||
# plugin-descriptor.properties <-- example contents below:
|
||||
#
|
||||
# site=true
|
||||
# description=My cool plugin
|
||||
# version=1.0
|
||||
#
|
||||
### example jvm plugin for "foo"
|
||||
#
|
||||
# foo.zip <-- zip file for the plugin, with this structure:
|
||||
# <arbitrary name1>.jar <-- classes, resources, dependencies
|
||||
# <arbitrary nameN>.jar <-- any number of jars
|
||||
# plugin-descriptor.properties <-- example contents below:
|
||||
#
|
||||
# jvm=true
|
||||
# classname=foo.bar.BazPlugin
|
||||
# description=My cool plugin
|
||||
# version=2.0.0-rc1
|
||||
# elasticsearch.version=2.0
|
||||
# java.version=1.7
|
||||
#
|
||||
### mandatory elements for all plugins:
|
||||
#
|
||||
# 'description': simple summary of the plugin
|
||||
description=Pinyin Analysis for Elasticsearch
|
||||
#
|
||||
# 'version': plugin's version
|
||||
version=7.14.0
|
||||
#
|
||||
# 'name': the plugin name
|
||||
name=analysis-pinyin
|
||||
|
||||
#
|
||||
# 'classname': the name of the class to load, fully-qualified.
|
||||
classname=org.elasticsearch.plugin.analysis.pinyin.AnalysisPinyinPlugin
|
||||
#
|
||||
# 'java.version' version of java the code is built against
|
||||
# use the system property java.specification.version
|
||||
# version string must be a sequence of nonnegative decimal integers
|
||||
# separated by "."'s and may have leading zeros
|
||||
java.version=1.8
|
||||
#
|
||||
# 'elasticsearch.version' version of elasticsearch compiled against
|
||||
# You will have to release a new version of the plugin for each new
|
||||
# elasticsearch release. This version is checked when the plugin
|
||||
# is loaded so Elasticsearch will refuse to start in the presence of
|
||||
# plugins with the incorrect elasticsearch.version.
|
||||
elasticsearch.version=7.14.0
|
@ -1,23 +0,0 @@
|
||||
package com.wayn.data.redis.config;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class LettuceConfig implements InitializingBean {
|
||||
|
||||
@Autowired
|
||||
private RedisConnectionFactory redisConnectionFactory;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (redisConnectionFactory instanceof LettuceConnectionFactory c) {
|
||||
c.setValidateConnection(true);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,26 +1,45 @@
|
||||
package com.wayn.mobile.api.controller.callback;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.wayn.common.exception.BusinessException;
|
||||
import com.wayn.common.util.R;
|
||||
import com.wayn.data.redis.constant.RedisKeyEnum;
|
||||
import com.wayn.data.redis.manager.RedisCache;
|
||||
import com.wayn.message.core.dto.OrderDTO;
|
||||
import com.wayn.mobile.api.service.IMobileOrderService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("callback/order")
|
||||
public class SubmitOrderController {
|
||||
|
||||
private IMobileOrderService iMobileOrderService;
|
||||
private RedisCache redisCache;
|
||||
|
||||
@PostMapping("submit")
|
||||
public R submit(String order) throws UnsupportedEncodingException {
|
||||
public R submit(String order) {
|
||||
log.info("callback order request is {}", order);
|
||||
OrderDTO orderDTO = JSON.parseObject(order, OrderDTO.class);
|
||||
return iMobileOrderService.submit(orderDTO);
|
||||
try {
|
||||
iMobileOrderService.submit(orderDTO);
|
||||
redisCache.setCacheObject(RedisKeyEnum.ORDER_RESULT_KEY.getKey(orderDTO.getOrderSn()),
|
||||
"success", RedisKeyEnum.ORDER_RESULT_KEY.getExpireSecond());
|
||||
return R.success();
|
||||
} catch (Exception e) {
|
||||
String errorMsg = "error";
|
||||
if (e instanceof BusinessException businessException) {
|
||||
errorMsg = businessException.getMsg();
|
||||
}
|
||||
redisCache.setCacheObject(RedisKeyEnum.ORDER_RESULT_KEY.getKey(orderDTO.getOrderSn()),
|
||||
errorMsg, RedisKeyEnum.ORDER_RESULT_KEY.getExpireSecond());
|
||||
log.error(e.getMessage(), e);
|
||||
return R.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue