OCT 1. 更新所有文档注释

This commit is contained in:
黄昕 2023-11-15 17:04:04 +08:00
parent ba79c32441
commit 98b8215329
66 changed files with 329 additions and 554 deletions

View File

@ -1,8 +1,8 @@
#!/bin/bash
# crontab里加上进程自动拉起任务做个简单的监控 # crontab里加上进程自动拉起任务做个简单的监控
# */1 * * * * source /etc/profile;sh /apprun/${YOUR_APP_NAME}/bin/processor_check.sh # */1 * * * * source /etc/profile;sh /apprun/${YOUR_APP_NAME}/bin/processor_check.sh
# processor_check.sh脚本内容如下 # processor_check.sh脚本内容如下
#!/bin/bash
APP_NAME=dispose_platform.jar APP_NAME=dispose_platform.jar
WORK_PATH=$(cd `dirname $0`; pwd) WORK_PATH=$(cd `dirname $0`; pwd)

View File

@ -5,11 +5,19 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
/**
* The type Game database service application.
*/
@SpringBootApplication @SpringBootApplication
@MapperScan(basePackages = {"com.cmhi.gds.mapper"}) @MapperScan(basePackages = {"com.cmhi.gds.mapper"})
@EnableScheduling @EnableScheduling
public class GameDatabaseServiceApplication { public class GameDatabaseServiceApplication {
/**
* The entry point of application.
*
* @param args the input arguments
*/
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(GameDatabaseServiceApplication.class, args); SpringApplication.run(GameDatabaseServiceApplication.class, args);
} }

View File

@ -2,8 +2,6 @@ package com.cmhi.gds.common;
/** /**
* The interface Base enum. * The interface Base enum.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public interface BaseEnum { public interface BaseEnum {
/** /**

View File

@ -14,16 +14,9 @@ import java.util.List;
* The type Common enum handler. * The type Common enum handler.
* *
* @param <E> the type parameter * @param <E> the type parameter
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public final class CommonEnumHandler<E extends BaseEnum> extends BaseTypeHandler<E> { public final class CommonEnumHandler<E extends BaseEnum> extends BaseTypeHandler<E> {
/**
* The Enum type.
*/
private final Class<E> enumType; private final Class<E> enumType;
/**
* The Enums.
*/
private final List<E> enums; private final List<E> enums;
/** /**
@ -60,28 +53,11 @@ public final class CommonEnumHandler<E extends BaseEnum> extends BaseTypeHandler
return null; return null;
} }
/**
* Sets non null parameter.
*
* @param preparedStatement the prepared statement
* @param i the
* @param e the e
* @param jdbcType the jdbc type
* @throws SQLException the sql exception
*/
@Override @Override
public void setNonNullParameter(PreparedStatement preparedStatement, int i, E e, JdbcType jdbcType) throws SQLException { public void setNonNullParameter(PreparedStatement preparedStatement, int i, E e, JdbcType jdbcType) throws SQLException {
preparedStatement.setInt(i, e.getValue()); preparedStatement.setInt(i, e.getValue());
} }
/**
* Gets nullable result.
*
* @param resultSet the result set
* @param s the s
* @return the nullable result
* @throws SQLException the sql exception
*/
@Override @Override
public E getNullableResult(ResultSet resultSet, String s) throws SQLException { public E getNullableResult(ResultSet resultSet, String s) throws SQLException {
if (resultSet.getObject(s) == null) { if (resultSet.getObject(s) == null) {
@ -92,14 +68,6 @@ public final class CommonEnumHandler<E extends BaseEnum> extends BaseTypeHandler
return locateEnumStatus(val); return locateEnumStatus(val);
} }
/**
* Gets nullable result.
*
* @param resultSet the result set
* @param index the index
* @return the nullable result
* @throws SQLException the sql exception
*/
@Override @Override
public E getNullableResult(ResultSet resultSet, int index) throws SQLException { public E getNullableResult(ResultSet resultSet, int index) throws SQLException {
if (resultSet.getObject(index) == null) { if (resultSet.getObject(index) == null) {
@ -110,14 +78,6 @@ public final class CommonEnumHandler<E extends BaseEnum> extends BaseTypeHandler
return locateEnumStatus(val); return locateEnumStatus(val);
} }
/**
* Gets nullable result.
*
* @param callableStatement the callable statement
* @param index the index
* @return the nullable result
* @throws SQLException the sql exception
*/
@Override @Override
public E getNullableResult(CallableStatement callableStatement, int index) throws SQLException { public E getNullableResult(CallableStatement callableStatement, int index) throws SQLException {
if (callableStatement.getObject(index) == null) { if (callableStatement.getObject(index) == null) {
@ -128,12 +88,6 @@ public final class CommonEnumHandler<E extends BaseEnum> extends BaseTypeHandler
return locateEnumStatus(val); return locateEnumStatus(val);
} }
/**
* Locate enum status e.
*
* @param index the index
* @return the e
*/
private E locateEnumStatus(int index) { private E locateEnumStatus(int index) {
for (E e : enums) { for (E e : enums) {
if (e.getValue() == index) { if (e.getValue() == index) {

View File

@ -1,11 +1,17 @@
package com.cmhi.gds.common; package com.cmhi.gds.common;
/**
* The type Const value.
*/
public class ConstValue { public class ConstValue {
/** /**
* The constant STRING_HTTP_AUTH_HEAD. * The constant STRING_HTTP_AUTH_HEAD.
*/ */
public static final String STRING_HTTP_AUTH_HEAD = "Bearer "; public static final String STRING_HTTP_AUTH_HEAD = "Bearer ";
/**
* The constant IP_ADDR_REG.
*/
public static final String IP_ADDR_REG = "^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}" + public static final String IP_ADDR_REG = "^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}" +
"(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^" + "(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^" +
"([\\da-fA-F]{1,4}:){6}((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^::" + "([\\da-fA-F]{1,4}:){6}((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^::" +
@ -19,6 +25,10 @@ public class ConstValue {
"4}){1,5}|:)$|^([\\da-fA-F]{1,4}:){2}((:[\\da-fA-F]{1,4}){1,4}|:)$|^([\\da-fA-F]{1,4}:){3}((:[\\da-fA-F]{1," + "4}){1,5}|:)$|^([\\da-fA-F]{1,4}:){2}((:[\\da-fA-F]{1,4}){1,4}|:)$|^([\\da-fA-F]{1,4}:){3}((:[\\da-fA-F]{1," +
"4}){1,3}|:)$|^([\\da-fA-F]{1,4}:){4}((:[\\da-fA-F]{1,4}){1,2}|:)$|^([\\da-fA-F]{1,4}:){5}:([\\da-fA-F]{1,4})" + "4}){1,3}|:)$|^([\\da-fA-F]{1,4}:){4}((:[\\da-fA-F]{1,4}){1,2}|:)$|^([\\da-fA-F]{1,4}:){5}:([\\da-fA-F]{1,4})" +
"?$|^([\\da-fA-F]{1,4}:){6}:$"; "?$|^([\\da-fA-F]{1,4}:){6}:$";
/**
* The type Protocol.
*/
public static class Protocol { public static class Protocol {
/** /**
* The constant VERSION. * The constant VERSION.

View File

@ -4,243 +4,229 @@ import javax.servlet.http.HttpServletResponse;
/** /**
* The enum Error code. * The enum Error code.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public enum ErrorCode implements BaseEnum { public enum ErrorCode implements BaseEnum {
/** /**
* The Err ok. * Err ok error code.
*/ */
ERR_OK(0, "成功"), ERR_OK(0, "成功"),
/** /**
* The Err password. * Err password error code.
*/ */
ERR_PASSWORD(1, "密码错误"), ERR_PASSWORD(1, "密码错误"),
/** /**
* The Err usernotfound. * Err usernotfound error code.
*/ */
ERR_USERNOTFOUND(2, "用户不存在"), ERR_USERNOTFOUND(2, "用户不存在"),
/** /**
* The Err passwordmore. * Err passwordmore error code.
*/ */
ERR_PASSWORDMORE(3, "连续密码错误达上限,再次输入错误将锁定用户"), ERR_PASSWORDMORE(3, "连续密码错误达上限,再次输入错误将锁定用户"),
/** /**
* The Err userlock. * Err userlock error code.
*/ */
ERR_USERLOCK(4, "密码错误达上限,用户被锁定"), ERR_USERLOCK(4, "密码错误达上限,用户被锁定"),
/** /**
* The Err account. * Err account error code.
*/ */
ERR_ACCOUNT(5, "用户账户异常"), ERR_ACCOUNT(5, "用户账户异常"),
/** /**
* The Err userexist. * Err userexist error code.
*/ */
ERR_USEREXIST(6, "该用户已经存在"), ERR_USEREXIST(6, "该用户已经存在"),
/** /**
* The Err passwordsimple. * Err passwordsimple error code.
*/ */
ERR_PASSWORDSIMPLE(7, "用户密码强度不符合要求"), ERR_PASSWORDSIMPLE(7, "用户密码强度不符合要求"),
/** /**
* The Err inputformat. * Err inputformat error code.
*/ */
ERR_INPUTFORMAT(8, "输入信息格式有误"), ERR_INPUTFORMAT(8, "输入信息格式有误"),
/** /**
* The Err inputmiss. * Err inputmiss error code.
*/ */
ERR_INPUTMISS(9, "缺少必要输入信息"), ERR_INPUTMISS(9, "缺少必要输入信息"),
/** /**
* The Err permission. * Err permission error code.
*/ */
ERR_PERMISSION(10, "操作员权限不足"), ERR_PERMISSION(10, "操作员权限不足"),
/** /**
* The Err reqtimeout. * Err reqtimeout error code.
*/ */
ERR_REQTIMEOUT(11, "请求超时"), ERR_REQTIMEOUT(11, "请求超时"),
/** /**
* The Err params. * Err params error code.
*/ */
ERR_PARAMS(12, "参数错误"), ERR_PARAMS(12, "参数错误"),
/** /**
* The Err systemexception. * Err systemexception error code.
*/ */
ERR_SYSTEMEXCEPTION(13, "系统异常"), ERR_SYSTEMEXCEPTION(13, "系统异常"),
/** /**
* The Err unknowncmd. * Err unknowncmd error code.
*/ */
ERR_UNKNOWNCMD(14, "未知命令"), ERR_UNKNOWNCMD(14, "未知命令"),
/** /**
* The Err logout. * Err logout error code.
*/ */
ERR_LOGOUT(15, "用户未登录"), ERR_LOGOUT(15, "用户未登录"),
/** /**
* The Err tokentimeout. * Err tokentimeout error code.
*/ */
ERR_TOKENTIMEOUT(16, "Token超时"), ERR_TOKENTIMEOUT(16, "Token超时"),
/** /**
* The Err tokennotfound. * Err tokennotfound error code.
*/ */
ERR_TOKENNOTFOUND(17, "非法Token"), ERR_TOKENNOTFOUND(17, "非法Token"),
/** /**
* The Err missauthhead. * Err missauthhead error code.
*/ */
ERR_MISSAUTHHEAD(18, "Http 请求缺少认证头部"), ERR_MISSAUTHHEAD(18, "Http 请求缺少认证头部"),
/** /**
* The Err nosuchdevice. * Err nosuchdevice error code.
*/ */
ERR_NOSUCHDEVICE(19, "没有这个设备"), ERR_NOSUCHDEVICE(19, "没有这个设备"),
/** /**
* The Err deviceexists. * Err deviceexists error code.
*/ */
ERR_DEVICEEXISTS(20, "设备已经存在"), ERR_DEVICEEXISTS(20, "设备已经存在"),
/** /**
* The Err paramexception. * Err paramexception error code.
*/ */
ERR_PARAMEXCEPTION(21, "参数异常"), ERR_PARAMEXCEPTION(21, "参数异常"),
/** /**
* The Err devicelocked. * Err devicelocked error code.
*/ */
ERR_DEVICELOCKED(22, "设备已锁定"), ERR_DEVICELOCKED(22, "设备已锁定"),
/** /**
* The Err version. * Err version error code.
*/ */
ERR_VERSION(23, "协议版本不兼容,请升级系统"), ERR_VERSION(23, "协议版本不兼容,请升级系统"),
/** /**
* The Err nosuchtype. * Err nosuchtype error code.
*/ */
ERR_NOSUCHTYPE(24, "没有这个类型的设备"), ERR_NOSUCHTYPE(24, "没有这个类型的设备"),
/** /**
* The Err removemore. * Err removemore error code.
*/ */
ERR_REMOVEMORE(25, "禁止同时删除多个设备"), ERR_REMOVEMORE(25, "禁止同时删除多个设备"),
/** /**
* The Err taskrunning. * Err taskrunning error code.
*/ */
ERR_TASKRUNNING(26, "同类任务正在运行"), ERR_TASKRUNNING(26, "同类任务正在运行"),
/** /**
* The Err unsupport. * Err unsupport error code.
*/ */
ERR_UNSUPPORT(27, "不支持的操作"), ERR_UNSUPPORT(27, "不支持的操作"),
/** /**
* The Err interrupt. * Err interrupt error code.
*/ */
ERR_INTERRUPT(28, "操作中断"), ERR_INTERRUPT(28, "操作中断"),
/** /**
* The Err calldevice. * Err calldevice error code.
*/ */
ERR_CALLDEVICE(29, "调用设备失败"), ERR_CALLDEVICE(29, "调用设备失败"),
/** /**
* The Err nosuchtask. * Err nosuchtask error code.
*/ */
ERR_NOSUCHTASK(30, "没有该任务"), ERR_NOSUCHTASK(30, "没有该任务"),
/** /**
* The Err tasknotrunning. * Err tasknotrunning error code.
*/ */
ERR_TASKNOTRUNNING(31, "该任务没有运行"), ERR_TASKNOTRUNNING(31, "该任务没有运行"),
/** /**
* The Err requesttimeout. * Err requesttimeout error code.
*/ */
ERR_REQUESTTIMEOUT(32, "请求超时"), ERR_REQUESTTIMEOUT(32, "请求超时"),
/** /**
* The Err unabledisposeip. * Err unabledisposeip error code.
*/ */
ERR_UNABLEDISPOSEIP(33, "无法处置该IP"), ERR_UNABLEDISPOSEIP(33, "无法处置该IP"),
/** /**
* The Err database. * Err database error code.
*/ */
ERR_DATABASE(34, "操作数据库失败"), ERR_DATABASE(34, "操作数据库失败"),
/** /**
* The Err untrusthost. * Err untrusthost error code.
*/ */
ERR_UNTRUSTHOST(35, "未经授权的客户端"), ERR_UNTRUSTHOST(35, "未经授权的客户端"),
/** /**
* The Err untrusttoken. * Err untrusttoken error code.
*/ */
ERR_UNTRUSTTOKEN(36, "未经授权的Token"), ERR_UNTRUSTTOKEN(36, "未经授权的Token"),
/** /**
* The Err unknowninterface. * Err unknowninterface error code.
*/ */
ERR_UNKNOWNINTERFACE(37, "未提供该接口"), ERR_UNKNOWNINTERFACE(37, "未提供该接口"),
/** /**
* The Err decrypt base 64. * Err decrypt base 64 error code.
*/ */
ERR_DECRYPT_BASE64(100, "BASE64解密失败"), ERR_DECRYPT_BASE64(100, "BASE64解密失败"),
/** /**
* The Err encrypt base 64. * Err encrypt base 64 error code.
*/ */
ERR_ENCRYPT_BASE64(101, "BASE64加密失败"), ERR_ENCRYPT_BASE64(101, "BASE64加密失败"),
/** /**
* The Err decrypt aes 128. * Err decrypt aes 128 error code.
*/ */
ERR_DECRYPT_AES128(102, "AES128解密失败"), ERR_DECRYPT_AES128(102, "AES128解密失败"),
/** /**
* The Err encrypt aes 128. * Err encrypt aes 128 error code.
*/ */
ERR_ENCRYPT_AES128(103, "AES128加密失败"), ERR_ENCRYPT_AES128(103, "AES128加密失败"),
/** /**
* The Err decrypt 3 des. * Err decrypt 3 des error code.
*/ */
ERR_DECRYPT_3DES(104, "3DES解密失败"), ERR_DECRYPT_3DES(104, "3DES解密失败"),
/** /**
* The Err encrypt 3 des. * Err encrypt 3 des error code.
*/ */
ERR_ENCRYPT_3DES(105, "3DES加密失败"), ERR_ENCRYPT_3DES(105, "3DES加密失败"),
/** /**
* The Err decrypt unknown. * Err decrypt unknown error code.
*/ */
ERR_DECRYPT_UNKNOWN(106, "不支持的解密算法"), ERR_DECRYPT_UNKNOWN(106, "不支持的解密算法"),
/** /**
* The Err encrypt unknown. * Err encrypt unknown error code.
*/ */
ERR_ENCRYPT_UNKNOWN(107, "不支持的加密算法"), ERR_ENCRYPT_UNKNOWN(107, "不支持的加密算法"),
/** /**
* The Err json encode. * Err json encode error code.
*/ */
ERR_JSON_ENCODE(108, "Json 序列号错误"), ERR_JSON_ENCODE(108, "Json 序列号错误"),
/** /**
* The Err json decode. * Err json decode error code.
*/ */
ERR_JSON_DECODE(109, "Json 反序列化错误"), ERR_JSON_DECODE(109, "Json 反序列化错误"),
/** /**
* The Err encrypt aes 256. * Err encrypt aes 256 error code.
*/ */
ERR_ENCRYPT_AES256(110, "AES256加密失败"), ERR_ENCRYPT_AES256(110, "AES256加密失败"),
/** /**
* The Err decrypt aes 256. * Err decrypt aes 256 error code.
*/ */
ERR_DECRYPT_AES256(111, "AES256解密失败"), ERR_DECRYPT_AES256(111, "AES256解密失败"),
/** /**
* The Err nodevice areacode. * Err nosuch game error code.
*/ */
ERR_NOSUCH_GAME(112, "该游戏不存在"), ERR_NOSUCH_GAME(112, "该游戏不存在"),
/** /**
* The Err specifiedip exists. * Err specifiedip exists error code.
*/ */
ERR_SPECIFIEDIP_EXISTS(113, "指定的IP已经存在"), ERR_SPECIFIEDIP_EXISTS(113, "指定的IP已经存在"),
/** /**
* The Err specifiedip notexists. * Err specifiedip notexists error code.
*/ */
ERR_SPECIFIEDIP_NOTEXISTS(114, "指定的IP地址不存在"), ERR_SPECIFIEDIP_NOTEXISTS(114, "指定的IP地址不存在"),
/** /**
* The Err server processreq. * Err server processreq error code.
*/ */
ERR_SERVER_PROCESSREQ(115, "服务器处理请求错误"), ERR_SERVER_PROCESSREQ(115, "服务器处理请求错误"),
; ;
/**
* The Errno.
*/
private final int errno; private final int errno;
/**
* The Err msg.
*/
private final String errMsg; private final String errMsg;
/**
* Instantiates a new Error code.
*
* @param err the err
* @param msg the msg
*/
ErrorCode(int err, String msg) { ErrorCode(int err, String msg) {
this.errno = err; this.errno = err;
this.errMsg = msg; this.errMsg = msg;
@ -298,21 +284,11 @@ public enum ErrorCode implements BaseEnum {
} }
/**
* Gets value.
*
* @return the value
*/
@Override @Override
public Integer getValue() { public Integer getValue() {
return this.errno; return this.errno;
} }
/**
* Gets description.
*
* @return the description
*/
@Override @Override
public String getDescription() { public String getDescription() {
return this.errMsg; return this.errMsg;

View File

@ -1,11 +1,20 @@
package com.cmhi.gds.common; package com.cmhi.gds.common;
/**
* The type Global configure.
*/
public class GlobalConfigure { public class GlobalConfigure {
private GlobalConfigure() { private GlobalConfigure() {
throw new AssertionError("Instantiating utility class."); throw new AssertionError("Instantiating utility class.");
} }
/**
* The constant CHECK_PROTO_REQUEST_TIMEOUT.
*/
public static volatile boolean CHECK_PROTO_REQUEST_TIMEOUT = false; public static volatile boolean CHECK_PROTO_REQUEST_TIMEOUT = false;
/**
* The constant REQUEST_TIMEOUT_MS.
*/
public static volatile long REQUEST_TIMEOUT_MS = 5 * 1000; public static volatile long REQUEST_TIMEOUT_MS = 5 * 1000;
} }

View File

@ -2,24 +2,22 @@ package com.cmhi.gds.common;
/** /**
* The enum Proto crypto type. * The enum Proto crypto type.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public enum ProtoCryptoType { public enum ProtoCryptoType {
/** /**
* The Crypto none. * Crypto none proto crypto type.
*/ */
CRYPTO_NONE(0, "不加密"), CRYPTO_NONE(0, "不加密"),
/** /**
* The Crypto base 64. * Crypto base 64 proto crypto type.
*/ */
CRYPTO_BASE64(1, "Base64编码"), CRYPTO_BASE64(1, "Base64编码"),
/** /**
* The Crypto aes 128. * Crypto aes 128 proto crypto type.
*/ */
CRYPTO_AES128(2, "AES128加密"), CRYPTO_AES128(2, "AES128加密"),
/** /**
* The Crypto des. * Crypto des proto crypto type.
*/ */
CRYPTO_DES(3, "DES对称加密"), CRYPTO_DES(3, "DES对称加密"),
/** /**
@ -28,21 +26,9 @@ public enum ProtoCryptoType {
CRYPTO_AES256(4, "AES256加密"), CRYPTO_AES256(4, "AES256加密"),
; ;
/**
* The Code.
*/
private final int code; private final int code;
/**
* The Readme.
*/
private final String readme; private final String readme;
/**
* Instantiates a new Proto crypto type.
*
* @param code the code
* @param readme the readme
*/
ProtoCryptoType(int code, String readme) { ProtoCryptoType(int code, String readme) {
this.code = code; this.code = code;
this.readme = readme; this.readme = readme;

View File

@ -2,14 +2,9 @@ package com.cmhi.gds.common;
/** /**
* The type Security config value. * The type Security config value.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public class SecurityConfigValue { public class SecurityConfigValue {
/**
* Instantiates a new Security config value.
*/
private SecurityConfigValue() { private SecurityConfigValue() {
throw new AssertionError("Instantiating utility class."); throw new AssertionError("Instantiating utility class.");
} }

View File

@ -1,59 +1,35 @@
package com.cmhi.gds.common; package com.cmhi.gds.common;
/** /**
* The enum Dispose device type. * The enum Transport protocol type.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public enum TransportProtocolType implements BaseEnum { public enum TransportProtocolType implements BaseEnum {
/** /**
* The Dptech umc. * Tcp protocol transport protocol type.
*/ */
TCP_PROTOCOL(0, "TCP"), TCP_PROTOCOL(0, "TCP"),
/** /**
* The Haohan platform. * Udp protocol transport protocol type.
*/ */
UDP_PROTOCOL(1, "UDP"), UDP_PROTOCOL(1, "UDP"),
/** /**
* The Pengxin platform. * Unknown protocol transport protocol type.
*/ */
UNKNOWN_PROTOCOL(2, "UNKNOWN"); UNKNOWN_PROTOCOL(2, "UNKNOWN");
/**
* The Code.
*/
private final int code; private final int code;
/**
* The Readme.
*/
private final String readme; private final String readme;
/**
* Instantiates a new Dispose device type.
*
* @param code the code
* @param readme the readme
*/
TransportProtocolType(int code, String readme) { TransportProtocolType(int code, String readme) {
this.code = code; this.code = code;
this.readme = readme; this.readme = readme;
} }
/**
* Gets value.
*
* @return the value
*/
@Override @Override
public Integer getValue() { public Integer getValue() {
return this.code; return this.code;
} }
/**
* Gets description.
*
* @return the description
*/
@Override @Override
public String getDescription() { public String getDescription() {
return this.readme; return this.readme;

View File

@ -15,8 +15,6 @@ import java.util.Map;
/** /**
* The type Error controller. * The type Error controller.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Controller @Controller
public class ErrorController extends BasicErrorController { public class ErrorController extends BasicErrorController {
@ -29,12 +27,6 @@ public class ErrorController extends BasicErrorController {
super(new DefaultErrorAttributes(), serverProperties.getError()); super(new DefaultErrorAttributes(), serverProperties.getError());
} }
/**
* Error response entity.
*
* @param request the request
* @return the response entity
*/
@Override @Override
public ResponseEntity<Map<String, Object>> error(HttpServletRequest request) { public ResponseEntity<Map<String, Object>> error(HttpServletRequest request) {
HttpStatus status = getStatus(request); HttpStatus status = getStatus(request);

View File

@ -37,6 +37,9 @@ import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/**
* The type Game database info controller.
*/
@Controller @Controller
@RequestMapping(value = "/gameinfo") @RequestMapping(value = "/gameinfo")
@Slf4j @Slf4j
@ -49,6 +52,11 @@ public class GameDatabaseInfoController {
@Resource @Resource
private GameDatabaseServiceService gameDatabaseServiceService; private GameDatabaseServiceService gameDatabaseServiceService;
/**
* Gets game list summary.
*
* @return the game list summary
*/
@GetMapping("gamelistsummary") @GetMapping("gamelistsummary")
@ResponseBody @ResponseBody
public ProtocolRespDTO<GetGamesSummaryRsp> getGameListSummary() { public ProtocolRespDTO<GetGamesSummaryRsp> getGameListSummary() {
@ -84,12 +92,23 @@ public class GameDatabaseInfoController {
return ProtocolRespDTO.result(ErrorCode.ERR_OK, rspInfo); return ProtocolRespDTO.result(ErrorCode.ERR_OK, rspInfo);
} }
/**
* Gets game list summary 2.
*
* @return the game list summary 2
*/
@PostMapping("gamelistsummary2") @PostMapping("gamelistsummary2")
@ResponseBody @ResponseBody
public ProtocolRespDTO<GetGamesSummaryRsp> getGameListSummary2(@RequestBody ProtocolReqDTO<Object> mr) { public ProtocolRespDTO<GetGamesSummaryRsp> getGameListSummary2() {
return getGameListSummary(); return getGameListSummary();
} }
/**
* Gets game info details.
*
* @param mr the mr
* @return the game info details
*/
@PostMapping("gamelistDetails") @PostMapping("gamelistDetails")
@ResponseBody @ResponseBody
public ProtocolRespDTO<GetGamesInfoRsp> getGameInfoDetails(@Validated(ValidGroups.AddGameServiceValid.class) public ProtocolRespDTO<GetGamesInfoRsp> getGameInfoDetails(@Validated(ValidGroups.AddGameServiceValid.class)
@ -150,6 +169,12 @@ public class GameDatabaseInfoController {
return ProtocolRespDTO.result(ErrorCode.ERR_OK, rspInfo); return ProtocolRespDTO.result(ErrorCode.ERR_OK, rspInfo);
} }
/**
* Report game service data protocol resp dto.
*
* @param mr the mr
* @return the protocol resp dto
*/
@PostMapping("/gamedata") @PostMapping("/gamedata")
@ResponseBody @ResponseBody
public ProtocolRespDTO<GameServerRsp> reportGameServiceData( public ProtocolRespDTO<GameServerRsp> reportGameServiceData(

View File

@ -6,19 +6,14 @@ import lombok.Setter;
/** /**
* The type Controller not support exception. * The type Controller not support exception.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Getter @Getter
@Setter @Setter
public class ControllerNotSupportException extends RuntimeException { public class ControllerNotSupportException extends RuntimeException {
/**
* The Err.
*/
private ErrorCode err; private ErrorCode err;
/** /**
* Instantiates a new Security protocol exception. * Instantiates a new Controller not support exception.
* *
* @param err the err * @param err the err
*/ */

View File

@ -6,20 +6,12 @@ import lombok.Setter;
/** /**
* The type Controller request timeout exception. * The type Controller request timeout exception.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Getter @Getter
@Setter @Setter
public class ControllerRequestTimeoutException extends RuntimeException { public class ControllerRequestTimeoutException extends RuntimeException {
/**
* The Err.
*/
private ErrorCode err; private ErrorCode err;
/**
* The Message.
*/
private String message; private String message;
/** /**

View File

@ -20,8 +20,6 @@ import java.util.concurrent.atomic.AtomicInteger;
/** /**
* The type Global exception handler. * The type Global exception handler.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@ControllerAdvice @ControllerAdvice
@Slf4j @Slf4j

View File

@ -5,22 +5,17 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
/** /**
* The type Security exception. * The type Security protocol exception.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Getter @Getter
@Setter @Setter
public class SecurityProtocolException extends RuntimeException { public class SecurityProtocolException extends RuntimeException {
/**
* The Err.
*/
private ErrorCode err; private ErrorCode err;
private String description; private String description;
/** /**
* Instantiates a new Security exception. * Instantiates a new Security protocol exception.
* *
* @param err the err * @param err the err
*/ */
@ -30,6 +25,12 @@ public class SecurityProtocolException extends RuntimeException {
this.description = null; this.description = null;
} }
/**
* Instantiates a new Security protocol exception.
*
* @param err the err
* @param readme the readme
*/
public SecurityProtocolException(ErrorCode err, String readme) { public SecurityProtocolException(ErrorCode err, String readme) {
super(); super();
this.err = err; this.err = err;

View File

@ -16,13 +16,8 @@ import java.nio.charset.Charset;
/** /**
* The type Request body cache wrapper. * The type Request body cache wrapper.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public class RequestBodyCacheWrapper extends HttpServletRequestWrapper { public class RequestBodyCacheWrapper extends HttpServletRequestWrapper {
/**
* The Body.
*/
private final byte[] body; private final byte[] body;
/** /**
@ -62,21 +57,11 @@ public class RequestBodyCacheWrapper extends HttpServletRequestWrapper {
return Helper.inputStream2String(inputStream); return Helper.inputStream2String(inputStream);
} }
/**
* Gets reader.
*
* @return the reader
*/
@Override @Override
public BufferedReader getReader() { public BufferedReader getReader() {
return new BufferedReader(new InputStreamReader(getInputStream())); return new BufferedReader(new InputStreamReader(getInputStream()));
} }
/**
* Gets input stream.
*
* @return the input stream
*/
@Override @Override
public ServletInputStream getInputStream() { public ServletInputStream getInputStream() {

View File

@ -13,37 +13,17 @@ import java.io.IOException;
/** /**
* The type Request body filter. * The type Request body filter.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@WebFilter(filterName = "RequestBodyFilter", urlPatterns = "/*") @WebFilter(filterName = "RequestBodyFilter", urlPatterns = "/*")
public class RequestBodyFilter implements Filter { public class RequestBodyFilter implements Filter {
/**
* Init.
*
* @param filterConfig the filter config
*/
@Override @Override
public void init(FilterConfig filterConfig) { public void init(FilterConfig filterConfig) {
} }
/**
* Destroy.
*/
@Override @Override
public void destroy() { public void destroy() {
} }
/**
* Do filter.
*
* @param request the request
* @param response the response
* @param filterChain the filter chain
* @throws IOException the io exception
* @throws ServletException the servlet exception
*/
@Override @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
ServletRequest requestWrapper = new RequestBodyCacheWrapper((HttpServletRequest) request); ServletRequest requestWrapper = new RequestBodyCacheWrapper((HttpServletRequest) request);

View File

@ -16,27 +16,14 @@ import java.lang.reflect.Type;
/** /**
* The type Request protocol security. * The type Request protocol security.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Slf4j @Slf4j
@RestControllerAdvice @RestControllerAdvice
public class RequestProtocolSecurity implements RequestBodyAdvice { public class RequestProtocolSecurity implements RequestBodyAdvice {
/**
* The Protocol security service.
*/
@Resource @Resource
private ProtocolSecurityService protocolSecurityService; private ProtocolSecurityService protocolSecurityService;
/**
* Supports boolean.
*
* @param methodParameter the method parameter
* @param type the type
* @param aClass the a class
* @return the boolean
*/
@Override @Override
public boolean supports(@NotNull MethodParameter methodParameter, public boolean supports(@NotNull MethodParameter methodParameter,
@NotNull Type type, @NotNull Type type,
@ -45,15 +32,6 @@ public class RequestProtocolSecurity implements RequestBodyAdvice {
|| methodParameter.hasMethodAnnotation(Decryption.class); || methodParameter.hasMethodAnnotation(Decryption.class);
} }
/**
* Before body read http input message.
*
* @param httpInputMessage the http input message
* @param methodParameter the method parameter
* @param type the type
* @param aClass the a class
* @return the http input message
*/
@Override @Override
@NotNull @NotNull
public HttpInputMessage beforeBodyRead(@NotNull HttpInputMessage httpInputMessage, public HttpInputMessage beforeBodyRead(@NotNull HttpInputMessage httpInputMessage,
@ -63,16 +41,6 @@ public class RequestProtocolSecurity implements RequestBodyAdvice {
return protocolSecurityService.decryptProtocol(httpInputMessage); return protocolSecurityService.decryptProtocol(httpInputMessage);
} }
/**
* Handle empty body object.
*
* @param o the o
* @param httpInputMessage the http input message
* @param methodParameter the method parameter
* @param type the type
* @param aClass the a class
* @return the object
*/
@Override @Override
public Object handleEmptyBody(Object o, public Object handleEmptyBody(Object o,
@NotNull HttpInputMessage httpInputMessage, @NotNull HttpInputMessage httpInputMessage,
@ -82,16 +50,6 @@ public class RequestProtocolSecurity implements RequestBodyAdvice {
return o; return o;
} }
/**
* After body read object.
*
* @param o the o
* @param httpInputMessage the http input message
* @param methodParameter the method parameter
* @param type the type
* @param aClass the a class
* @return the object
*/
@Override @Override
@NotNull @NotNull
public Object afterBodyRead(@NotNull Object o, public Object afterBodyRead(@NotNull Object o,

View File

@ -19,26 +19,14 @@ import javax.annotation.Resource;
/** /**
* The type Response protocol security. * The type Response protocol security.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Slf4j @Slf4j
@RestControllerAdvice @RestControllerAdvice
public class ResponseProtocolSecurity implements ResponseBodyAdvice<Object> { public class ResponseProtocolSecurity implements ResponseBodyAdvice<Object> {
/**
* The Protocol security service.
*/
@Resource @Resource
private ProtocolSecurityService protocolSecurityService; private ProtocolSecurityService protocolSecurityService;
/**
* Supports boolean.
*
* @param methodParameter the method parameter
* @param aClass the a class
* @return the boolean
*/
@Override @Override
public boolean supports(@NotNull MethodParameter methodParameter, public boolean supports(@NotNull MethodParameter methodParameter,
@NotNull Class<? extends HttpMessageConverter<?>> aClass) { @NotNull Class<? extends HttpMessageConverter<?>> aClass) {
@ -47,17 +35,6 @@ public class ResponseProtocolSecurity implements ResponseBodyAdvice<Object> {
|| methodParameter.hasMethodAnnotation(Encryption.class); || methodParameter.hasMethodAnnotation(Encryption.class);
} }
/**
* Before body write object.
*
* @param o the o
* @param methodParameter the method parameter
* @param mediaType the media type
* @param aClass the a class
* @param serverHttpRequest the server http request
* @param serverHttpResponse the server http response
* @return the object
*/
@Override @Override
@NotNull @NotNull
public Object beforeBodyWrite(Object o, public Object beforeBodyWrite(Object o,

View File

@ -6,12 +6,38 @@ import com.cmhi.gds.pojo.vo.GameTableSummary;
import java.util.List; import java.util.List;
/**
* The interface Game database service manager.
*/
public interface GameDatabaseServiceManager { public interface GameDatabaseServiceManager {
/**
* Gets game table summary.
*
* @return the game table summary
*/
List<GameTableSummary> getGameTableSummary(); List<GameTableSummary> getGameTableSummary();
/**
* Gets game table details.
*
* @param gameId the game id
* @return the game table details
*/
List<GameTableItemsDetail> getGameTableDetails(List<Long> gameId); List<GameTableItemsDetail> getGameTableDetails(List<Long> gameId);
/**
* Gets game server info by game info id.
*
* @param gameInfoId the game info id
* @return the game server info by game info id
*/
List<GameServer> getGameServerInfoByGameInfoId(List<Long> gameInfoId); List<GameServer> getGameServerInfoByGameInfoId(List<Long> gameInfoId);
/**
* Add game server info int.
*
* @param gsList the gs list
* @return the int
*/
int addGameServerInfo(List<GameServer> gsList); int addGameServerInfo(List<GameServer> gsList);
} }

View File

@ -13,6 +13,9 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
/**
* The type Game database service manager.
*/
@Component @Component
@Slf4j @Slf4j
public class GameDatabaseServiceManagerImpl implements GameDatabaseServiceManager { public class GameDatabaseServiceManagerImpl implements GameDatabaseServiceManager {

View File

@ -4,6 +4,14 @@ import com.cmhi.gds.pojo.entry.GameInfo;
import java.util.List; import java.util.List;
/**
* The interface Game info mapper.
*/
public interface GameInfoMapper { public interface GameInfoMapper {
/**
* Select all list.
*
* @return the list
*/
List<GameInfo> selectAll(); List<GameInfo> selectAll();
} }

View File

@ -5,10 +5,30 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/**
* The interface Game server mapper.
*/
public interface GameServerMapper { public interface GameServerMapper {
/**
* Select all list.
*
* @return the list
*/
List<GameServer> selectAll(); List<GameServer> selectAll();
/**
* Select all by game info id list.
*
* @param idList the id list
* @return the list
*/
List<GameServer> selectAllByGameInfoId(@Param("idList") List<Long> idList); List<GameServer> selectAllByGameInfoId(@Param("idList") List<Long> idList);
/**
* Add game server info list int.
*
* @param gameSvrInfo the game svr info
* @return the int
*/
int addGameServerInfoList(@Param("gameSvrInfo") List<GameServer> gameSvrInfo); int addGameServerInfoList(@Param("gameSvrInfo") List<GameServer> gameSvrInfo);
} }

View File

@ -7,10 +7,29 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/**
* The interface Game table mapper.
*/
public interface GameTableMapper { public interface GameTableMapper {
/**
* Select all list.
*
* @return the list
*/
List<GameTable> selectAll(); List<GameTable> selectAll();
/**
* Select all game summary list.
*
* @return the list
*/
List<GameTableSummary> selectAllGameSummary(); List<GameTableSummary> selectAllGameSummary();
/**
* Select all game detail by id list.
*
* @param idList the id list
* @return the list
*/
List<GameTableItemsDetail> selectAllGameDetailById(@Param("idList") List<Long> idList); List<GameTableItemsDetail> selectAllGameDetailById(@Param("idList") List<Long> idList);
} }

View File

@ -18,15 +18,10 @@ import java.time.format.DateTimeFormatter;
/** /**
* The type Helper. * The type Helper.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Slf4j @Slf4j
public class Helper { public class Helper {
/**
* Instantiates a new Helper.
*/
private Helper() { private Helper() {
throw new AssertionError("Instantiating utility class."); throw new AssertionError("Instantiating utility class.");
} }
@ -109,6 +104,12 @@ public class Helper {
return sb.toString(); return sb.toString();
} }
/**
* Ip address is hostname boolean.
*
* @param hostStr the host str
* @return the boolean
*/
public static Boolean ipAddressIsHostname(String hostStr) { public static Boolean ipAddressIsHostname(String hostStr) {
HostName host = new HostName(hostStr); HostName host = new HostName(hostStr);
try { try {
@ -119,6 +120,12 @@ public class Helper {
} }
} }
/**
* Ip address is ipv 6 boolean.
*
* @param ipAddr the ip addr
* @return the boolean
*/
public static boolean ipAddressIsIpv6(String ipAddr) { public static boolean ipAddressIsIpv6(String ipAddr) {
IPAddress loopback = new IPAddressString(ipAddr).getAddress(); IPAddress loopback = new IPAddressString(ipAddr).getAddress();
@ -129,6 +136,13 @@ public class Helper {
} }
} }
/**
* Is ip address equal boolean.
*
* @param ip1 the ip 1
* @param ip2 the ip 2
* @return the boolean
*/
public static boolean isIpAddressEqual(String ip1, String ip2) { public static boolean isIpAddressEqual(String ip1, String ip2) {
if (ipAddressIsHostname(ip1) == null || ipAddressIsHostname(ip1) == null) { if (ipAddressIsHostname(ip1) == null || ipAddressIsHostname(ip1) == null) {
return false; return false;
@ -152,6 +166,12 @@ public class Helper {
} }
} }
/**
* Ip address to big integer big integer.
*
* @param ipAddr the ip addr
* @return the big integer
*/
public static BigInteger ipAddressToBigInteger(String ipAddr) { public static BigInteger ipAddressToBigInteger(String ipAddr) {
IPAddress loopback = new IPAddressString(ipAddr).getAddress(); IPAddress loopback = new IPAddressString(ipAddr).getAddress();

View File

@ -9,8 +9,6 @@ import lombok.NoArgsConstructor;
/** /**
* The type Base id resp. * The type Base id resp.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@ -19,17 +17,8 @@ import lombok.NoArgsConstructor;
@JsonPropertyOrder({"id", "devId", "taskId", "status", "message"}) @JsonPropertyOrder({"id", "devId", "taskId", "status", "message"})
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class BaseIdResp extends BaseRespStatus { public class BaseIdResp extends BaseRespStatus {
/**
* The Id.
*/
private String id; private String id;
/**
* The Dev id.
*/
private String devId; private String devId;
/**
* The Task id.
*/
private String taskId; private String taskId;
} }

View File

@ -14,40 +14,27 @@ import javax.validation.constraints.NotNull;
* The type Base protocol dto. * The type Base protocol dto.
* *
* @param <T> the type parameter * @param <T> the type parameter
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@JsonPropertyOrder({"ver", "cryptoType", "timeStamp", "msgContent"}) @JsonPropertyOrder({"ver", "cryptoType", "timeStamp", "msgContent"})
public class BaseProtocolDTO<T> { public class BaseProtocolDTO<T> {
/**
* 当前协议版本号
*/
@NotNull(message = "ver 字段不能为空", groups = ValidGroups.ProtocolCommonValid.class) @NotNull(message = "ver 字段不能为空", groups = ValidGroups.ProtocolCommonValid.class)
@Range(min = 1, max = 9999, message = "ver 字段最小值为 1", groups = ValidGroups.ProtocolCommonValid.class) @Range(min = 1, max = 9999, message = "ver 字段最小值为 1", groups = ValidGroups.ProtocolCommonValid.class)
private Integer ver; private Integer ver;
/**
* msgContent字段内容编码格式
*/
@NotNull(message = "cryptoType 字段不能为空", groups = ValidGroups.ProtocolCommonValid.class) @NotNull(message = "cryptoType 字段不能为空", groups = ValidGroups.ProtocolCommonValid.class)
@Range(min = 0, max = 4, @Range(min = 0, max = 4,
message = "cryptoType 字段取值为 [0, 4]" message = "cryptoType 字段取值为 [0, 4]"
, groups = ValidGroups.ProtocolCommonValid.class) , groups = ValidGroups.ProtocolCommonValid.class)
private Integer cryptoType; private Integer cryptoType;
/**
* 当前UTC时间戳(ms)
*/
@NotNull(message = "timeStamp 字段不能为空", groups = ValidGroups.ProtocolCommonValid.class) @NotNull(message = "timeStamp 字段不能为空", groups = ValidGroups.ProtocolCommonValid.class)
@DecimalMin(value = "1595494343000", @DecimalMin(value = "1595494343000",
message = "timeStamp 字段值不能为过去时间" message = "timeStamp 字段值不能为过去时间"
, groups = ValidGroups.ProtocolCommonValid.class) , groups = ValidGroups.ProtocolCommonValid.class)
private Long timeStamp; private Long timeStamp;
/**
* 协议详细内容
*/
@Valid @Valid
private T msgContent; private T msgContent;
} }

View File

@ -5,21 +5,13 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/** /**
* The type Response status. * The type Base resp status.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class BaseRespStatus { public class BaseRespStatus {
/**
* 0成功其它失败原因.
*/
private Integer status; private Integer status;
/**
* 登录消息: status状态码对应的提示信息
*/
private String[] message; private String[] message;
} }

View File

@ -12,7 +12,6 @@ import java.util.Objects;
* The type Protocol req dto. * The type Protocol req dto.
* *
* @param <T> the type parameter * @param <T> the type parameter
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@NoArgsConstructor @NoArgsConstructor
@ToString @ToString

View File

@ -16,7 +16,6 @@ import lombok.extern.slf4j.Slf4j;
* The type Protocol resp dto. * The type Protocol resp dto.
* *
* @param <T> the type parameter * @param <T> the type parameter
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Slf4j @Slf4j
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ -25,25 +24,10 @@ import lombok.extern.slf4j.Slf4j;
@AllArgsConstructor @AllArgsConstructor
@JsonPropertyOrder({"ver", "cryptoType", "timeStamp", "code", "msgContent"}) @JsonPropertyOrder({"ver", "cryptoType", "timeStamp", "code", "msgContent"})
public class ProtocolRespDTO<T> extends BaseProtocolDTO<T> { public class ProtocolRespDTO<T> extends BaseProtocolDTO<T> {
/**
* The constant OBJECT_MAPPER.
*/
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
/**
* The Code.
*/
private Integer code; private Integer code;
/**
* Result protocol resp dto.
*
* @param <T> the type parameter
* @param err the err
* @param httpCode the http code
* @param respMsg the resp msg
* @return the protocol resp dto
*/
private static <T> ProtocolRespDTO<T> result(ErrorCode err, Integer httpCode, T respMsg) { private static <T> ProtocolRespDTO<T> result(ErrorCode err, Integer httpCode, T respMsg) {
ProtocolRespDTO<T> resp = new ProtocolRespDTO<>(); ProtocolRespDTO<T> resp = new ProtocolRespDTO<>();

View File

@ -11,6 +11,9 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/**
* The type Game info content.
*/
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@Builder @Builder
@ -19,6 +22,9 @@ import java.util.List;
@JsonPropertyOrder({"gameId", "name", "company", "gamesInfo", "status", "message"}) @JsonPropertyOrder({"gameId", "name", "company", "gamesInfo", "status", "message"})
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class GameInfoContent extends BaseRespStatus { public class GameInfoContent extends BaseRespStatus {
/**
* The Games info.
*/
List<GameInfoDetail> gamesInfo; List<GameInfoDetail> gamesInfo;
private Long gameId; private Long gameId;
private String name; private String name;

View File

@ -7,6 +7,9 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/**
* The type Game info detail.
*/
@Data @Data
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor

View File

@ -8,12 +8,18 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/**
* The type Game list summary.
*/
@Data @Data
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@JsonPropertyOrder({"gameId", "gamesFilename"}) @JsonPropertyOrder({"gameId", "gamesFilename"})
public class GameListSummary { public class GameListSummary {
/**
* The Games filename.
*/
List<String> gamesFilename; List<String> gamesFilename;
private Long gameId; private Long gameId;
} }

View File

@ -14,6 +14,9 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.util.List; import java.util.List;
/**
* The type Game server content.
*/
@Data @Data
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor

View File

@ -15,6 +15,9 @@ import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/**
* The type Game server detail.
*/
@Data @Data
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor

View File

@ -9,6 +9,9 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/**
* The type Game server ret.
*/
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@Builder @Builder

View File

@ -11,6 +11,9 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/**
* The type Game server rsp.
*/
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@Builder @Builder
@ -19,5 +22,8 @@ import java.util.List;
@JsonPropertyOrder({"items", "status", "message"}) @JsonPropertyOrder({"items", "status", "message"})
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class GameServerRsp extends BaseRespStatus { public class GameServerRsp extends BaseRespStatus {
/**
* The Items.
*/
List<GameServerRet> items; List<GameServerRet> items;
} }

View File

@ -11,6 +11,9 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.util.List; import java.util.List;
/**
* The type Get game info detail req.
*/
@Data @Data
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor

View File

@ -11,6 +11,9 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/**
* The type Get games info rsp.
*/
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@Builder @Builder
@ -19,5 +22,8 @@ import java.util.List;
@JsonPropertyOrder({"items", "status", "message"}) @JsonPropertyOrder({"items", "status", "message"})
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class GetGamesInfoRsp extends BaseRespStatus { public class GetGamesInfoRsp extends BaseRespStatus {
/**
* The Items.
*/
List<GameInfoContent> items; List<GameInfoContent> items;
} }

View File

@ -11,6 +11,9 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/**
* The type Get games summary rsp.
*/
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@Builder @Builder
@ -19,5 +22,8 @@ import java.util.List;
@JsonPropertyOrder({"items", "status", "message"}) @JsonPropertyOrder({"items", "status", "message"})
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class GetGamesSummaryRsp extends BaseRespStatus { public class GetGamesSummaryRsp extends BaseRespStatus {
/**
* The Items.
*/
List<GameListSummary> items; List<GameListSummary> items;
} }

View File

@ -11,6 +11,9 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.util.List; import java.util.List;
/**
* The type Report game server req.
*/
@Data @Data
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor

View File

@ -14,6 +14,9 @@ import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.io.Serializable; import java.io.Serializable;
/**
* The type Game info.
*/
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -23,14 +26,8 @@ import java.io.Serializable;
@Table(name = "game_info") @Table(name = "game_info")
@NameStyle(Style.normal) @NameStyle(Style.normal)
public class GameInfo implements Serializable { public class GameInfo implements Serializable {
/**
* The constant serialVersionUID.
*/
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* The Id.
*/
@Id @Id
@KeySql(useGeneratedKeys = true) @KeySql(useGeneratedKeys = true)
private Long id; private Long id;

View File

@ -15,6 +15,9 @@ import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.io.Serializable; import java.io.Serializable;
/**
* The type Game server.
*/
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -24,15 +27,9 @@ import java.io.Serializable;
@Table(name = "game_server") @Table(name = "game_server")
@NameStyle(Style.normal) @NameStyle(Style.normal)
public class GameServer implements Serializable { public class GameServer implements Serializable {
/**
* The constant serialVersionUID.
*/
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* The Id.
*/
@Id @Id
@KeySql(useGeneratedKeys = true) @KeySql(useGeneratedKeys = true)
private Long id; private Long id;

View File

@ -14,6 +14,9 @@ import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.io.Serializable; import java.io.Serializable;
/**
* The type Game table.
*/
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -23,14 +26,8 @@ import java.io.Serializable;
@Table(name = "game_tables") @Table(name = "game_tables")
@NameStyle(Style.normal) @NameStyle(Style.normal)
public class GameTable implements Serializable { public class GameTable implements Serializable {
/**
* The constant serialVersionUID.
*/
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* The Id.
*/
@Id @Id
@KeySql(useGeneratedKeys = true) @KeySql(useGeneratedKeys = true)
private Long id; private Long id;

View File

@ -6,6 +6,9 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/**
* The type Game detail.
*/
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor

View File

@ -5,6 +5,9 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/**
* The type Game summary.
*/
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor

View File

@ -8,12 +8,18 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/**
* The type Game table items detail.
*/
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Builder @Builder
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class GameTableItemsDetail { public class GameTableItemsDetail {
/**
* The Game details.
*/
List<GameDetail> gameDetails; List<GameDetail> gameDetails;
private Long gameId; private Long gameId;

View File

@ -8,6 +8,9 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/**
* The type Game table items summary.
*/
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor

View File

@ -8,6 +8,9 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/**
* The type Game table summary.
*/
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor

View File

@ -7,8 +7,6 @@ import java.lang.annotation.Target;
/** /**
* The interface Decryption. * The interface Decryption.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Target({ElementType.TYPE, ElementType.METHOD}) @Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

View File

@ -7,8 +7,6 @@ import java.lang.annotation.Target;
/** /**
* The interface Encryption. * The interface Encryption.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Target({ElementType.TYPE, ElementType.METHOD}) @Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

View File

@ -17,27 +17,16 @@ import java.security.SecureRandom;
/** /**
* The type Crypto helper. * The type Crypto helper.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Slf4j @Slf4j
public class CryptoHelper { public class CryptoHelper {
/**
* Instantiates a new Crypto helper.
*/
private CryptoHelper() { private CryptoHelper() {
throw new AssertionError("Instantiating utility class."); throw new AssertionError("Instantiating utility class.");
} }
/**
* The constant AES_ALGORITHM_STR.
*/
private static final String AES_ALGORITHM_STR = "AES/ECB/PKCS5Padding"; private static final String AES_ALGORITHM_STR = "AES/ECB/PKCS5Padding";
/**
* The constant DES_ALGORITHM_STR.
*/
private static final String DES_ALGORITHM_STR = "DES/ECB/PKCS5Padding"; private static final String DES_ALGORITHM_STR = "DES/ECB/PKCS5Padding";
/** /**

View File

@ -14,14 +14,9 @@ import org.apache.commons.lang.StringUtils;
/** /**
* The type Encryption property resolver. * The type Encryption property resolver.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Slf4j @Slf4j
public class EncryptionPropertyResolver implements EncryptablePropertyResolver { public class EncryptionPropertyResolver implements EncryptablePropertyResolver {
/**
* The Password.
*/
private final String password; private final String password;
/** /**
@ -33,12 +28,6 @@ public class EncryptionPropertyResolver implements EncryptablePropertyResolver {
this.password = key + "cmcc@10086!"; this.password = key + "cmcc@10086!";
} }
/**
* Resolve property value string.
*
* @param value the value
* @return the string
*/
@Override @Override
public String resolvePropertyValue(String value) { public String resolvePropertyValue(String value) {
final String encPrefix = "ENC@"; final String encPrefix = "ENC@";
@ -57,12 +46,6 @@ public class EncryptionPropertyResolver implements EncryptablePropertyResolver {
return value; return value;
} }
/**
* Resolve value string.
*
* @param value the value
* @return the string
*/
private String resolveValue(String value) throws IllegalBlockSizeException, InvalidKeyException, private String resolveValue(String value) throws IllegalBlockSizeException, InvalidKeyException,
BadPaddingException, NoSuchAlgorithmException, NoSuchPaddingException { BadPaddingException, NoSuchAlgorithmException, NoSuchPaddingException {
//自定义密文解密 //自定义密文解密

View File

@ -13,20 +13,12 @@ import java.nio.charset.StandardCharsets;
/** /**
* The type Decrypt request protocol. * The type Decrypt request protocol.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Slf4j @Slf4j
public class DecryptRequestProtocol implements HttpInputMessage { public class DecryptRequestProtocol implements HttpInputMessage {
/**
* The Input message.
*/
private final HttpInputMessage inputMessage; private final HttpInputMessage inputMessage;
/**
* The Msg content.
*/
private final String msgContent; private final String msgContent;
/** /**
@ -41,11 +33,6 @@ public class DecryptRequestProtocol implements HttpInputMessage {
this.msgContent = msgContent; this.msgContent = msgContent;
} }
/**
* Gets body.
*
* @return the body
*/
@Override @Override
@NotNull @NotNull
public InputStream getBody() throws IOException { public InputStream getBody() throws IOException {
@ -53,11 +40,6 @@ public class DecryptRequestProtocol implements HttpInputMessage {
return IOUtils.toInputStream(msgContent, StandardCharsets.UTF_8.toString()); return IOUtils.toInputStream(msgContent, StandardCharsets.UTF_8.toString());
} }
/**
* Gets headers.
*
* @return the headers
*/
@Override @Override
@NotNull @NotNull
public HttpHeaders getHeaders() { public HttpHeaders getHeaders() {

View File

@ -8,11 +8,31 @@ import com.cmhi.gds.pojo.vo.GameTableItemsSummary;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/**
* The interface Game database service service.
*/
public interface GameDatabaseServiceService { public interface GameDatabaseServiceService {
/**
* Gets game table summary items.
*
* @return the game table summary items
*/
List<GameTableItemsSummary> getGameTableSummaryItems(); List<GameTableItemsSummary> getGameTableSummaryItems();
/**
* Gets game table items.
*
* @param gameIds the game ids
* @return the game table items
*/
List<GameTableItemsDetail> getGameTableItems(List<Long> gameIds); List<GameTableItemsDetail> getGameTableItems(List<Long> gameIds);
/**
* Add game server info map.
*
* @param gameServerContents the game server contents
* @return the map
*/
Map<Long, ErrorCode> addGameServerInfo(List<GameServerContent> gameServerContents); Map<Long, ErrorCode> addGameServerInfo(List<GameServerContent> gameServerContents);
} }

View File

@ -9,8 +9,6 @@ import java.io.IOException;
/** /**
* The interface Protocol security service. * The interface Protocol security service.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public interface ProtocolSecurityService { public interface ProtocolSecurityService {
/** /**

View File

@ -24,6 +24,9 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/**
* The type Game database service service.
*/
@Service @Service
@Slf4j @Slf4j
public class GameDatabaseServiceServiceImpl implements GameDatabaseServiceService { public class GameDatabaseServiceServiceImpl implements GameDatabaseServiceService {

View File

@ -29,25 +29,13 @@ import java.nio.charset.StandardCharsets;
/** /**
* The type Protocol security service. * The type Protocol security service.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Service @Service
@Slf4j @Slf4j
public class ProtocolSecurityServiceImpl implements ProtocolSecurityService { public class ProtocolSecurityServiceImpl implements ProtocolSecurityService {
/**
* The Object mapper.
*/
@Resource @Resource
private ObjectMapper objectMapper; private ObjectMapper objectMapper;
/**
* Decrypt protocol string.
*
* @param ciphertext the ciphertext
* @return the string
* @throws JsonProcessingException the json processing exception
*/
@Override @Override
public String decryptProtocol(String ciphertext) throws JsonProcessingException { public String decryptProtocol(String ciphertext) throws JsonProcessingException {
JsonNode objRoot = objectMapper.readTree(ciphertext); JsonNode objRoot = objectMapper.readTree(ciphertext);
@ -125,13 +113,6 @@ public class ProtocolSecurityServiceImpl implements ProtocolSecurityService {
return ciphertext.replace("\"" + proReq.getMsgContent() + "\"", decodeMsg); return ciphertext.replace("\"" + proReq.getMsgContent() + "\"", decodeMsg);
} }
/**
* Decrypt protocol decrypt request protocol.
*
* @param httpInputMessage the http input message
* @return the decrypt request protocol
* @throws IOException the io exception
*/
@Override @Override
public DecryptRequestProtocol decryptProtocol(HttpInputMessage httpInputMessage) throws IOException { public DecryptRequestProtocol decryptProtocol(HttpInputMessage httpInputMessage) throws IOException {
// 提取协议中的JSON字符串 // 提取协议中的JSON字符串
@ -140,13 +121,6 @@ public class ProtocolSecurityServiceImpl implements ProtocolSecurityService {
return new DecryptRequestProtocol(httpInputMessage, decryptProtocol(reqMessage)); return new DecryptRequestProtocol(httpInputMessage, decryptProtocol(reqMessage));
} }
/**
* Encrypt protocol string string.
*
* @param plainText the plain text
* @param cryptoType the crypto type
* @return the string
*/
@Override @Override
public String encryptProtocolString(String plainText, int cryptoType) { public String encryptProtocolString(String plainText, int cryptoType) {
String cipherText; String cipherText;
@ -188,13 +162,6 @@ public class ProtocolSecurityServiceImpl implements ProtocolSecurityService {
} }
/**
* Encrypt protocol protocol resp dto.
*
* @param orgProtocol the org protocol
* @param cryptoType the crypto type
* @return the protocol resp dto
*/
@Override @Override
public ProtocolRespDTO<String> encryptProtocol(Object orgProtocol, int cryptoType) { public ProtocolRespDTO<String> encryptProtocol(Object orgProtocol, int cryptoType) {
ProtocolRespDTO<String> cryptoObject = new ProtocolRespDTO<>(); ProtocolRespDTO<String> cryptoObject = new ProtocolRespDTO<>();

View File

@ -2,110 +2,82 @@ package com.cmhi.gds.validation.group;
/** /**
* The interface Valid groups. * The interface Valid groups.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public interface ValidGroups { public interface ValidGroups {
/** /**
* The interface Protocol common valid. * The interface Protocol common valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface ProtocolCommonValid { interface ProtocolCommonValid {
} }
/** /**
* The interface Login req valid. * The interface Login req valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface LoginReqValid extends LogoutReqValid { interface LoginReqValid extends LogoutReqValid {
} }
/** /**
* The interface Logout req valid. * The interface Logout req valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface LogoutReqValid extends ProtocolCommonValid { interface LogoutReqValid extends ProtocolCommonValid {
} }
/** /**
* The interface Upgrade device valid. * The interface Add game service valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface AddGameServiceValid extends ProtocolCommonValid { interface AddGameServiceValid extends ProtocolCommonValid {
} }
/** /**
* The interface Add device valid. * The interface Add device valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface AddDeviceValid extends AddGameServiceValid { interface AddDeviceValid extends AddGameServiceValid {
} }
/** /**
* The interface Id array valid. * The interface Id array valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface IdArrayValid extends ProtocolCommonValid { interface IdArrayValid extends ProtocolCommonValid {
} }
/** /**
* The interface Explicit id array valid. * The interface Explicit id array valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface ExplicitIdArrayValid extends IdArrayValid { interface ExplicitIdArrayValid extends IdArrayValid {
} }
/** /**
* The interface Task start req common valid. * The interface Task start req common valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface TaskStartReqCommonValid extends ProtocolCommonValid { interface TaskStartReqCommonValid extends ProtocolCommonValid {
} }
/** /**
* The interface Task start req valid. * The interface Task start req valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface TaskStartReqValid extends TaskStartReqCommonValid { interface TaskStartReqValid extends TaskStartReqCommonValid {
} }
/** /**
* The interface Task start mul req valid. * The interface Task start mul req valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface TaskStartMulReqValid extends TaskStartReqCommonValid { interface TaskStartMulReqValid extends TaskStartReqCommonValid {
} }
/** /**
* The interface Task stop req valid. * The interface Task stop req valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface TaskStopReqValid extends ProtocolCommonValid { interface TaskStopReqValid extends ProtocolCommonValid {
} }
/** /**
* The interface Get dev ver req valid. * The interface Get dev ver req valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface GetDevVerReqValid extends ProtocolCommonValid { interface GetDevVerReqValid extends ProtocolCommonValid {
} }
/** /**
* The interface Add device valid. * The interface Add user info valid.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
interface AddUserInfoValid extends ProtocolCommonValid { interface AddUserInfoValid extends ProtocolCommonValid {
} }

View File

@ -12,9 +12,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* The interface Valid custom base enum. * The interface Valid base enum.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

View File

@ -12,8 +12,6 @@ import java.lang.annotation.Target;
/** /**
* The interface Valid ip addr. * The interface Valid ip addr.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

View File

@ -12,8 +12,6 @@ import java.lang.annotation.Target;
/** /**
* The interface Valid ip port. * The interface Valid ip port.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

View File

@ -14,41 +14,21 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* The type Valid custom base enum. * The type Valid base enum.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
@Slf4j @Slf4j
public class ValidBaseEnumImpl implements ConstraintValidator<ValidBaseEnum, Integer> { public class ValidBaseEnumImpl implements ConstraintValidator<ValidBaseEnum, Integer> {
/**
* The Enum class.
*/
private Class<? extends BaseEnum> enumClass; private Class<? extends BaseEnum> enumClass;
/**
* The Message.
*/
private String message; private String message;
/**
* Initialize.
*
* @param constraintAnnotation the constraint annotation
*/
@Override @Override
public void initialize(ValidBaseEnum constraintAnnotation) { public void initialize(ValidBaseEnum constraintAnnotation) {
this.enumClass = constraintAnnotation.enumClass(); this.enumClass = constraintAnnotation.enumClass();
this.message = constraintAnnotation.message(); this.message = constraintAnnotation.message();
} }
/**
* Is valid boolean.
*
* @param integer the integer
* @param ctx the constraint validator context
* @return the boolean
*/
@Override @Override
public boolean isValid(Integer integer, ConstraintValidatorContext ctx) { public boolean isValid(Integer integer, ConstraintValidatorContext ctx) {

View File

@ -11,27 +11,13 @@ import java.util.regex.Pattern;
/** /**
* The type Valid ip addr. * The type Valid ip addr.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public class ValidIpAddrImpl implements ConstraintValidator<ValidIpAddr, String> { public class ValidIpAddrImpl implements ConstraintValidator<ValidIpAddr, String> {
/**
* Initialize.
*
* @param constraintAnnotation the constraint annotation
*/
@Override @Override
public void initialize(ValidIpAddr constraintAnnotation) { public void initialize(ValidIpAddr constraintAnnotation) {
} }
/**
* Is valid boolean.
*
* @param s the s
* @param constraintValidatorContext the constraint validator context
* @return the boolean
*/
@Override @Override
public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) { public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {

View File

@ -9,27 +9,13 @@ import javax.validation.ConstraintValidatorContext;
/** /**
* The type Valid ip port. * The type Valid ip port.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/ */
public class ValidIpPortImpl implements ConstraintValidator<ValidIpPort, String> { public class ValidIpPortImpl implements ConstraintValidator<ValidIpPort, String> {
/**
* Initialize.
*
* @param constraintAnnotation the constraint annotation
*/
@Override @Override
public void initialize(ValidIpPort constraintAnnotation) { public void initialize(ValidIpPort constraintAnnotation) {
} }
/**
* Is valid boolean.
*
* @param s the s
* @param constraintValidatorContext the constraint validator context
* @return the boolean
*/
@Override @Override
public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) { public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
final int minSocketPort = 1; final int minSocketPort = 1;