| | |
| | | package com.qianwen.smartman.modules.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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 java.lang.invoke.SerializedLambda; |
| | | import java.util.List; |
| | | import com.qianwen.core.mp.support.Condition; |
| | | import com.qianwen.core.mp.support.Query; |
| | | import com.qianwen.core.scanner.modular.annotation.GetResource; |
| | |
| | | import com.qianwen.smartman.modules.system.vo.PostVO; |
| | | import com.qianwen.smartman.modules.system.vo.RoleVO; |
| | | import com.qianwen.smartman.modules.system.wrapper.PostWrapper; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | @Api(value = "查询", tags = {"查询"}) |
| | | @RestController |
| | |
| | | private final IRoleService roleService; |
| | | private final IDataScopeManagerService deptService; |
| | | private final IPostService postService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1460243263: |
| | | if (implMethodName.equals("getPostName")) { |
| | | z = false; |
| | | 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/Post") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getPostName(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public SearchController(final IRoleService roleService, final IDataScopeManagerService deptService, final IPostService postService) { |
| | | this.roleService = roleService; |
| | |
| | | @GetResource({"/post"}) |
| | | @ApiOperation(value = "岗位信息查询", notes = "传入postName") |
| | | public R<IPage<PostVO>> postSearch(String postName, Query query) { |
| | | Wrapper lambda = Wrappers.query().lambda(); |
| | | |
| | | LambdaQueryWrapper<Post> queryWrapper = Wrappers.<Post>query().lambda(); |
| | | if (Func.isNotBlank(postName)) { |
| | | lambda.like((v0) -> { |
| | | queryWrapper.like((v0) -> { |
| | | return v0.getPostName(); |
| | | }, postName); |
| | | } |
| | | IPage<Post> pages = this.postService.page(Condition.getPage(query), lambda); |
| | | IPage<Post> pages = this.postService.page(Condition.getPage(query), queryWrapper); |
| | | return R.data(PostWrapper.build().pageVO(pages)); |
| | | } |
| | | } |