1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| package com.wshoto.basebiz.service.adapter.tenant;
import cn.hutool.json.JSONUtil; import com.wshoto.basebiz.service.common.exception.BaseBizException; import com.wshoto.basebiz.service.common.exception.BaseBizExceptionEnum; import com.wshoto.framework.common.base.Result; import com.wshoto.framework.common.base.ResultUtils; import com.wshoto.tenantservice.feign.news.client.QwTenantQueryFeign; import com.wshoto.tenantservice.feign.news.dto.TenantAgentInfoDTO; import com.wshoto.tenantservice.feign.news.request.TenantAgentFilterRequest; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList; import java.util.List;
@Slf4j public class TenantAdapter { @Autowired private QwTenantQueryFeign qwTenantQueryFeign;
public TenantAgentInfoDTO getAgentInfoBySuiteId(String tenantId, String suiteId, Boolean withCorp) { Result<TenantAgentInfoDTO> result = getAgentInfoBySuiteIdOriginal(tenantId, suiteId, withCorp); if (!ResultUtils.isSuccess(result)) { log.error("获取租户应用授权信息异常,{}",JSONUtil.toJsonStr(result)); throw new BaseBizException(result.getCode(),result.getMsg()); } return result.getData(); }
public TenantAgentInfoDTO getAgentInfoBySuiteIdWithDefault(String tenantId, String suiteId, Boolean withCorp) { Result<TenantAgentInfoDTO> result = getAgentInfoBySuiteIdOriginal(tenantId, suiteId, withCorp); if (ResultUtils.isSuccess(result)) { return result.getData(); } return null; }
public Result<TenantAgentInfoDTO> getAgentInfoBySuiteIdOriginal(String tenantId, String suiteId, Boolean withCorp) {
try{ log.info("获取租户应用授权信息,入参:{},{},{}", tenantId, suiteId, withCorp); Result<TenantAgentInfoDTO> result = qwTenantQueryFeign.getAgentInfoBySuiteId(tenantId, suiteId, withCorp); log.info("获取租户应用授权信息,查询结果:{}", JSONUtil.toJsonStr(result)); return result; } catch (Exception e) { log.error("XXXX", e); return ResultUtils.error(BaseBizExceptionEnum.DEFAULT.getCode(),BaseBizExceptionEnum.DEFAULT.getMessage() ); } } }
|