权限功能提供列表接口

This commit is contained in:
tiger_zhou 2022-10-24 16:44:48 +08:00
parent 616d8898b4
commit c8a77c9034
2 changed files with 21 additions and 0 deletions

View File

@ -68,6 +68,16 @@ public class AcPermissionController {
return this.permissionService.findPermissionAbilities(permissionId);
}
/**
* 查询所有权限列表
* @param name 模糊匹配权限名称
* @return
*/
@GetMapping("/all")
public List<PermissionBasicRspVo> findAllPermission(@RequestParam(value = "name",required = false) String name) {
return this.permissionService.findAllPermission(name);
}
/**
* 删除权限的功能
*/

View File

@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.time.LocalDateTime;
import java.util.ArrayList;
@ -144,6 +145,16 @@ public class AcPermissionService {
permissionSystemAbilityDAO.insertSelective(permissionAddAbility);
}
public List<PermissionBasicRspVo> findAllPermission(String name){
PermissionExample example = new PermissionExample();
if(StringUtils.hasText(name)){
example.createCriteria().andNameLike(String.format("%s%%",name));
}
List<Permission> list = permissionDAO.selectByExample(example);
return list.stream().map(PermissionConvertor::convertPermissionBasicRspVoFrom).collect(Collectors.toList());
}
/**
* 获取权限的所有功能
*