From 828d6baae4527d87689c1ea51690bbc010333010 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Fri, 29 Apr 2022 11:24:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=88=91=E7=9A=84=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/controller/ResourceController.java | 2 +- .../resource/service/impl/ResourceServiceImpl.java | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 351b9601..d249bd43 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -44,7 +44,7 @@ public class ResourceController { @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = "type", value = "类型", paramType = "query", required = true, dataType = "String"), - //@ApiImplicitParam(name = "name", value = "资源名称", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "name", value = "资源名称", paramType = "query", dataType="String") , @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"), @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "creator", value = "创建者用户id", paramType = "query", dataType = "String") diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 470d926b..b797b456 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -59,13 +59,10 @@ public class ResourceServiceImpl extends CrudServiceImpl getWrapper(Map params) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("type", params.get("type").toString()) - //.like(StringUtils.isNotBlank(params.get("name").toString()),"name", params.get("name").toString()) - .orderByDesc("create_date"); - if (params.containsKey("creator")) { //查该用户创建的资源 - wrapper.eq("creator", params.get("creator").toString()); - } else { // 公共页(只出正常的) - wrapper.eq("del_flag", 0); - } + .like(StringUtils.isNotBlank(params.get("name").toString()),"name", params.get("name").toString()) + .orderByDesc("create_date") + .eq("creator", params.get("creator").toString()) + .eq("del_flag", 0); return wrapper; }