Merge branch 'dev' into prod
This commit is contained in:
commit
0de787b742
|
|
@ -48,14 +48,3 @@ seata:
|
|||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://192.168.1.42:9411/api/v2/spans
|
||||
|
|
@ -52,13 +52,3 @@ seata:
|
|||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://121.40.109.122:9411/api/v2/spans
|
||||
|
||||
|
|
|
|||
|
|
@ -52,13 +52,3 @@ seata:
|
|||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://192.168.1.42:9411/api/v2/spans
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ server:
|
|||
|
||||
spring:
|
||||
application:
|
||||
name: account-server
|
||||
name: account
|
||||
profiles:
|
||||
active: dev
|
||||
include: tools
|
||||
|
|
|
|||
|
|
@ -72,5 +72,14 @@ public class ADiscountActivityController {
|
|||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<MkDiscountActivityDTO> getActivity(@RequestParam Long shopId) {
|
||||
MkDiscountActivityDTO data = discountActivityService.getActivityByShopId(shopId);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.czg.controller.admin;
|
|||
import com.czg.TimeQueryParam;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.market.dto.MkLimitTimeDiscountDTO;
|
||||
import com.czg.market.entity.MkLimitTimeDiscount;
|
||||
import com.czg.market.service.MkLimitTimeDiscountService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
|
|
@ -71,5 +72,13 @@ public class ALimitTimeDiscountController {
|
|||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取限时折扣
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<MkLimitTimeDiscount> getActivity(@RequestParam Long shopId) {
|
||||
MkLimitTimeDiscount data = limitTimeDiscountService.getLimitTimeDiscountByShopId(shopId);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.BaseQueryParam;
|
||||
import com.czg.TimeQueryParam;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.market.dto.MkProductSmartSuggestDTO;
|
||||
import com.czg.market.service.MkProductSmartSuggestService;
|
||||
|
|
@ -16,6 +15,8 @@ import jakarta.annotation.Resource;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 点单智能推荐
|
||||
*
|
||||
|
|
@ -73,4 +74,13 @@ public class AProductSmartSuggestController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取点单智能推荐
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<Map<String, Object>> getActivity(@RequestParam Long shopId) {
|
||||
Map<String, Object> map = suggestService.getProductSmartSuggestByShopId(shopId);
|
||||
return CzgResult.success(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,13 +55,3 @@ seata:
|
|||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://192.168.1.42:9411/api/v2/spans
|
||||
|
|
|
|||
|
|
@ -48,14 +48,3 @@ seata:
|
|||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://121.40.109.122:9411/api/v2/spans
|
||||
|
|
|
|||
|
|
@ -47,15 +47,4 @@ seata:
|
|||
nacos:
|
||||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://192.168.1.42:9411/api/v2/spans
|
||||
group: group_seata
|
||||
|
|
@ -3,7 +3,7 @@ server:
|
|||
|
||||
spring:
|
||||
application:
|
||||
name: market-server
|
||||
name: market
|
||||
profiles:
|
||||
active: dev
|
||||
include: tools
|
||||
|
|
|
|||
|
|
@ -49,14 +49,3 @@ seata:
|
|||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://192.168.1.42:9411/api/v2/spans
|
||||
|
|
|
|||
|
|
@ -53,15 +53,3 @@ seata:
|
|||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://121.40.109.122:9411/api/v2/spans
|
||||
|
||||
|
|
|
|||
|
|
@ -53,15 +53,3 @@ seata:
|
|||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://192.168.1.42:9411/api/v2/spans
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ server:
|
|||
|
||||
spring:
|
||||
application:
|
||||
name: order-server
|
||||
name: order
|
||||
profiles:
|
||||
active: dev
|
||||
include: tools
|
||||
|
|
|
|||
|
|
@ -53,15 +53,4 @@ seata:
|
|||
nacos:
|
||||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://192.168.1.42:9411/api/v2/spans
|
||||
group: group_seata
|
||||
|
|
@ -48,14 +48,3 @@ seata:
|
|||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://121.40.109.122:9411/api/v2/spans
|
||||
|
|
|
|||
|
|
@ -48,14 +48,3 @@ seata:
|
|||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://192.168.1.42:9411/api/v2/spans
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ server:
|
|||
|
||||
spring:
|
||||
application:
|
||||
name: product-server
|
||||
name: product
|
||||
profiles:
|
||||
active: dev
|
||||
include: tools
|
||||
|
|
|
|||
|
|
@ -50,14 +50,3 @@ seata:
|
|||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://192.168.1.42:9411/api/v2/spans
|
||||
|
||||
|
|
|
|||
|
|
@ -51,14 +51,3 @@ seata:
|
|||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://121.40.109.122:9411/api/v2/spans
|
||||
|
||||
|
|
|
|||
|
|
@ -51,14 +51,3 @@ seata:
|
|||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
# TraceID
|
||||
management:
|
||||
tracing:
|
||||
enabled: true
|
||||
sampling:
|
||||
probability: 1.0 # 100% 采样,生产可降低
|
||||
zipkin:
|
||||
tracing:
|
||||
endpoint: http://192.168.1.42:9411/api/v2/spans
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ server:
|
|||
|
||||
spring:
|
||||
application:
|
||||
name: system-server
|
||||
name: system
|
||||
profiles:
|
||||
active: dev
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public class ControllerAspect {
|
|||
if(params.contains("jndi:rmi:")){
|
||||
throw new RuntimeException("gun");
|
||||
}
|
||||
Map<String, String> contextMap = MDC.getCopyOfContextMap();
|
||||
// 执行被拦截的方法
|
||||
Object result = pjp.proceed();
|
||||
long end = System.currentTimeMillis();
|
||||
|
|
@ -63,7 +64,6 @@ public class ControllerAspect {
|
|||
String requestIp = ServletUtil.getClientIP(request);
|
||||
long useTime = end - start;
|
||||
|
||||
Map<String, String> contextMap = MDC.getCopyOfContextMap();
|
||||
ThreadUtil.execAsync(() -> {
|
||||
if (contextMap != null) {
|
||||
MDC.setContextMap(contextMap);
|
||||
|
|
|
|||
|
|
@ -1,20 +1,35 @@
|
|||
package com.czg.config;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import jakarta.servlet.*;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author GYJoker
|
||||
*/
|
||||
@Configuration
|
||||
public class CorsFilter implements Filter {
|
||||
|
||||
@Value("${spring.application.name:unknown-service}")
|
||||
private String applicationName;
|
||||
@Override
|
||||
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
// traceId
|
||||
Map<String, String> copyOfContextMap = MDC.getCopyOfContextMap();
|
||||
if(copyOfContextMap == null){
|
||||
copyOfContextMap = new HashMap<>();
|
||||
}
|
||||
copyOfContextMap.put("traceId",applicationName + IdUtil.fastSimpleUUID());
|
||||
MDC.setContextMap(copyOfContextMap);
|
||||
HttpServletResponse response = (HttpServletResponse) resp;
|
||||
HttpServletRequest reqs = (HttpServletRequest) req;
|
||||
String curOrigin = reqs.getHeader("Origin");
|
||||
|
|
@ -23,6 +38,12 @@ public class CorsFilter implements Filter {
|
|||
response.setHeader("Access-Control-Max-Age", "3600");
|
||||
response.setHeader("Access-Control-Allow-Headers", "token,Origin, X-Requested-With, Content-Type, Accept,shopId");
|
||||
response.setHeader("Access-Control-Allow-Credentials", "true");
|
||||
chain.doFilter(req, resp);
|
||||
try {
|
||||
// 原有 MDC 设置逻辑...
|
||||
chain.doFilter(req, resp);
|
||||
} finally {
|
||||
// 清理当前线程的 traceId
|
||||
MDC.remove("traceId");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ package com.czg.config;
|
|||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.apache.dubbo.common.constants.CommonConstants;
|
||||
import org.apache.dubbo.rpc.*;
|
||||
import org.apache.dubbo.common.extension.Activate;
|
||||
import org.apache.dubbo.rpc.*;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
/**
|
||||
|
|
@ -22,11 +22,6 @@ public class TraceProviderFilter implements Filter {
|
|||
|
||||
// 设置到 MDC
|
||||
MDC.put("traceId", traceId);
|
||||
|
||||
try {
|
||||
return invoker.invoke(invocation);
|
||||
} finally {
|
||||
MDC.clear();
|
||||
}
|
||||
return invoker.invoke(invocation);
|
||||
}
|
||||
}
|
||||
|
|
@ -41,9 +41,6 @@
|
|||
<weixin.java.miniapp.version>3.8.0</weixin.java.miniapp.version>
|
||||
<pinyin.version>2.5.1</pinyin.version>
|
||||
<IJPay.version>2.9.10</IJPay.version>
|
||||
<micrometer.version>1.6.0-M3</micrometer.version>
|
||||
<zipkin-reporter.version>3.5.1</zipkin-reporter.version>
|
||||
<actuator.version>4.0.0-M3</actuator.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
|
@ -245,28 +242,6 @@
|
|||
<artifactId>excel-spring-boot-starter</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Micrometer Tracing 核心(必需) -->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-tracing-bridge-brave</artifactId>
|
||||
<version>${micrometer.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Zipkin Reporter,用于将数据发送到 Zipkin -->
|
||||
<dependency>
|
||||
<groupId>io.zipkin.reporter2</groupId>
|
||||
<artifactId>zipkin-reporter-brave</artifactId>
|
||||
<version>${zipkin-reporter.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
<version>${actuator.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
|
|
|||
|
|
@ -119,6 +119,9 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
|||
if (isHeadShop != null) {
|
||||
queryWrapper.eq(ShopInfo::getIsHeadShop, isHeadShop);
|
||||
}
|
||||
CzgResult<SysParamsDTO> shopOrderPayBaseUrl = sysParamsService.getParamsByCode("shop_order_pay_base_url");
|
||||
CzgResult<SysParamsDTO> shopOrderPayBaseUrl2 = sysParamsService.getParamsByCode("ali_account_app_id");
|
||||
|
||||
List<ShopInfo> shopAllList = getMapper().selectListByQuery(query().select(ShopInfo::getId, ShopInfo::getShopName));
|
||||
Map<Long, String> shopKv = shopAllList.stream().collect(Collectors.toMap(ShopInfo::getId, ShopInfo::getShopName));
|
||||
queryWrapper.orderBy(ShopInfo::getCreateTime, false);
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class MkLimitTimeDiscountServiceImpl extends ServiceImpl<MkLimitTimeDisco
|
|||
public MkLimitTimeDiscount getLimitTimeDiscountByShopId(Long shopId) {
|
||||
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
|
||||
MkLimitTimeDiscount limitTimeDiscount = mapper.selectOneByShopId(mainShopId, shopId, CzgStrUtils.getStrWeek());
|
||||
if (limitTimeDiscount != null && limitTimeDiscount.getFoodType() == 2 && StrUtil.isNotBlank(limitTimeDiscount.getFoods())) {
|
||||
if (limitTimeDiscount != null && limitTimeDiscount.getFoodType() == 2 && StrUtil.isNotBlank(limitTimeDiscount.getFoods()) && !shopId.equals(mainShopId)) {
|
||||
List<String> foodIds = Arrays.stream(limitTimeDiscount.getFoods().split(","))
|
||||
.map(String::trim)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
|
|
|
|||
|
|
@ -98,29 +98,5 @@
|
|||
<artifactId>hibernate-validator</artifactId>
|
||||
<version>8.0.2.Final</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Micrometer Tracing 核心(必需) -->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-tracing-bridge-brave</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-observation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Zipkin Reporter,用于将数据发送到 Zipkin -->
|
||||
<dependency>
|
||||
<groupId>io.zipkin.reporter2</groupId>
|
||||
<artifactId>zipkin-reporter-brave</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue