package com.qianwen.smartman.modules.system.controller; import com.baomidou.mybatisplus.core.conditions.Wrapper; 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.core.scanner.modular.stereotype.ApiResource; import com.qianwen.core.tenant.annotation.NonDS; import com.qianwen.core.tool.api.R; import com.qianwen.core.tool.utils.Func; import com.qianwen.smartman.modules.system.entity.Post; import com.qianwen.smartman.modules.system.service.IDataScopeManagerService; import com.qianwen.smartman.modules.system.service.IPostService; import com.qianwen.smartman.modules.system.service.IRoleService; import com.qianwen.smartman.modules.system.vo.DeptVO; 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; @Api(value = "查询", tags = {"查询"}) @RestController @ApiResource({"blade-system/search"}) @NonDS /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/controller/SearchController.class */ public class SearchController { 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; this.deptService = deptService; this.postService = postService; } @ApiOperationSupport(order = 1) @GetResource({"/role"}) @ApiOperation(value = "角色信息查询", notes = "传入roleName或者parentId") public R> roleSearch(String roleName, Long parentId) { return R.data(this.roleService.search(roleName, parentId)); } @ApiOperationSupport(order = 2) @GetResource({"/dept"}) @ApiOperation(value = "部门信息查询", notes = "传入deptName或者parentId") public R> deptSearch(String deptName, Long parentId) { return R.data(this.deptService.search(deptName, parentId)); } @ApiOperationSupport(order = 3) @GetResource({"/post"}) @ApiOperation(value = "岗位信息查询", notes = "传入postName") public R> postSearch(String postName, Query query) { Wrapper lambda = Wrappers.query().lambda(); if (Func.isNotBlank(postName)) { lambda.like((v0) -> { return v0.getPostName(); }, postName); } IPage pages = this.postService.page(Condition.getPage(query), lambda); return R.data(PostWrapper.build().pageVO(pages)); } }