pay: PayNotifyJob 增加多租户的支持

This commit is contained in:
YunaiV
2022-11-24 23:56:13 +08:00
parent 0247fd5c69
commit 1cd9085c59
13 changed files with 144 additions and 94 deletions

View File

@ -2,6 +2,10 @@ package cn.iocoder.yudao.framework.tenant.core.util;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import java.util.Map;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT_ID;
/**
* 多租户 Util
*
@ -32,4 +36,16 @@ public class TenantUtils {
}
}
/**
* 将多租户编号,添加到 header 中
*
* @param headers HTTP 请求 headers
*/
public static void addTenantHeader(Map<String, String> headers) {
Long tenantId = TenantContextHolder.getTenantId();
if (tenantId != null) {
headers.put(HEADER_TENANT_ID, tenantId.toString());
}
}
}