类 ControllerUtils
java.lang.Object
com.publiccms.common.tools.ControllerUtils
Controller工具类
ControllerUtils
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static void
clearAdminToSession
(String contextPath, String scheme, jakarta.servlet.http.HttpSession session, jakarta.servlet.http.HttpServletResponse response) static void
clearOptAdminToSession
(jakarta.servlet.http.HttpSession session) static void
clearUserTimeToSession
(jakarta.servlet.http.HttpSession session) static void
clearUserToSession
(String contextPath, String scheme, jakarta.servlet.http.HttpSession session, jakarta.servlet.http.HttpServletResponse response) static boolean
errorCustom
(String field, boolean value, org.springframework.ui.Model model) static boolean
errorCustom
(String field, boolean value, org.springframework.ui.ModelMap model) static boolean
errorEquals
(String field, Long value, Long value2, org.springframework.ui.Model model) static boolean
errorEquals
(String field, Long value, Long value2, org.springframework.ui.ModelMap model) static boolean
errorHasExist
(String field, Object value, org.springframework.ui.Model model) static boolean
errorHasExist
(String field, Object value, org.springframework.ui.ModelMap model) static boolean
errorNotEMail
(String field, String value, org.springframework.ui.Model model) static boolean
errorNotEMail
(String field, String value, org.springframework.ui.ModelMap model) static boolean
errorNotEmpty
(String field, Object value, org.springframework.ui.Model model) static boolean
errorNotEmpty
(String field, Object value, org.springframework.ui.ModelMap model) static boolean
errorNotEmpty
(String field, String value, org.springframework.ui.Model model) static boolean
errorNotEmpty
(String field, String value, org.springframework.ui.ModelMap model) static boolean
errorNotEquals
(String field, Integer value1, Integer value2, org.springframework.ui.Model model) static boolean
errorNotEquals
(String field, Integer value1, Integer value2, org.springframework.ui.ModelMap model) static boolean
errorNotEquals
(String field, Long value1, Long value2, org.springframework.ui.Model model) static boolean
errorNotEquals
(String field, Long value1, Long value2, org.springframework.ui.ModelMap model) static boolean
errorNotEquals
(String field, Object value, org.springframework.ui.Model model) static boolean
errorNotEquals
(String field, Object value, org.springframework.ui.ModelMap model) static boolean
errorNotEquals
(String field, Short value1, Short value2, org.springframework.ui.Model model) static boolean
errorNotEquals
(String field, Short value1, Short value2, org.springframework.ui.ModelMap model) static boolean
errorNotEquals
(String field, String value1, String value2, org.springframework.ui.Model model) static boolean
errorNotEquals
(String field, String value1, String value2, org.springframework.ui.ModelMap model) static boolean
errorNotExist
(String field, Object value, org.springframework.ui.Model model) static boolean
errorNotExist
(String field, Object value, org.springframework.ui.ModelMap model) static boolean
errorNotGreaterThen
(String field, Integer value, int specific, org.springframework.ui.Model model) static boolean
errorNotGreaterThen
(String field, Integer value, int specific, org.springframework.ui.ModelMap model) static boolean
errorNotGreaterThen
(String field, Long value, long specific, org.springframework.ui.Model model) static boolean
errorNotGreaterThen
(String field, Long value, long specific, org.springframework.ui.ModelMap model) static boolean
errorNotLessThen
(String field, Integer value, int specific, org.springframework.ui.Model model) static boolean
errorNotLessThen
(String field, Integer value, int specific, org.springframework.ui.ModelMap model) static boolean
errorNotLongThen
(String field, String value, int specific, org.springframework.ui.Model model) static boolean
errorNotLongThen
(String field, String value, int specific, org.springframework.ui.ModelMap model) static boolean
errorNotNickname
(String field, String value, org.springframework.ui.Model model) static boolean
errorNotNickname
(String field, String value, org.springframework.ui.ModelMap model) static boolean
errorNotUserName
(String field, String value, org.springframework.ui.Model model) static boolean
errorNotUserName
(String field, String value, org.springframework.ui.ModelMap model) static SysUser
getAdminFromSession
(jakarta.servlet.http.HttpSession session) static String
getAdminToken
(jakarta.servlet.http.HttpServletRequest request) static SysSite
getSiteFromAttribute
(jakarta.servlet.http.HttpServletRequest request) private static String
static SysUser
getUserFromSession
(jakarta.servlet.http.HttpSession session) static Long
getUserTimeFromSession
(jakarta.servlet.http.HttpSession session) static String
getWebToken
(jakarta.servlet.http.HttpServletRequest request) static boolean
hasContentPermissions
(SysUser user, CmsContent content) static boolean
ipNotEquals
(String ip, SysUser user) static boolean
static boolean
static boolean
static <T> org.springframework.http.ResponseEntity<T>
static void
setAdminToSession
(jakarta.servlet.http.HttpSession session, SysUser user) static void
setOtpAdminToSession
(jakarta.servlet.http.HttpSession session, SysUser user) static void
setUserToSession
(jakarta.servlet.http.HttpSession session, SysUser user)
-
字段详细资料
-
NUMBER_PATTERN
Number Pattern -
UNVALID_CHARS
UNVALID Pattern -
VALID_CHARS
- 另请参阅:
-
EMAIL_PATTERN
Email Pattern
-
-
构造器详细资料
-
ControllerUtils
private ControllerUtils()
-
-
方法详细资料
-
redirect
- 类型参数:
T
-- 参数:
found
-url
-- 返回:
- response entity
-
errorNotEmpty
- 参数:
field
-value
-model
-- 返回:
- value是否为空
-
errorNotEmpty
public static boolean errorNotEmpty(String field, String value, org.springframework.ui.ModelMap model) - 参数:
field
-value
-model
-- 返回:
- value是否为空
-
errorCustom
- 参数:
field
-value
-model
-- 返回:
- value是否为true
-
errorCustom
public static boolean errorCustom(String field, boolean value, org.springframework.ui.ModelMap model) - 参数:
field
-value
-model
-- 返回:
- value是否为true
-
errorNotEmpty
- 参数:
field
-value
-model
-- 返回:
- value是否为空
-
errorNotEmpty
public static boolean errorNotEmpty(String field, Object value, org.springframework.ui.ModelMap model) - 参数:
field
-value
-model
-- 返回:
- value是否为空
-
errorNotGreaterThen
public static boolean errorNotGreaterThen(String field, Integer value, int specific, org.springframework.ui.Model model) - 参数:
field
-value
-specific
-model
-- 返回:
- value是否为空或是否大于等于specific
-
errorNotGreaterThen
public static boolean errorNotGreaterThen(String field, Integer value, int specific, org.springframework.ui.ModelMap model) - 参数:
field
-value
-specific
-model
-- 返回:
- value是否为空或是否大于等于specific
-
errorNotGreaterThen
public static boolean errorNotGreaterThen(String field, Long value, long specific, org.springframework.ui.Model model) - 参数:
field
-value
-specific
-model
-- 返回:
- value是否为空或是否大于等于specific
-
errorNotGreaterThen
public static boolean errorNotGreaterThen(String field, Long value, long specific, org.springframework.ui.ModelMap model) - 参数:
field
-value
-specific
-model
-- 返回:
- value是否为空或是否大于等于specific
-
errorNotLongThen
public static boolean errorNotLongThen(String field, String value, int specific, org.springframework.ui.Model model) - 参数:
field
-value
-specific
-model
-- 返回:
- value是否为空或长度大于specific
-
errorNotLongThen
public static boolean errorNotLongThen(String field, String value, int specific, org.springframework.ui.ModelMap model) - 参数:
field
-value
-specific
-model
-- 返回:
- value是否为空或长度大于specific
-
errorNotLessThen
public static boolean errorNotLessThen(String field, Integer value, int specific, org.springframework.ui.Model model) - 参数:
field
-value
-specific
-model
-- 返回:
- value是否为空或长度小于specific
-
errorNotLessThen
public static boolean errorNotLessThen(String field, Integer value, int specific, org.springframework.ui.ModelMap model) - 参数:
field
-value
-specific
-model
-- 返回:
- value是否为空或长度小于specific
-
errorNotEquals
public static boolean errorNotEquals(String field, Object value, org.springframework.ui.Model model) - 参数:
field
-value
-model
-- 返回:
- value是否为空
-
errorNotEquals
public static boolean errorNotEquals(String field, Object value, org.springframework.ui.ModelMap model) - 参数:
field
-value
-model
-- 返回:
- value是否为空
-
errorNotExist
- 参数:
field
-value
-model
-- 返回:
- value是否为空
-
errorNotExist
public static boolean errorNotExist(String field, Object value, org.springframework.ui.ModelMap model) - 参数:
field
-value
-model
-- 返回:
- value是否为空
-
errorHasExist
- 参数:
field
-value
-model
-- 返回:
- value是否不为空
-
errorHasExist
public static boolean errorHasExist(String field, Object value, org.springframework.ui.ModelMap model) - 参数:
field
-value
-model
-- 返回:
- value是否不为空
-
errorEquals
public static boolean errorEquals(String field, Long value, Long value2, org.springframework.ui.Model model) - 参数:
field
-value
-value2
-model
-- 返回:
- value1是否不为空并等于value2
-
errorEquals
public static boolean errorEquals(String field, Long value, Long value2, org.springframework.ui.ModelMap model) - 参数:
field
-value
-value2
-model
-- 返回:
- value1是否不为空并等于value2
-
errorNotEquals
public static boolean errorNotEquals(String field, String value1, String value2, org.springframework.ui.Model model) - 参数:
field
-value1
-value2
-model
-- 返回:
- value1是否不为空并不等于value2
-
errorNotEquals
public static boolean errorNotEquals(String field, String value1, String value2, org.springframework.ui.ModelMap model) - 参数:
field
-value1
-value2
-model
-- 返回:
- value1是否不为空并不等于value2
-
errorNotEquals
public static boolean errorNotEquals(String field, Integer value1, Integer value2, org.springframework.ui.Model model) - 参数:
field
-value1
-value2
-model
-- 返回:
- value1是否不为空并不等于value2
-
errorNotEquals
public static boolean errorNotEquals(String field, Integer value1, Integer value2, org.springframework.ui.ModelMap model) - 参数:
field
-value1
-value2
-model
-- 返回:
- value1是否不为空并不等于value2
-
errorNotEquals
public static boolean errorNotEquals(String field, Long value1, Long value2, org.springframework.ui.Model model) - 参数:
field
-value1
-value2
-model
-- 返回:
- value1是否不为空并不等于value2
-
errorNotEquals
public static boolean errorNotEquals(String field, Long value1, Long value2, org.springframework.ui.ModelMap model) - 参数:
field
-value1
-value2
-model
-- 返回:
- value1是否不为空并不等于value2
-
errorNotEquals
public static boolean errorNotEquals(String field, Short value1, Short value2, org.springframework.ui.Model model) - 参数:
field
-value1
-value2
-model
-- 返回:
- value1是否不为空并不等于value2
-
errorNotEquals
public static boolean errorNotEquals(String field, Short value1, Short value2, org.springframework.ui.ModelMap model) - 参数:
field
-value1
-value2
-model
-- 返回:
- value1是否不为空并不等于value2
-
getSiteFromAttribute
- 参数:
request
-- 返回:
- SysSite
-
getUserFromSession
- 参数:
session
-- 返回:
- SysUser
-
getUserTimeFromSession
- 参数:
session
-- 返回:
- Date
-
setUserToSession
- 参数:
session
-user
-
-
clearUserToSession
public static void clearUserToSession(String contextPath, String scheme, jakarta.servlet.http.HttpSession session, jakarta.servlet.http.HttpServletResponse response) - 参数:
contextPath
-scheme
-session
-response
-
-
clearUserTimeToSession
public static void clearUserTimeToSession(jakarta.servlet.http.HttpSession session) - 参数:
session
-
-
getAdminFromSession
- 参数:
session
-- 返回:
- SysUser
-
setAdminToSession
- 参数:
session
-user
-
-
setOtpAdminToSession
- 参数:
session
-user
-
-
clearOptAdminToSession
public static void clearOptAdminToSession(jakarta.servlet.http.HttpSession session) - 参数:
session
-contextPath
-scheme
-response
-
-
clearAdminToSession
public static void clearAdminToSession(String contextPath, String scheme, jakarta.servlet.http.HttpSession session, jakarta.servlet.http.HttpServletResponse response) - 参数:
contextPath
-scheme
-session
-response
-
-
getWebToken
- 参数:
request
-- 返回:
-
getAdminToken
- 参数:
request
-- 返回:
-
hasContentPermissions
- 参数:
user
-content
-- 返回:
- has content permission
-
ipNotEquals
-
getToken
- 参数:
request
-cookiesName
-- 返回:
-
notValid
- 参数:
value
-- 返回:
- boolean
-
errorNotEMail
- 参数:
field
-value
-model
-- 返回:
- boolean
-
errorNotEMail
public static boolean errorNotEMail(String field, String value, org.springframework.ui.ModelMap model) - 参数:
field
-value
-model
-- 返回:
- boolean
-
errorNotUserName
public static boolean errorNotUserName(String field, String value, org.springframework.ui.Model model) - 参数:
field
-value
-model
-- 返回:
- boolean
-
errorNotUserName
public static boolean errorNotUserName(String field, String value, org.springframework.ui.ModelMap model) - 参数:
field
-value
-model
-- 返回:
- boolean
-
errorNotNickname
public static boolean errorNotNickname(String field, String value, org.springframework.ui.Model model) - 参数:
field
-value
-model
-- 返回:
- boolean
-
errorNotNickname
public static boolean errorNotNickname(String field, String value, org.springframework.ui.ModelMap model) - 参数:
field
-value
-model
-- 返回:
- boolean
-
notEMail
- 参数:
value
-- 返回:
- boolean
-
notNumber
- 参数:
value
-- 返回:
- boolean
-