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; }