2
0

feat: portal管理和其他调整

This commit is contained in:
caiyuchao
2025-02-17 14:14:24 +08:00
parent 55d6cac588
commit 204c59c065
11 changed files with 245 additions and 52 deletions

View File

@@ -1,22 +1,24 @@
package org.wfc.common.core.utils;
import com.github.pagehelper.PageHelper;
import org.wfc.common.core.constant.HttpStatus;
import org.wfc.common.core.utils.sql.SqlUtil;
import org.wfc.common.core.web.page.PageDomain;
import org.wfc.common.core.web.page.TableDataInfo;
import org.wfc.common.core.web.page.TableSupport;
import java.util.List;
/**
* 分页工具类
*
*
* @author wfc
*/
public class PageUtils extends PageHelper
{
public class PageUtils extends PageHelper {
/**
* 设置请求分页数据
*/
public static void startPage()
{
public static void startPage() {
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
@@ -28,8 +30,18 @@ public class PageUtils extends PageHelper
/**
* 清理分页的线程变量
*/
public static void clearPage()
{
public static void clearPage() {
PageHelper.clearPage();
}
/**
* 响应请求分页数据
*/
public static TableDataInfo getDataTable(List<?> list, Long total) {
TableDataInfo rspData = new TableDataInfo(list, total);
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("Query successful");
return rspData;
}
}

View File

@@ -0,0 +1,22 @@
package org.wfc.common.core.utils;
import lombok.extern.slf4j.Slf4j;
import org.wfc.common.core.constant.WifiConstants;
import org.wfc.common.core.exception.OmadaException;
/**
* @description: reponseutil
* @author: cyc
* @since: 2025-02-17
*/
@Slf4j
public class ResponseUtils {
public static void checkResponse(Integer errorCode, String msg) {
if (errorCode != WifiConstants.ERROR_CODE_SUCCESS) {
log.error("Omada error msg: {}", msg);
throw new OmadaException(msg);
}
}
}