Skip to content

Commit

Permalink
update query by page param
Browse files Browse the repository at this point in the history
  • Loading branch information
woodwhales committed Sep 20, 2021
1 parent a3eb40f commit 1cae4ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.woodwhales.music.controller.param;

import cn.woodwhales.common.model.param.PageQueryParam;
import lombok.Data;

/**
Expand All @@ -9,11 +10,7 @@
* @description:
*/
@Data
public class PageMusicQueryRequestParam {

private Integer page;

private Integer limit;
public class PageMusicQueryRequestParam extends PageQueryParam {

private String searchInfo;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.woodwhales.music.service.music;

import cn.woodwhales.common.model.util.PageUtil;
import cn.woodwhales.common.model.vo.PageRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
Expand Down Expand Up @@ -70,7 +71,7 @@ public boolean createMusic(MusicCreateRequestBody requestBody) {

@Override
public PageRespVO<MusicSimpleInfo> pageMusic(PageMusicQueryRequestParam param) {
Page<Music> page = new Page<>(param.getPage(), param.getLimit());
IPage<Music> page = PageUtil.buildPage(param);
LambdaQueryWrapper<Music> wrapper = Wrappers.lambdaQuery();
wrapper.and(StringUtils.isNotBlank(param.getSearchInfo()),
i -> i.like(Music::getTitle, param.getSearchInfo())
Expand Down

0 comments on commit 1cae4ba

Please sign in to comment.