Browse Source

oss获取增加多租户判断

test
smallchill 5 years ago
parent
commit
8437664a0d
  1. 6
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/OssBuilder.java

6
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/OssBuilder.java

@ -106,7 +106,11 @@ public class OssBuilder {
*/ */
public Oss getOss(String tenantId) { public Oss getOss(String tenantId) {
return CacheUtil.get(SYS_CACHE, OSS_CODE, tenantId, () -> { return CacheUtil.get(SYS_CACHE, OSS_CODE, tenantId, () -> {
Oss o = ossMapper.selectOne(Wrappers.<Oss>query().lambda().eq(Oss::getStatus, OssStatusEnum.ENABLE.getNum())); Oss o = ossMapper.selectOne(
Wrappers.<Oss>query().lambda()
.eq(Oss::getStatus, OssStatusEnum.ENABLE.getNum())
.eq(Oss::getTenantId, tenantId)
);
// 若为空则调用默认配置 // 若为空则调用默认配置
if ((Func.isEmpty(o))) { if ((Func.isEmpty(o))) {
Oss defaultOss = new Oss(); Oss defaultOss = new Oss();

Loading…
Cancel
Save