添加项目增删改查接口,以及用户和项目关联增删改查接口

This commit is contained in:
lcj
2025-03-05 16:23:44 +08:00
parent 8a926e0047
commit 93e8ee265f
31 changed files with 2266 additions and 7 deletions

View File

@ -0,0 +1,31 @@
package org.dromara.common.core.common;
import lombok.Data;
import org.dromara.common.core.constant.CommonConstant;
/**
* 分页请求
*/
@Data
public class PageRequest {
/**
* 当前页号
*/
private int current = 1;
/**
* 页面大小
*/
private int pageSize = 10;
/**
* 排序字段
*/
private String sortField;
/**
* 排序顺序(默认升序)
*/
private String sortOrder = CommonConstant.SORT_ORDER_ASC;
}

View File

@ -0,0 +1,18 @@
package org.dromara.common.core.constant;
/**
* 通用常量
*/
public interface CommonConstant {
/**
* 升序
*/
String SORT_ORDER_ASC = "ascend";
/**
* 降序
*/
String SORT_ORDER_DESC = " descend";
}

View File

@ -53,4 +53,17 @@ public class SqlUtil {
}
}
}
/**
* 校验排序字段是否合法(防止 SQL 注入)
*
* @param sortField 排序字段
* @return 是否存在 SQL 注入
*/
public static boolean validSortField(String sortField) {
if (StringUtils.isBlank(sortField)) {
return false;
}
return !StringUtils.containsAny(sortField, "=", "(", ")", " ");
}
}