| | |
| | | package com.qianwen.smartman.modules.system.controller; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.validation.Valid; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.core.boot.ctrl.BladeController; |
| | | import com.qianwen.core.mp.support.Condition; |
| | | import com.qianwen.core.mp.support.Query; |
| | |
| | | import com.qianwen.core.secure.annotation.PreAuth; |
| | | import com.qianwen.core.tool.api.R; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.modules.system.dto.MetaObjectTypeDTO; |
| | | import com.qianwen.smartman.modules.system.entity.MetaObjectType; |
| | | import com.qianwen.smartman.modules.system.entity.MetaObjectTypeField; |
| | | import com.qianwen.smartman.modules.system.entity.TableDetail; |
| | | import com.qianwen.smartman.modules.system.service.IMetaObjectTypeFieldService; |
| | | import com.qianwen.smartman.modules.system.service.IMetaObjectTypeService; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | @ApiResource({"blade-system/meta-object-type"}) |
| | | @Api(value = "业务对象", tags = {"业务对象相关接口"}) |
| | |
| | | public class MetaObjectTypeController extends BladeController { |
| | | private IMetaObjectTypeService metaObjectTypeService; |
| | | private IMetaObjectTypeFieldService metaObjectTypeFieldService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1249363733: |
| | | if (implMethodName.equals("getFId")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case -75308287: |
| | | if (implMethodName.equals("getName")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 16953342: |
| | | if (implMethodName.equals("getSubsysId")) { |
| | | 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/modules/system/entity/MetaObjectType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getFId(); |
| | | }; |
| | | } |
| | | 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/MetaObjectType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getFId(); |
| | | }; |
| | | } |
| | | 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/MetaObjectType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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/MetaObjectType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getSubsysId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public MetaObjectTypeController(final IMetaObjectTypeService metaObjectTypeService, final IMetaObjectTypeFieldService metaObjectTypeFieldService) { |
| | | this.metaObjectTypeService = metaObjectTypeService; |
| | |
| | | @GetResource({"/list"}) |
| | | @ApiOperation(value = "分页", notes = "业务对象列表") |
| | | public R<IPage<MetaObjectType>> list(@ApiParam("业务对象名称") String name, @ApiParam("子系统编码") String subsysId, @ApiParam("业务对象编码") String fid, Query query) { |
| | | IPage<MetaObjectType> pages = this.metaObjectTypeService.page(Condition.getPage(query), |
| | | |
| | | Wrappers.<MetaObjectType>lambdaQuery() |
| | | .like(Func.isNotEmpty(name), MetaObjectType::getName, name) |
| | | .eq(Func.isNotEmpty(subsysId), MetaObjectType::getSubsysId, subsysId) |
| | | .eq(Func.isNotEmpty(fid), MetaObjectType::getFId, fid)); |
| | | /* |
| | | IPage<MetaObjectType> pages = this.metaObjectTypeService.page(Condition.getPage(query), Wrappers.lambdaQuery().like(Func.isNotEmpty(name), (v0) -> { |
| | | return v0.getName(); |
| | | }, name).eq(Func.isNotEmpty(subsysId), (v0) -> { |
| | | return v0.getSubsysId(); |
| | | }, subsysId).eq(Func.isNotEmpty(fid), (v0) -> { |
| | | return v0.getFId(); |
| | | }, fid)); |
| | | }, fid));*/ |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | |
| | | @GetResource({"/findAll"}) |
| | | public R<List<?>> findAll(@RequestParam String columns) { |
| | | return R.data(this.metaObjectTypeService.list(new QueryWrapper().select(new String[]{columns}))); |
| | | return R.data(this.metaObjectTypeService.list(new QueryWrapper<MetaObjectType>().select(new String[]{columns}))); |
| | | } |
| | | |
| | | @PreAuth |