nili 7 months ago
parent
commit
4b495fbdc2
  1. 5
      game-service/src/main/java/awesome/group/game/service/AdminService.java
  2. 8
      game-service/src/main/java/awesome/group/game/service/bo/PageResult.java

5
game-service/src/main/java/awesome/group/game/service/AdminService.java

@ -15,12 +15,14 @@ import awesome.group.game.service.common.exception.PaganiExceptionCode;
import awesome.group.game.service.util.EncryptUtil; import awesome.group.game.service.util.EncryptUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -68,6 +70,9 @@ public class AdminService {
wrapper.orderByDesc(MatrixAdvRecord::getId); wrapper.orderByDesc(MatrixAdvRecord::getId);
if (ownerId != 1) { if (ownerId != 1) {
List<Integer> appIds = appList.stream().filter(x -> x.getOwnerId() != null && x.getOwnerId() == ownerId).map(MatrixApp::getId).toList(); List<Integer> appIds = appList.stream().filter(x -> x.getOwnerId() != null && x.getOwnerId() == ownerId).map(MatrixApp::getId).toList();
if (CollectionUtils.isEmpty(appIds)) {
return new PageResult<>(new ArrayList<>(), 0);
}
wrapper.in(MatrixAdvRecord::getAppId, appIds); wrapper.in(MatrixAdvRecord::getAppId, appIds);
} }
int page = param.current; int page = param.current;

8
game-service/src/main/java/awesome/group/game/service/bo/PageResult.java

@ -5,4 +5,12 @@ import java.util.List;
public class PageResult<T> { public class PageResult<T> {
public List<T> data; public List<T> data;
public long total; public long total;
public PageResult() {
}
public PageResult(List<T> data, long total) {
this.data = data;
this.total = total;
}
} }

Loading…
Cancel
Save