| | |
| | | package com.qianwen.smartman.modules.visual.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.assertj.core.util.Lists; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.qianwen.core.mp.base.BaseServiceImpl; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.modules.system.entity.InterfaceConfig; |
| | | import com.qianwen.smartman.modules.system.service.IInterfaceConfigService; |
| | | import com.qianwen.smartman.modules.visual.dto.VisualGlobalQueryDTO; |
| | | import com.qianwen.smartman.modules.visual.entity.Visual; |
| | | import com.qianwen.smartman.modules.visual.entity.VisualGlobalApi; |
| | | import com.qianwen.smartman.modules.visual.mapper.VisualGlobalApiMapper; |
| | | import com.qianwen.smartman.modules.visual.service.IVisualGlobalApiService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/visual/service/impl/VisualGlobalApiServiceImpl.class */ |
| | | public class VisualGlobalApiServiceImpl extends BaseServiceImpl<VisualGlobalApiMapper, VisualGlobalApi> implements IVisualGlobalApiService { |
| | | private IInterfaceConfigService interfaceConfigService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1233650324: |
| | | if (implMethodName.equals("getOwningChart")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -621871631: |
| | | if (implMethodName.equals("getVisualId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -593679572: |
| | | if (implMethodName.equals("getUpdateTime")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1497760115: |
| | | if (implMethodName.equals("getConfigId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | | switch (z) { |
| | | case false: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/util/Date;")) { |
| | | return (v0) -> { |
| | | return v0.getUpdateTime(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/visual/entity/VisualGlobalApi") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getConfigId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/InterfaceConfig") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/InterfaceConfig") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getOwningChart(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/visual/entity/VisualGlobalApi") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getVisualId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/visual/entity/VisualGlobalApi") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getVisualId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public VisualGlobalApiServiceImpl(final IInterfaceConfigService interfaceConfigService) { |
| | | this.interfaceConfigService = interfaceConfigService; |
| | |
| | | String types = visualGlobalQueryDTO.getType(); |
| | | List<Long> interfaceConfigIds = Lists.newArrayList(); |
| | | if (Func.isNotBlank(types)) { |
| | | interfaceConfigIds = (List<Long>)this.interfaceConfigService.list(Lambda.<InterfaceConfig>in(Func.isNotBlank(types), InterfaceConfig::getOwningChart, (types == null) ? null : types.split(",")) |
| | | .select(InterfaceConfig::getId)).stream().map(InterfaceConfig::getId).collect(Collectors.toList()); |
| | | /* |
| | | interfaceConfigIds = (List) this.interfaceConfigService.list(Lambda.in(Func.isNotBlank(types), (v0) -> { |
| | | return v0.getOwningChart(); |
| | | }, types == null ? null : types.split(",")).select((v0) -> { |
| | | return v0.getId(); |
| | | })).stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | }).collect(Collectors.toList());*/ |
| | | } |
| | | |
| | | return list( |
| | | Lambda.eq(VisualGlobalApi::getVisualId, visualGlobalQueryDTO.getVisualId()) |
| | | .in(!interfaceConfigIds.isEmpty(), VisualGlobalApi::getConfigId, interfaceConfigIds)); |
| | | /* |
| | | return list(Lambda.eq((v0) -> { |
| | | return v0.getVisualId(); |
| | | }, visualGlobalQueryDTO.getVisualId()).in(!interfaceConfigIds.isEmpty(), (v0) -> { |
| | | return v0.getConfigId(); |
| | | }, interfaceConfigIds)); |
| | | }, interfaceConfigIds));*/ |
| | | } |
| | | |
| | | @Override // org.springblade.modules.visual.service.IVisualGlobalApiService |
| | | public void updateVisualId(Visual visual, List<Long> globalApiId) { |
| | | if (globalApiId != null && !globalApiId.isEmpty()) { |
| | | lambdaUpdate() |
| | | .set(VisualGlobalApi::getVisualId, visual.getId()) |
| | | .set(VisualGlobalApi::getUpdateTime, new Date()) |
| | | .in(VisualGlobalApi::getId, globalApiId).update(); |
| | | /* |
| | | ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) lambdaUpdate().set((v0) -> { |
| | | return v0.getVisualId(); |
| | | }, visual.getId())).set((v0) -> { |
| | | return v0.getUpdateTime(); |
| | | }, new Date())).in((v0) -> { |
| | | return v0.getId(); |
| | | }, globalApiId)).update(); |
| | | }, globalApiId)).update();*/ |
| | | } |
| | | } |
| | | } |