| | |
| | | import com.java110.event.service.api.ServiceDataFlowEventPublishing; |
| | | import com.java110.service.smo.IQueryServiceSMO; |
| | | import org.apache.commons.lang3.math.NumberUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | //@Transactional |
| | | public class ApiServiceSMOImpl extends LoggerEngine implements IApiServiceSMO { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(ApiServiceSMOImpl.class); |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | |
| | | DataFlowFactory.addCostTime(dataFlow, "judgeAuthority", "鉴权耗时", startDate); |
| | | throw new NoAuthorityException(ResponseConstant.RESULT_CODE_NO_AUTHORITY_ERROR, "requestTime 格式不对,遵循yyyyMMddHHmmss格式"); |
| | | } |
| | | //用户ID校验 |
| | | if (StringUtil.isNullOrNone(dataFlow.getUserId())){ |
| | | throw new NoAuthorityException(ResponseConstant.RESULT_CODE_NO_AUTHORITY_ERROR, "USER_ID 不能为空"); |
| | | } |
| | | |
| | | |
| | | //判断 AppId 是否有权限操作相应的服务 |
| | |
| | | throw new NoAuthorityException(ResponseConstant.RESULT_CODE_NO_AUTHORITY_ERROR, "AppId 没有权限访问 serviceCode = " + dataFlow.getRequestHeaders().get(CommonConstant.HTTP_SERVICE)); |
| | | } |
| | | |
| | | |
| | | //检验白名单 |
| | | List<String> whileListIp = dataFlow.getAppRoutes().get(0).getWhileListIp(); |
| | | if (whileListIp != null && whileListIp.size() > 0 && !whileListIp.contains(dataFlow.getIp())) { |