Commit 800406d4 authored by renandong's avatar renandong 🇨🇳

1.增加判断推送内容长度不能超过60字符

parent 3ff4693d
...@@ -6,6 +6,7 @@ public enum ResultCode implements IErrorCode { ...@@ -6,6 +6,7 @@ public enum ResultCode implements IErrorCode {
VALIDATE_FAILED(404, "参数检验失败"), VALIDATE_FAILED(404, "参数检验失败"),
UNAUTHORIZED(401, "暂未登录或token已经过期"), UNAUTHORIZED(401, "暂未登录或token已经过期"),
PARAMS_ERROR(40001, "参数错误不能为空"), PARAMS_ERROR(40001, "参数错误不能为空"),
CONTENT_MORE_LENGTH(40002, "推送内容过长超过60字符"),
NOT_SIGN_ERROR(50003, "签名信息不可为空"), NOT_SIGN_ERROR(50003, "签名信息不可为空"),
REQUEST_EXPIRE_ERROR(50004, "请求已过期"), REQUEST_EXPIRE_ERROR(50004, "请求已过期"),
CANNOT_ANALYSIS_PARAM_ERROR(50005, "无法解析的请求参数"), CANNOT_ANALYSIS_PARAM_ERROR(50005, "无法解析的请求参数"),
......
...@@ -13,6 +13,10 @@ public class ValidatorParam { ...@@ -13,6 +13,10 @@ public class ValidatorParam {
public static CommonResult validPushSingleAlias(InformForm informForm) { public static CommonResult validPushSingleAlias(InformForm informForm) {
String body = informForm.getBody();
if (body.length() > 60) {
return CommonResult.failed(ResultCode.CONTENT_MORE_LENGTH);
}
Integer pushType = informForm.getPushType(); Integer pushType = informForm.getPushType();
if (pushType != null && pushType == 1) { if (pushType != null && pushType == 1) {
String className = informForm.getClassName(); String className = informForm.getClassName();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment