我的应用
parent
0ba54777da
commit
de713deca6
@ -0,0 +1,27 @@
|
|||||||
|
package cn.jlw.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.ibeetl.admin.core.web.query.PageParam;
|
||||||
|
import org.beetl.sql.core.engine.PageQuery;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 分页工具
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author mlx
|
||||||
|
* @date 2022/11/23
|
||||||
|
* @modified
|
||||||
|
*/
|
||||||
|
public class PageUtil {
|
||||||
|
|
||||||
|
public static <T extends PageParam> PageQuery ofDefault(T t) {
|
||||||
|
return new PageQuery<>(t.getPage().longValue(), t.getLimit().longValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T extends PageParam, P extends PageQuery> P ofDefault(P p, T t) {
|
||||||
|
p.setPageSize(ObjectUtil.defaultIfNull(t.getLimit(), 20).longValue());
|
||||||
|
p.setPageNumber(ObjectUtil.defaultIfNull(t.getPage(), 1).longValue());
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
}
|
@ -1,17 +1,20 @@
|
|||||||
package com.ibeetl.jlw.service;
|
package com.ibeetl.jlw.service.api;
|
||||||
|
|
||||||
import com.ibeetl.admin.core.entity.CoreUser;
|
import com.ibeetl.admin.core.entity.CoreUser;
|
||||||
import com.ibeetl.admin.core.service.CoreBaseAnnotationParser;
|
import com.ibeetl.admin.core.service.CoreBaseAnnotationParser;
|
||||||
import com.ibeetl.jlw.entity.api.CurrentUserInfo;
|
import com.ibeetl.jlw.entity.api.CurrentUserInfo;
|
||||||
|
import com.ibeetl.jlw.service.ResourcesApplicationService;
|
||||||
|
import com.ibeetl.jlw.service.WebPlatformService;
|
||||||
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 static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
|
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class IndexBaseService extends CoreBaseAnnotationParser {
|
public class ApiIndexBaseService extends CoreBaseAnnotationParser {
|
||||||
|
|
||||||
@Autowired private WebPlatformService webPlatformService;
|
@Autowired private WebPlatformService webPlatformService;
|
||||||
|
@Autowired private ResourcesApplicationService resourcesApplicationService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前登录信息
|
* 获取当前登录信息
|
Loading…
Reference in New Issue