public class ControllerUtils
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static java.util.regex.Pattern |
EMAIL_PATTERN
Email Pattern
|
static java.util.regex.Pattern |
NUMBER_PATTERN
Number Pattern
|
static java.util.regex.Pattern |
UNVALID_CHARS
UNVALID Pattern
|
private static java.lang.String |
VALID_CHARS |
限定符 | 构造器和说明 |
---|---|
private |
ControllerUtils() |
限定符和类型 | 方法和说明 |
---|---|
static void |
clearAdminToSession(java.lang.String contextPath,
java.lang.String scheme,
javax.servlet.http.HttpSession session,
javax.servlet.http.HttpServletResponse response) |
static void |
clearUserTimeToSession(javax.servlet.http.HttpSession session) |
static void |
clearUserToSession(java.lang.String contextPath,
java.lang.String scheme,
javax.servlet.http.HttpSession session,
javax.servlet.http.HttpServletResponse response) |
static boolean |
errorCustom(java.lang.String field,
boolean value,
org.springframework.ui.Model model) |
static boolean |
errorCustom(java.lang.String field,
boolean value,
org.springframework.ui.ModelMap model) |
static boolean |
errorEquals(java.lang.String field,
java.lang.Long value,
java.lang.Long value2,
org.springframework.ui.Model model) |
static boolean |
errorEquals(java.lang.String field,
java.lang.Long value,
java.lang.Long value2,
org.springframework.ui.ModelMap model) |
static boolean |
errorHasExist(java.lang.String field,
java.lang.Object value,
org.springframework.ui.Model model) |
static boolean |
errorHasExist(java.lang.String field,
java.lang.Object value,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotEMail(java.lang.String field,
java.lang.String value,
org.springframework.ui.Model model) |
static boolean |
errorNotEMail(java.lang.String field,
java.lang.String value,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotEmpty(java.lang.String field,
java.lang.Object value,
org.springframework.ui.Model model) |
static boolean |
errorNotEmpty(java.lang.String field,
java.lang.Object value,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotEmpty(java.lang.String field,
java.lang.String value,
org.springframework.ui.Model model) |
static boolean |
errorNotEmpty(java.lang.String field,
java.lang.String value,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotEquals(java.lang.String field,
java.lang.Integer value1,
java.lang.Integer value2,
org.springframework.ui.Model model) |
static boolean |
errorNotEquals(java.lang.String field,
java.lang.Integer value1,
java.lang.Integer value2,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotEquals(java.lang.String field,
java.lang.Long value1,
java.lang.Long value2,
org.springframework.ui.Model model) |
static boolean |
errorNotEquals(java.lang.String field,
java.lang.Long value1,
java.lang.Long value2,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotEquals(java.lang.String field,
java.lang.Object value,
org.springframework.ui.Model model) |
static boolean |
errorNotEquals(java.lang.String field,
java.lang.Object value,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotEquals(java.lang.String field,
java.lang.Short value1,
java.lang.Short value2,
org.springframework.ui.Model model) |
static boolean |
errorNotEquals(java.lang.String field,
java.lang.Short value1,
java.lang.Short value2,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotEquals(java.lang.String field,
java.lang.String value1,
java.lang.String value2,
org.springframework.ui.Model model) |
static boolean |
errorNotEquals(java.lang.String field,
java.lang.String value1,
java.lang.String value2,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotExist(java.lang.String field,
java.lang.Object value,
org.springframework.ui.Model model) |
static boolean |
errorNotExist(java.lang.String field,
java.lang.Object value,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotGreaterThen(java.lang.String field,
java.lang.Integer value,
int specific,
org.springframework.ui.Model model) |
static boolean |
errorNotGreaterThen(java.lang.String field,
java.lang.Integer value,
int specific,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotGreaterThen(java.lang.String field,
java.lang.Long value,
long specific,
org.springframework.ui.Model model) |
static boolean |
errorNotGreaterThen(java.lang.String field,
java.lang.Long value,
long specific,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotLessThen(java.lang.String field,
java.lang.Integer value,
int specific,
org.springframework.ui.Model model) |
static boolean |
errorNotLessThen(java.lang.String field,
java.lang.Integer value,
int specific,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotLongThen(java.lang.String field,
java.lang.String value,
int specific,
org.springframework.ui.Model model) |
static boolean |
errorNotLongThen(java.lang.String field,
java.lang.String value,
int specific,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotNickname(java.lang.String field,
java.lang.String value,
org.springframework.ui.Model model) |
static boolean |
errorNotNickname(java.lang.String field,
java.lang.String value,
org.springframework.ui.ModelMap model) |
static boolean |
errorNotUserName(java.lang.String field,
java.lang.String value,
org.springframework.ui.Model model) |
static boolean |
errorNotUserName(java.lang.String field,
java.lang.String value,
org.springframework.ui.ModelMap model) |
static SysUser |
getAdminFromSession(javax.servlet.http.HttpSession session) |
static java.lang.String |
getAdminToken(javax.servlet.http.HttpServletRequest request) |
static SysSite |
getSiteFromAttribute(javax.servlet.http.HttpServletRequest request) |
private static java.lang.String |
getToken(javax.servlet.http.HttpServletRequest request,
java.lang.String cookiesName) |
static SysUser |
getUserFromSession(javax.servlet.http.HttpSession session) |
static java.lang.Long |
getUserTimeFromSession(javax.servlet.http.HttpSession session) |
static java.lang.String |
getWebToken(javax.servlet.http.HttpServletRequest request) |
static boolean |
hasContentPermissions(SysUser user,
CmsContent content) |
static boolean |
ipNotEquals(java.lang.String ip,
SysUser user) |
static boolean |
notEMail(java.lang.String value) |
static boolean |
notNumber(java.lang.String value) |
static boolean |
notValid(java.lang.String value) |
static <T> org.springframework.http.ResponseEntity<T> |
redirect(boolean found,
java.lang.String url) |
static void |
setAdminToSession(javax.servlet.http.HttpSession session,
SysUser user) |
static void |
setUserToSession(javax.servlet.http.HttpSession session,
SysUser user) |
public static final java.util.regex.Pattern NUMBER_PATTERN
public static final java.util.regex.Pattern UNVALID_CHARS
private static final java.lang.String VALID_CHARS
public static final java.util.regex.Pattern EMAIL_PATTERN
public static <T> org.springframework.http.ResponseEntity<T> redirect(boolean found, java.lang.String url)
T
- found
- url
- public static boolean errorNotEmpty(java.lang.String field, java.lang.String value, org.springframework.ui.Model model)
field
- value
- model
- public static boolean errorNotEmpty(java.lang.String field, java.lang.String value, org.springframework.ui.ModelMap model)
field
- value
- model
- public static boolean errorCustom(java.lang.String field, boolean value, org.springframework.ui.Model model)
field
- value
- model
- public static boolean errorCustom(java.lang.String field, boolean value, org.springframework.ui.ModelMap model)
field
- value
- model
- public static boolean errorNotEmpty(java.lang.String field, java.lang.Object value, org.springframework.ui.Model model)
field
- value
- model
- public static boolean errorNotEmpty(java.lang.String field, java.lang.Object value, org.springframework.ui.ModelMap model)
field
- value
- model
- public static boolean errorNotGreaterThen(java.lang.String field, java.lang.Integer value, int specific, org.springframework.ui.Model model)
field
- value
- specific
- model
- public static boolean errorNotGreaterThen(java.lang.String field, java.lang.Integer value, int specific, org.springframework.ui.ModelMap model)
field
- value
- specific
- model
- public static boolean errorNotGreaterThen(java.lang.String field, java.lang.Long value, long specific, org.springframework.ui.Model model)
field
- value
- specific
- model
- public static boolean errorNotGreaterThen(java.lang.String field, java.lang.Long value, long specific, org.springframework.ui.ModelMap model)
field
- value
- specific
- model
- public static boolean errorNotLongThen(java.lang.String field, java.lang.String value, int specific, org.springframework.ui.Model model)
field
- value
- specific
- model
- public static boolean errorNotLongThen(java.lang.String field, java.lang.String value, int specific, org.springframework.ui.ModelMap model)
field
- value
- specific
- model
- public static boolean errorNotLessThen(java.lang.String field, java.lang.Integer value, int specific, org.springframework.ui.Model model)
field
- value
- specific
- model
- public static boolean errorNotLessThen(java.lang.String field, java.lang.Integer value, int specific, org.springframework.ui.ModelMap model)
field
- value
- specific
- model
- public static boolean errorNotEquals(java.lang.String field, java.lang.Object value, org.springframework.ui.Model model)
field
- value
- model
- public static boolean errorNotEquals(java.lang.String field, java.lang.Object value, org.springframework.ui.ModelMap model)
field
- value
- model
- public static boolean errorNotExist(java.lang.String field, java.lang.Object value, org.springframework.ui.Model model)
field
- value
- model
- public static boolean errorNotExist(java.lang.String field, java.lang.Object value, org.springframework.ui.ModelMap model)
field
- value
- model
- public static boolean errorHasExist(java.lang.String field, java.lang.Object value, org.springframework.ui.Model model)
field
- value
- model
- public static boolean errorHasExist(java.lang.String field, java.lang.Object value, org.springframework.ui.ModelMap model)
field
- value
- model
- public static boolean errorEquals(java.lang.String field, java.lang.Long value, java.lang.Long value2, org.springframework.ui.Model model)
field
- value
- value2
- model
- public static boolean errorEquals(java.lang.String field, java.lang.Long value, java.lang.Long value2, org.springframework.ui.ModelMap model)
field
- value
- value2
- model
- public static boolean errorNotEquals(java.lang.String field, java.lang.String value1, java.lang.String value2, org.springframework.ui.Model model)
field
- value1
- value2
- model
- public static boolean errorNotEquals(java.lang.String field, java.lang.String value1, java.lang.String value2, org.springframework.ui.ModelMap model)
field
- value1
- value2
- model
- public static boolean errorNotEquals(java.lang.String field, java.lang.Integer value1, java.lang.Integer value2, org.springframework.ui.Model model)
field
- value1
- value2
- model
- public static boolean errorNotEquals(java.lang.String field, java.lang.Integer value1, java.lang.Integer value2, org.springframework.ui.ModelMap model)
field
- value1
- value2
- model
- public static boolean errorNotEquals(java.lang.String field, java.lang.Long value1, java.lang.Long value2, org.springframework.ui.Model model)
field
- value1
- value2
- model
- public static boolean errorNotEquals(java.lang.String field, java.lang.Long value1, java.lang.Long value2, org.springframework.ui.ModelMap model)
field
- value1
- value2
- model
- public static boolean errorNotEquals(java.lang.String field, java.lang.Short value1, java.lang.Short value2, org.springframework.ui.Model model)
field
- value1
- value2
- model
- public static boolean errorNotEquals(java.lang.String field, java.lang.Short value1, java.lang.Short value2, org.springframework.ui.ModelMap model)
field
- value1
- value2
- model
- public static SysSite getSiteFromAttribute(javax.servlet.http.HttpServletRequest request)
request
- public static SysUser getUserFromSession(javax.servlet.http.HttpSession session)
session
- public static java.lang.Long getUserTimeFromSession(javax.servlet.http.HttpSession session)
session
- public static void setUserToSession(javax.servlet.http.HttpSession session, SysUser user)
session
- user
- public static void clearUserToSession(java.lang.String contextPath, java.lang.String scheme, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response)
contextPath
- scheme
- session
- response
- public static void clearUserTimeToSession(javax.servlet.http.HttpSession session)
session
- public static SysUser getAdminFromSession(javax.servlet.http.HttpSession session)
session
- public static void setAdminToSession(javax.servlet.http.HttpSession session, SysUser user)
session
- user
- public static void clearAdminToSession(java.lang.String contextPath, java.lang.String scheme, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response)
contextPath
- scheme
- session
- response
- public static java.lang.String getWebToken(javax.servlet.http.HttpServletRequest request)
request
- public static java.lang.String getAdminToken(javax.servlet.http.HttpServletRequest request)
request
- public static boolean hasContentPermissions(SysUser user, CmsContent content)
user
- content
- public static boolean ipNotEquals(java.lang.String ip, SysUser user)
private static java.lang.String getToken(javax.servlet.http.HttpServletRequest request, java.lang.String cookiesName)
request
- cookiesName
- public static boolean notValid(java.lang.String value)
value
- public static boolean errorNotEMail(java.lang.String field, java.lang.String value, org.springframework.ui.Model model)
field
- value
- model
- public static boolean errorNotEMail(java.lang.String field, java.lang.String value, org.springframework.ui.ModelMap model)
field
- value
- model
- public static boolean errorNotUserName(java.lang.String field, java.lang.String value, org.springframework.ui.Model model)
field
- value
- model
- public static boolean errorNotUserName(java.lang.String field, java.lang.String value, org.springframework.ui.ModelMap model)
field
- value
- model
- public static boolean errorNotNickname(java.lang.String field, java.lang.String value, org.springframework.ui.Model model)
field
- value
- model
- public static boolean errorNotNickname(java.lang.String field, java.lang.String value, org.springframework.ui.ModelMap model)
field
- value
- model
- public static boolean notEMail(java.lang.String value)
value
- public static boolean notNumber(java.lang.String value)
value
-