查询我的发布

This commit is contained in:
dinggang 2022-04-29 11:24:29 +08:00
parent f4090ec01c
commit 828d6baae4
2 changed files with 5 additions and 8 deletions

View File

@ -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")

View File

@ -59,13 +59,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
public QueryWrapper<ResourceEntity> getWrapper(Map<String, Object> params) {
QueryWrapper<ResourceEntity> 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;
}