平台参数校验修改
This commit is contained in:
parent
0c3d2672f6
commit
5fb9d2df42
|
|
@ -1,5 +1,8 @@
|
||||||
package cn.org.gitlink.notification.common.constant;
|
package cn.org.gitlink.notification.common.constant;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description:
|
* @description:
|
||||||
* @author: wanjia
|
* @author: wanjia
|
||||||
|
|
@ -8,4 +11,11 @@ package cn.org.gitlink.notification.common.constant;
|
||||||
public class NotificationSystemConstant {
|
public class NotificationSystemConstant {
|
||||||
//平台编码
|
//平台编码
|
||||||
public static final String PLATFORM_CODE_GITLINK = "gitlink"; //gitlink平台
|
public static final String PLATFORM_CODE_GITLINK = "gitlink"; //gitlink平台
|
||||||
|
public static final String PLATFORM_CODE_HEHUI = "hehui"; //hehui平台
|
||||||
|
public static final Map<String, String> PLATFORM_CODE_MAP = new HashMap<String, String>() {
|
||||||
|
{
|
||||||
|
put("gitlink", PLATFORM_CODE_GITLINK);
|
||||||
|
put("hehui", PLATFORM_CODE_HEHUI);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ public class NotificationController {
|
||||||
private ResponseData validatePlatformCodeAndReceiver(String platform, Integer receiver) {
|
private ResponseData validatePlatformCodeAndReceiver(String platform, Integer receiver) {
|
||||||
|
|
||||||
//验证 {platform} 参数合法性,以判断请求来源
|
//验证 {platform} 参数合法性,以判断请求来源
|
||||||
if (!platform.trim().toLowerCase().equals(NotificationSystemConstant.PLATFORM_CODE_GITLINK)) {
|
if (!NotificationSystemConstant.PLATFORM_CODE_MAP.containsKey(platform)) {
|
||||||
logger.debug("\t 输入参数 {platform} 的值 {" + platform + "} 无效");
|
logger.debug("\t 输入参数 {platform} 的值 {" + platform + "} 无效");
|
||||||
return DataPacketUtil.jsonFailResult("{platform} 参数非法");
|
return DataPacketUtil.jsonFailResult("{platform} 参数非法");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ public class NotificationController {
|
||||||
private ResponseData validatePlatformCode(String platform) {
|
private ResponseData validatePlatformCode(String platform) {
|
||||||
|
|
||||||
//验证 {platform} 参数合法性,以判断请求来源
|
//验证 {platform} 参数合法性,以判断请求来源
|
||||||
if (!platform.trim().toLowerCase().equals(NotificationSystemConstant.PLATFORM_CODE_GITLINK)) {
|
if (!NotificationSystemConstant.PLATFORM_CODE_MAP.containsKey(platform)) {
|
||||||
logger.debug("\t 输入参数 {platform} 的值 {" + platform + "} 无效");
|
logger.debug("\t 输入参数 {platform} 的值 {" + platform + "} 无效");
|
||||||
return DataPacketUtil.jsonFailResult("{platform} 参数非法");
|
return DataPacketUtil.jsonFailResult("{platform} 参数非法");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue