diff --git a/bin/processor_check.sh b/bin/processor_check.sh index 8a0efc7..d501b3d 100644 --- a/bin/processor_check.sh +++ b/bin/processor_check.sh @@ -1,8 +1,8 @@ +#!/bin/bash # crontab里加上进程自动拉起任务,做个简单的监控 # */1 * * * * source /etc/profile;sh /apprun/${YOUR_APP_NAME}/bin/processor_check.sh # processor_check.sh脚本内容如下 -#!/bin/bash APP_NAME=dispose_platform.jar WORK_PATH=$(cd `dirname $0`; pwd) diff --git a/src/main/java/com/cmhi/gds/GameDatabaseServiceApplication.java b/src/main/java/com/cmhi/gds/GameDatabaseServiceApplication.java index bda6ed4..74f89c5 100644 --- a/src/main/java/com/cmhi/gds/GameDatabaseServiceApplication.java +++ b/src/main/java/com/cmhi/gds/GameDatabaseServiceApplication.java @@ -5,11 +5,19 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.scheduling.annotation.EnableScheduling; +/** + * The type Game database service application. + */ @SpringBootApplication @MapperScan(basePackages = {"com.cmhi.gds.mapper"}) @EnableScheduling public class GameDatabaseServiceApplication { + /** + * The entry point of application. + * + * @param args the input arguments + */ public static void main(String[] args) { SpringApplication.run(GameDatabaseServiceApplication.class, args); } diff --git a/src/main/java/com/cmhi/gds/common/BaseEnum.java b/src/main/java/com/cmhi/gds/common/BaseEnum.java index f404bea..0acf483 100644 --- a/src/main/java/com/cmhi/gds/common/BaseEnum.java +++ b/src/main/java/com/cmhi/gds/common/BaseEnum.java @@ -2,8 +2,6 @@ package com.cmhi.gds.common; /** * The interface Base enum. - * - * @author */ public interface BaseEnum { /** diff --git a/src/main/java/com/cmhi/gds/common/CommonEnumHandler.java b/src/main/java/com/cmhi/gds/common/CommonEnumHandler.java index 8d536b7..c80f156 100644 --- a/src/main/java/com/cmhi/gds/common/CommonEnumHandler.java +++ b/src/main/java/com/cmhi/gds/common/CommonEnumHandler.java @@ -14,16 +14,9 @@ import java.util.List; * The type Common enum handler. * * @param the type parameter - * @author */ public final class CommonEnumHandler extends BaseTypeHandler { - /** - * The Enum type. - */ private final Class enumType; - /** - * The Enums. - */ private final List enums; /** @@ -60,28 +53,11 @@ public final class CommonEnumHandler extends BaseTypeHandler 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 public void setNonNullParameter(PreparedStatement preparedStatement, int i, E e, JdbcType jdbcType) throws SQLException { 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 public E getNullableResult(ResultSet resultSet, String s) throws SQLException { if (resultSet.getObject(s) == null) { @@ -92,14 +68,6 @@ public final class CommonEnumHandler extends BaseTypeHandler 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 public E getNullableResult(ResultSet resultSet, int index) throws SQLException { if (resultSet.getObject(index) == null) { @@ -110,14 +78,6 @@ public final class CommonEnumHandler extends BaseTypeHandler 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 public E getNullableResult(CallableStatement callableStatement, int index) throws SQLException { if (callableStatement.getObject(index) == null) { @@ -128,12 +88,6 @@ public final class CommonEnumHandler extends BaseTypeHandler return locateEnumStatus(val); } - /** - * Locate enum status e. - * - * @param index the index - * @return the e - */ private E locateEnumStatus(int index) { for (E e : enums) { if (e.getValue() == index) { diff --git a/src/main/java/com/cmhi/gds/common/ConstValue.java b/src/main/java/com/cmhi/gds/common/ConstValue.java index 2e19b79..bee58e6 100644 --- a/src/main/java/com/cmhi/gds/common/ConstValue.java +++ b/src/main/java/com/cmhi/gds/common/ConstValue.java @@ -1,11 +1,17 @@ package com.cmhi.gds.common; +/** + * The type Const value. + */ public class ConstValue { /** * The constant STRING_HTTP_AUTH_HEAD. */ 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}" + "(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,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}:$"; + + /** + * The type Protocol. + */ public static class Protocol { /** * The constant VERSION. diff --git a/src/main/java/com/cmhi/gds/common/ErrorCode.java b/src/main/java/com/cmhi/gds/common/ErrorCode.java index 6fd4d1c..91f6343 100644 --- a/src/main/java/com/cmhi/gds/common/ErrorCode.java +++ b/src/main/java/com/cmhi/gds/common/ErrorCode.java @@ -4,243 +4,229 @@ import javax.servlet.http.HttpServletResponse; /** * The enum Error code. - * - * @author */ public enum ErrorCode implements BaseEnum { /** - * The Err ok. + * Err ok error code. */ ERR_OK(0, "成功"), /** - * The Err password. + * Err password error code. */ ERR_PASSWORD(1, "密码错误"), /** - * The Err usernotfound. + * Err usernotfound error code. */ ERR_USERNOTFOUND(2, "用户不存在"), /** - * The Err passwordmore. + * Err passwordmore error code. */ ERR_PASSWORDMORE(3, "连续密码错误达上限,再次输入错误将锁定用户"), /** - * The Err userlock. + * Err userlock error code. */ ERR_USERLOCK(4, "密码错误达上限,用户被锁定"), /** - * The Err account. + * Err account error code. */ ERR_ACCOUNT(5, "用户账户异常"), /** - * The Err userexist. + * Err userexist error code. */ ERR_USEREXIST(6, "该用户已经存在"), /** - * The Err passwordsimple. + * Err passwordsimple error code. */ ERR_PASSWORDSIMPLE(7, "用户密码强度不符合要求"), /** - * The Err inputformat. + * Err inputformat error code. */ ERR_INPUTFORMAT(8, "输入信息格式有误"), /** - * The Err inputmiss. + * Err inputmiss error code. */ ERR_INPUTMISS(9, "缺少必要输入信息"), /** - * The Err permission. + * Err permission error code. */ ERR_PERMISSION(10, "操作员权限不足"), /** - * The Err reqtimeout. + * Err reqtimeout error code. */ ERR_REQTIMEOUT(11, "请求超时"), /** - * The Err params. + * Err params error code. */ ERR_PARAMS(12, "参数错误"), /** - * The Err systemexception. + * Err systemexception error code. */ ERR_SYSTEMEXCEPTION(13, "系统异常"), /** - * The Err unknowncmd. + * Err unknowncmd error code. */ ERR_UNKNOWNCMD(14, "未知命令"), /** - * The Err logout. + * Err logout error code. */ ERR_LOGOUT(15, "用户未登录"), /** - * The Err tokentimeout. + * Err tokentimeout error code. */ ERR_TOKENTIMEOUT(16, "Token超时"), /** - * The Err tokennotfound. + * Err tokennotfound error code. */ ERR_TOKENNOTFOUND(17, "非法Token"), /** - * The Err missauthhead. + * Err missauthhead error code. */ ERR_MISSAUTHHEAD(18, "Http 请求缺少认证头部"), /** - * The Err nosuchdevice. + * Err nosuchdevice error code. */ ERR_NOSUCHDEVICE(19, "没有这个设备"), /** - * The Err deviceexists. + * Err deviceexists error code. */ ERR_DEVICEEXISTS(20, "设备已经存在"), /** - * The Err paramexception. + * Err paramexception error code. */ ERR_PARAMEXCEPTION(21, "参数异常"), /** - * The Err devicelocked. + * Err devicelocked error code. */ ERR_DEVICELOCKED(22, "设备已锁定"), /** - * The Err version. + * Err version error code. */ ERR_VERSION(23, "协议版本不兼容,请升级系统"), /** - * The Err nosuchtype. + * Err nosuchtype error code. */ ERR_NOSUCHTYPE(24, "没有这个类型的设备"), /** - * The Err removemore. + * Err removemore error code. */ ERR_REMOVEMORE(25, "禁止同时删除多个设备"), /** - * The Err taskrunning. + * Err taskrunning error code. */ ERR_TASKRUNNING(26, "同类任务正在运行"), /** - * The Err unsupport. + * Err unsupport error code. */ ERR_UNSUPPORT(27, "不支持的操作"), /** - * The Err interrupt. + * Err interrupt error code. */ ERR_INTERRUPT(28, "操作中断"), /** - * The Err calldevice. + * Err calldevice error code. */ ERR_CALLDEVICE(29, "调用设备失败"), /** - * The Err nosuchtask. + * Err nosuchtask error code. */ ERR_NOSUCHTASK(30, "没有该任务"), /** - * The Err tasknotrunning. + * Err tasknotrunning error code. */ ERR_TASKNOTRUNNING(31, "该任务没有运行"), /** - * The Err requesttimeout. + * Err requesttimeout error code. */ ERR_REQUESTTIMEOUT(32, "请求超时"), /** - * The Err unabledisposeip. + * Err unabledisposeip error code. */ ERR_UNABLEDISPOSEIP(33, "无法处置该IP"), /** - * The Err database. + * Err database error code. */ ERR_DATABASE(34, "操作数据库失败"), /** - * The Err untrusthost. + * Err untrusthost error code. */ ERR_UNTRUSTHOST(35, "未经授权的客户端"), /** - * The Err untrusttoken. + * Err untrusttoken error code. */ ERR_UNTRUSTTOKEN(36, "未经授权的Token"), /** - * The Err unknowninterface. + * Err unknowninterface error code. */ ERR_UNKNOWNINTERFACE(37, "未提供该接口"), /** - * The Err decrypt base 64. + * Err decrypt base 64 error code. */ ERR_DECRYPT_BASE64(100, "BASE64解密失败"), /** - * The Err encrypt base 64. + * Err encrypt base 64 error code. */ ERR_ENCRYPT_BASE64(101, "BASE64加密失败"), /** - * The Err decrypt aes 128. + * Err decrypt aes 128 error code. */ ERR_DECRYPT_AES128(102, "AES128解密失败"), /** - * The Err encrypt aes 128. + * Err encrypt aes 128 error code. */ ERR_ENCRYPT_AES128(103, "AES128加密失败"), /** - * The Err decrypt 3 des. + * Err decrypt 3 des error code. */ ERR_DECRYPT_3DES(104, "3DES解密失败"), /** - * The Err encrypt 3 des. + * Err encrypt 3 des error code. */ ERR_ENCRYPT_3DES(105, "3DES加密失败"), /** - * The Err decrypt unknown. + * Err decrypt unknown error code. */ ERR_DECRYPT_UNKNOWN(106, "不支持的解密算法"), /** - * The Err encrypt unknown. + * Err encrypt unknown error code. */ ERR_ENCRYPT_UNKNOWN(107, "不支持的加密算法"), /** - * The Err json encode. + * Err json encode error code. */ ERR_JSON_ENCODE(108, "Json 序列号错误"), /** - * The Err json decode. + * Err json decode error code. */ ERR_JSON_DECODE(109, "Json 反序列化错误"), /** - * The Err encrypt aes 256. + * Err encrypt aes 256 error code. */ ERR_ENCRYPT_AES256(110, "AES256加密失败"), /** - * The Err decrypt aes 256. + * Err decrypt aes 256 error code. */ ERR_DECRYPT_AES256(111, "AES256解密失败"), /** - * The Err nodevice areacode. + * Err nosuch game error code. */ ERR_NOSUCH_GAME(112, "该游戏不存在"), /** - * The Err specifiedip exists. + * Err specifiedip exists error code. */ ERR_SPECIFIEDIP_EXISTS(113, "指定的IP已经存在"), /** - * The Err specifiedip notexists. + * Err specifiedip notexists error code. */ ERR_SPECIFIEDIP_NOTEXISTS(114, "指定的IP地址不存在"), /** - * The Err server processreq. + * Err server processreq error code. */ ERR_SERVER_PROCESSREQ(115, "服务器处理请求错误"), ; - /** - * The Errno. - */ private final int errno; - /** - * The Err msg. - */ private final String errMsg; - /** - * Instantiates a new Error code. - * - * @param err the err - * @param msg the msg - */ ErrorCode(int err, String msg) { this.errno = err; this.errMsg = msg; @@ -298,21 +284,11 @@ public enum ErrorCode implements BaseEnum { } - /** - * Gets value. - * - * @return the value - */ @Override public Integer getValue() { return this.errno; } - /** - * Gets description. - * - * @return the description - */ @Override public String getDescription() { return this.errMsg; diff --git a/src/main/java/com/cmhi/gds/common/GlobalConfigure.java b/src/main/java/com/cmhi/gds/common/GlobalConfigure.java index 2f3a4ec..62cbac4 100644 --- a/src/main/java/com/cmhi/gds/common/GlobalConfigure.java +++ b/src/main/java/com/cmhi/gds/common/GlobalConfigure.java @@ -1,11 +1,20 @@ package com.cmhi.gds.common; +/** + * The type Global configure. + */ public class GlobalConfigure { private GlobalConfigure() { throw new AssertionError("Instantiating utility class."); } + /** + * The constant CHECK_PROTO_REQUEST_TIMEOUT. + */ public static volatile boolean CHECK_PROTO_REQUEST_TIMEOUT = false; + /** + * The constant REQUEST_TIMEOUT_MS. + */ public static volatile long REQUEST_TIMEOUT_MS = 5 * 1000; } diff --git a/src/main/java/com/cmhi/gds/common/ProtoCryptoType.java b/src/main/java/com/cmhi/gds/common/ProtoCryptoType.java index f16212e..fd025b7 100644 --- a/src/main/java/com/cmhi/gds/common/ProtoCryptoType.java +++ b/src/main/java/com/cmhi/gds/common/ProtoCryptoType.java @@ -2,24 +2,22 @@ package com.cmhi.gds.common; /** * The enum Proto crypto type. - * - * @author */ public enum ProtoCryptoType { /** - * The Crypto none. + * Crypto none proto crypto type. */ CRYPTO_NONE(0, "不加密"), /** - * The Crypto base 64. + * Crypto base 64 proto crypto type. */ CRYPTO_BASE64(1, "Base64编码"), /** - * The Crypto aes 128. + * Crypto aes 128 proto crypto type. */ CRYPTO_AES128(2, "AES128加密"), /** - * The Crypto des. + * Crypto des proto crypto type. */ CRYPTO_DES(3, "DES对称加密"), /** @@ -28,21 +26,9 @@ public enum ProtoCryptoType { CRYPTO_AES256(4, "AES256加密"), ; - /** - * The Code. - */ private final int code; - /** - * The Readme. - */ private final String readme; - /** - * Instantiates a new Proto crypto type. - * - * @param code the code - * @param readme the readme - */ ProtoCryptoType(int code, String readme) { this.code = code; this.readme = readme; diff --git a/src/main/java/com/cmhi/gds/common/SecurityConfigValue.java b/src/main/java/com/cmhi/gds/common/SecurityConfigValue.java index faecf91..98cfa63 100644 --- a/src/main/java/com/cmhi/gds/common/SecurityConfigValue.java +++ b/src/main/java/com/cmhi/gds/common/SecurityConfigValue.java @@ -2,14 +2,9 @@ package com.cmhi.gds.common; /** * The type Security config value. - * - * @author */ public class SecurityConfigValue { - /** - * Instantiates a new Security config value. - */ private SecurityConfigValue() { throw new AssertionError("Instantiating utility class."); } diff --git a/src/main/java/com/cmhi/gds/common/TransportProtocolType.java b/src/main/java/com/cmhi/gds/common/TransportProtocolType.java index b81afc5..7f92024 100644 --- a/src/main/java/com/cmhi/gds/common/TransportProtocolType.java +++ b/src/main/java/com/cmhi/gds/common/TransportProtocolType.java @@ -1,59 +1,35 @@ package com.cmhi.gds.common; /** - * The enum Dispose device type. - * - * @author + * The enum Transport protocol type. */ public enum TransportProtocolType implements BaseEnum { /** - * The Dptech umc. + * Tcp protocol transport protocol type. */ TCP_PROTOCOL(0, "TCP"), /** - * The Haohan platform. + * Udp protocol transport protocol type. */ UDP_PROTOCOL(1, "UDP"), /** - * The Pengxin platform. + * Unknown protocol transport protocol type. */ UNKNOWN_PROTOCOL(2, "UNKNOWN"); - /** - * The Code. - */ private final int code; - /** - * The Readme. - */ private final String readme; - /** - * Instantiates a new Dispose device type. - * - * @param code the code - * @param readme the readme - */ TransportProtocolType(int code, String readme) { this.code = code; this.readme = readme; } - /** - * Gets value. - * - * @return the value - */ @Override public Integer getValue() { return this.code; } - /** - * Gets description. - * - * @return the description - */ @Override public String getDescription() { return this.readme; diff --git a/src/main/java/com/cmhi/gds/controller/ErrorController.java b/src/main/java/com/cmhi/gds/controller/ErrorController.java index 5a58d0d..020ae50 100644 --- a/src/main/java/com/cmhi/gds/controller/ErrorController.java +++ b/src/main/java/com/cmhi/gds/controller/ErrorController.java @@ -15,8 +15,6 @@ import java.util.Map; /** * The type Error controller. - * - * @author */ @Controller public class ErrorController extends BasicErrorController { @@ -29,12 +27,6 @@ public class ErrorController extends BasicErrorController { super(new DefaultErrorAttributes(), serverProperties.getError()); } - /** - * Error response entity. - * - * @param request the request - * @return the response entity - */ @Override public ResponseEntity> error(HttpServletRequest request) { HttpStatus status = getStatus(request); diff --git a/src/main/java/com/cmhi/gds/controller/GameDatabaseInfoController.java b/src/main/java/com/cmhi/gds/controller/GameDatabaseInfoController.java index 2ffce8b..541bc6e 100644 --- a/src/main/java/com/cmhi/gds/controller/GameDatabaseInfoController.java +++ b/src/main/java/com/cmhi/gds/controller/GameDatabaseInfoController.java @@ -37,6 +37,9 @@ import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; +/** + * The type Game database info controller. + */ @Controller @RequestMapping(value = "/gameinfo") @Slf4j @@ -49,6 +52,11 @@ public class GameDatabaseInfoController { @Resource private GameDatabaseServiceService gameDatabaseServiceService; + /** + * Gets game list summary. + * + * @return the game list summary + */ @GetMapping("gamelistsummary") @ResponseBody public ProtocolRespDTO getGameListSummary() { @@ -84,12 +92,23 @@ public class GameDatabaseInfoController { return ProtocolRespDTO.result(ErrorCode.ERR_OK, rspInfo); } + /** + * Gets game list summary 2. + * + * @return the game list summary 2 + */ @PostMapping("gamelistsummary2") @ResponseBody - public ProtocolRespDTO getGameListSummary2(@RequestBody ProtocolReqDTO mr) { + public ProtocolRespDTO getGameListSummary2() { return getGameListSummary(); } + /** + * Gets game info details. + * + * @param mr the mr + * @return the game info details + */ @PostMapping("gamelistDetails") @ResponseBody public ProtocolRespDTO getGameInfoDetails(@Validated(ValidGroups.AddGameServiceValid.class) @@ -150,6 +169,12 @@ public class GameDatabaseInfoController { 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") @ResponseBody public ProtocolRespDTO reportGameServiceData( diff --git a/src/main/java/com/cmhi/gds/exception/ControllerNotSupportException.java b/src/main/java/com/cmhi/gds/exception/ControllerNotSupportException.java index 18dab39..129d6d4 100644 --- a/src/main/java/com/cmhi/gds/exception/ControllerNotSupportException.java +++ b/src/main/java/com/cmhi/gds/exception/ControllerNotSupportException.java @@ -6,19 +6,14 @@ import lombok.Setter; /** * The type Controller not support exception. - * - * @author */ @Getter @Setter public class ControllerNotSupportException extends RuntimeException { - /** - * The Err. - */ private ErrorCode err; /** - * Instantiates a new Security protocol exception. + * Instantiates a new Controller not support exception. * * @param err the err */ diff --git a/src/main/java/com/cmhi/gds/exception/ControllerRequestTimeoutException.java b/src/main/java/com/cmhi/gds/exception/ControllerRequestTimeoutException.java index a3eb0a7..d97ed79 100644 --- a/src/main/java/com/cmhi/gds/exception/ControllerRequestTimeoutException.java +++ b/src/main/java/com/cmhi/gds/exception/ControllerRequestTimeoutException.java @@ -6,20 +6,12 @@ import lombok.Setter; /** * The type Controller request timeout exception. - * - * @author */ @Getter @Setter public class ControllerRequestTimeoutException extends RuntimeException { - /** - * The Err. - */ private ErrorCode err; - /** - * The Message. - */ private String message; /** diff --git a/src/main/java/com/cmhi/gds/exception/GlobalExceptionHandler.java b/src/main/java/com/cmhi/gds/exception/GlobalExceptionHandler.java index 58098ba..d8e8221 100644 --- a/src/main/java/com/cmhi/gds/exception/GlobalExceptionHandler.java +++ b/src/main/java/com/cmhi/gds/exception/GlobalExceptionHandler.java @@ -20,8 +20,6 @@ import java.util.concurrent.atomic.AtomicInteger; /** * The type Global exception handler. - * - * @author */ @ControllerAdvice @Slf4j diff --git a/src/main/java/com/cmhi/gds/exception/SecurityProtocolException.java b/src/main/java/com/cmhi/gds/exception/SecurityProtocolException.java index 75c7609..3810546 100644 --- a/src/main/java/com/cmhi/gds/exception/SecurityProtocolException.java +++ b/src/main/java/com/cmhi/gds/exception/SecurityProtocolException.java @@ -5,22 +5,17 @@ import lombok.Getter; import lombok.Setter; /** - * The type Security exception. - * - * @author + * The type Security protocol exception. */ @Getter @Setter public class SecurityProtocolException extends RuntimeException { - /** - * The Err. - */ private ErrorCode err; private String description; /** - * Instantiates a new Security exception. + * Instantiates a new Security protocol exception. * * @param err the err */ @@ -30,6 +25,12 @@ public class SecurityProtocolException extends RuntimeException { this.description = null; } + /** + * Instantiates a new Security protocol exception. + * + * @param err the err + * @param readme the readme + */ public SecurityProtocolException(ErrorCode err, String readme) { super(); this.err = err; diff --git a/src/main/java/com/cmhi/gds/interceptor/RequestBodyCacheWrapper.java b/src/main/java/com/cmhi/gds/interceptor/RequestBodyCacheWrapper.java index 4482b3f..a240dbf 100644 --- a/src/main/java/com/cmhi/gds/interceptor/RequestBodyCacheWrapper.java +++ b/src/main/java/com/cmhi/gds/interceptor/RequestBodyCacheWrapper.java @@ -16,13 +16,8 @@ import java.nio.charset.Charset; /** * The type Request body cache wrapper. - * - * @author */ public class RequestBodyCacheWrapper extends HttpServletRequestWrapper { - /** - * The Body. - */ private final byte[] body; /** @@ -62,21 +57,11 @@ public class RequestBodyCacheWrapper extends HttpServletRequestWrapper { return Helper.inputStream2String(inputStream); } - /** - * Gets reader. - * - * @return the reader - */ @Override public BufferedReader getReader() { return new BufferedReader(new InputStreamReader(getInputStream())); } - /** - * Gets input stream. - * - * @return the input stream - */ @Override public ServletInputStream getInputStream() { diff --git a/src/main/java/com/cmhi/gds/interceptor/RequestBodyFilter.java b/src/main/java/com/cmhi/gds/interceptor/RequestBodyFilter.java index ea6c269..64924e4 100644 --- a/src/main/java/com/cmhi/gds/interceptor/RequestBodyFilter.java +++ b/src/main/java/com/cmhi/gds/interceptor/RequestBodyFilter.java @@ -13,37 +13,17 @@ import java.io.IOException; /** * The type Request body filter. - * - * @author */ - @WebFilter(filterName = "RequestBodyFilter", urlPatterns = "/*") public class RequestBodyFilter implements Filter { - /** - * Init. - * - * @param filterConfig the filter config - */ @Override public void init(FilterConfig filterConfig) { } - /** - * Destroy. - */ @Override 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 public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { ServletRequest requestWrapper = new RequestBodyCacheWrapper((HttpServletRequest) request); diff --git a/src/main/java/com/cmhi/gds/interceptor/RequestProtocolSecurity.java b/src/main/java/com/cmhi/gds/interceptor/RequestProtocolSecurity.java index 6247ff1..ebee8a8 100644 --- a/src/main/java/com/cmhi/gds/interceptor/RequestProtocolSecurity.java +++ b/src/main/java/com/cmhi/gds/interceptor/RequestProtocolSecurity.java @@ -16,27 +16,14 @@ import java.lang.reflect.Type; /** * The type Request protocol security. - * - * @author */ @Slf4j @RestControllerAdvice public class RequestProtocolSecurity implements RequestBodyAdvice { - /** - * The Protocol security service. - */ @Resource private ProtocolSecurityService protocolSecurityService; - /** - * Supports boolean. - * - * @param methodParameter the method parameter - * @param type the type - * @param aClass the a class - * @return the boolean - */ @Override public boolean supports(@NotNull MethodParameter methodParameter, @NotNull Type type, @@ -45,15 +32,6 @@ public class RequestProtocolSecurity implements RequestBodyAdvice { || 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 @NotNull public HttpInputMessage beforeBodyRead(@NotNull HttpInputMessage httpInputMessage, @@ -63,16 +41,6 @@ public class RequestProtocolSecurity implements RequestBodyAdvice { 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 public Object handleEmptyBody(Object o, @NotNull HttpInputMessage httpInputMessage, @@ -82,16 +50,6 @@ public class RequestProtocolSecurity implements RequestBodyAdvice { 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 @NotNull public Object afterBodyRead(@NotNull Object o, diff --git a/src/main/java/com/cmhi/gds/interceptor/ResponseProtocolSecurity.java b/src/main/java/com/cmhi/gds/interceptor/ResponseProtocolSecurity.java index 1311e6a..e6bbb00 100644 --- a/src/main/java/com/cmhi/gds/interceptor/ResponseProtocolSecurity.java +++ b/src/main/java/com/cmhi/gds/interceptor/ResponseProtocolSecurity.java @@ -19,26 +19,14 @@ import javax.annotation.Resource; /** * The type Response protocol security. - * - * @author */ @Slf4j @RestControllerAdvice public class ResponseProtocolSecurity implements ResponseBodyAdvice { - /** - * The Protocol security service. - */ @Resource private ProtocolSecurityService protocolSecurityService; - /** - * Supports boolean. - * - * @param methodParameter the method parameter - * @param aClass the a class - * @return the boolean - */ @Override public boolean supports(@NotNull MethodParameter methodParameter, @NotNull Class> aClass) { @@ -47,17 +35,6 @@ public class ResponseProtocolSecurity implements ResponseBodyAdvice { || 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 @NotNull public Object beforeBodyWrite(Object o, diff --git a/src/main/java/com/cmhi/gds/manager/GameDatabaseServiceManager.java b/src/main/java/com/cmhi/gds/manager/GameDatabaseServiceManager.java index f7950d6..59b3aec 100644 --- a/src/main/java/com/cmhi/gds/manager/GameDatabaseServiceManager.java +++ b/src/main/java/com/cmhi/gds/manager/GameDatabaseServiceManager.java @@ -6,12 +6,38 @@ import com.cmhi.gds.pojo.vo.GameTableSummary; import java.util.List; +/** + * The interface Game database service manager. + */ public interface GameDatabaseServiceManager { + /** + * Gets game table summary. + * + * @return the game table summary + */ List getGameTableSummary(); + /** + * Gets game table details. + * + * @param gameId the game id + * @return the game table details + */ List getGameTableDetails(List 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 getGameServerInfoByGameInfoId(List gameInfoId); + /** + * Add game server info int. + * + * @param gsList the gs list + * @return the int + */ int addGameServerInfo(List gsList); } diff --git a/src/main/java/com/cmhi/gds/manager/impl/GameDatabaseServiceManagerImpl.java b/src/main/java/com/cmhi/gds/manager/impl/GameDatabaseServiceManagerImpl.java index 73c9283..84dca8f 100644 --- a/src/main/java/com/cmhi/gds/manager/impl/GameDatabaseServiceManagerImpl.java +++ b/src/main/java/com/cmhi/gds/manager/impl/GameDatabaseServiceManagerImpl.java @@ -13,6 +13,9 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.List; +/** + * The type Game database service manager. + */ @Component @Slf4j public class GameDatabaseServiceManagerImpl implements GameDatabaseServiceManager { diff --git a/src/main/java/com/cmhi/gds/mapper/GameInfoMapper.java b/src/main/java/com/cmhi/gds/mapper/GameInfoMapper.java index 4369b57..b36be4b 100644 --- a/src/main/java/com/cmhi/gds/mapper/GameInfoMapper.java +++ b/src/main/java/com/cmhi/gds/mapper/GameInfoMapper.java @@ -4,6 +4,14 @@ import com.cmhi.gds.pojo.entry.GameInfo; import java.util.List; +/** + * The interface Game info mapper. + */ public interface GameInfoMapper { + /** + * Select all list. + * + * @return the list + */ List selectAll(); } diff --git a/src/main/java/com/cmhi/gds/mapper/GameServerMapper.java b/src/main/java/com/cmhi/gds/mapper/GameServerMapper.java index 0a943af..9ce7eba 100644 --- a/src/main/java/com/cmhi/gds/mapper/GameServerMapper.java +++ b/src/main/java/com/cmhi/gds/mapper/GameServerMapper.java @@ -5,10 +5,30 @@ import org.apache.ibatis.annotations.Param; import java.util.List; +/** + * The interface Game server mapper. + */ public interface GameServerMapper { + /** + * Select all list. + * + * @return the list + */ List selectAll(); + /** + * Select all by game info id list. + * + * @param idList the id list + * @return the list + */ List selectAllByGameInfoId(@Param("idList") List idList); + /** + * Add game server info list int. + * + * @param gameSvrInfo the game svr info + * @return the int + */ int addGameServerInfoList(@Param("gameSvrInfo") List gameSvrInfo); } diff --git a/src/main/java/com/cmhi/gds/mapper/GameTableMapper.java b/src/main/java/com/cmhi/gds/mapper/GameTableMapper.java index 1aadb5e..63a1145 100644 --- a/src/main/java/com/cmhi/gds/mapper/GameTableMapper.java +++ b/src/main/java/com/cmhi/gds/mapper/GameTableMapper.java @@ -7,10 +7,29 @@ import org.apache.ibatis.annotations.Param; import java.util.List; +/** + * The interface Game table mapper. + */ public interface GameTableMapper { + /** + * Select all list. + * + * @return the list + */ List selectAll(); + /** + * Select all game summary list. + * + * @return the list + */ List selectAllGameSummary(); + /** + * Select all game detail by id list. + * + * @param idList the id list + * @return the list + */ List selectAllGameDetailById(@Param("idList") List idList); } diff --git a/src/main/java/com/cmhi/gds/misc/Helper.java b/src/main/java/com/cmhi/gds/misc/Helper.java index f916381..bc904e1 100644 --- a/src/main/java/com/cmhi/gds/misc/Helper.java +++ b/src/main/java/com/cmhi/gds/misc/Helper.java @@ -18,15 +18,10 @@ import java.time.format.DateTimeFormatter; /** * The type Helper. - * - * @author */ @Slf4j public class Helper { - /** - * Instantiates a new Helper. - */ private Helper() { throw new AssertionError("Instantiating utility class."); } @@ -109,6 +104,12 @@ public class Helper { return sb.toString(); } + /** + * Ip address is hostname boolean. + * + * @param hostStr the host str + * @return the boolean + */ public static Boolean ipAddressIsHostname(String hostStr) { HostName host = new HostName(hostStr); 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) { 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) { if (ipAddressIsHostname(ip1) == null || ipAddressIsHostname(ip1) == null) { 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) { IPAddress loopback = new IPAddressString(ipAddr).getAddress(); diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseIdResp.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseIdResp.java index 5a35d68..77e0dde 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseIdResp.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseIdResp.java @@ -9,8 +9,6 @@ import lombok.NoArgsConstructor; /** * The type Base id resp. - * - * @author */ @EqualsAndHashCode(callSuper = true) @Data @@ -19,17 +17,8 @@ import lombok.NoArgsConstructor; @JsonPropertyOrder({"id", "devId", "taskId", "status", "message"}) @JsonInclude(JsonInclude.Include.NON_NULL) public class BaseIdResp extends BaseRespStatus { - /** - * The Id. - */ private String id; - /** - * The Dev id. - */ private String devId; - /** - * The Task id. - */ private String taskId; } diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseProtocolDTO.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseProtocolDTO.java index 1ea64cd..592e0ff 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseProtocolDTO.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseProtocolDTO.java @@ -14,40 +14,27 @@ import javax.validation.constraints.NotNull; * The type Base protocol dto. * * @param the type parameter - * @author */ @Data @NoArgsConstructor @JsonPropertyOrder({"ver", "cryptoType", "timeStamp", "msgContent"}) public class BaseProtocolDTO { - /** - * 当前协议版本号 - */ @NotNull(message = "ver 字段不能为空", groups = ValidGroups.ProtocolCommonValid.class) @Range(min = 1, max = 9999, message = "ver 字段最小值为 1", groups = ValidGroups.ProtocolCommonValid.class) private Integer ver; - /** - * msgContent字段内容编码格式 - */ @NotNull(message = "cryptoType 字段不能为空", groups = ValidGroups.ProtocolCommonValid.class) @Range(min = 0, max = 4, message = "cryptoType 字段取值为 [0, 4]" , groups = ValidGroups.ProtocolCommonValid.class) private Integer cryptoType; - /** - * 当前UTC时间戳(ms) - */ @NotNull(message = "timeStamp 字段不能为空", groups = ValidGroups.ProtocolCommonValid.class) @DecimalMin(value = "1595494343000", message = "timeStamp 字段值不能为过去时间" , groups = ValidGroups.ProtocolCommonValid.class) private Long timeStamp; - /** - * 协议详细内容 - */ @Valid private T msgContent; } diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseRespStatus.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseRespStatus.java index 209a4dd..6fad792 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseRespStatus.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/BaseRespStatus.java @@ -5,21 +5,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * The type Response status. - * - * @author + * The type Base resp status. */ @Data @AllArgsConstructor @NoArgsConstructor public class BaseRespStatus { - /** - * 0:成功;其它:失败原因. - */ private Integer status; - /** - * 登录消息: status状态码对应的提示信息 - */ private String[] message; } diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/ProtocolReqDTO.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/ProtocolReqDTO.java index 34f2cad..e14fa89 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/ProtocolReqDTO.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/ProtocolReqDTO.java @@ -12,7 +12,6 @@ import java.util.Objects; * The type Protocol req dto. * * @param the type parameter - * @author */ @NoArgsConstructor @ToString diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/ProtocolRespDTO.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/ProtocolRespDTO.java index be71175..5c54425 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/ProtocolRespDTO.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/base/ProtocolRespDTO.java @@ -16,7 +16,6 @@ import lombok.extern.slf4j.Slf4j; * The type Protocol resp dto. * * @param the type parameter - * @author */ @Slf4j @EqualsAndHashCode(callSuper = true) @@ -25,25 +24,10 @@ import lombok.extern.slf4j.Slf4j; @AllArgsConstructor @JsonPropertyOrder({"ver", "cryptoType", "timeStamp", "code", "msgContent"}) public class ProtocolRespDTO extends BaseProtocolDTO { - /** - * The constant OBJECT_MAPPER. - */ private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - /** - * The Code. - */ private Integer code; - /** - * Result protocol resp dto. - * - * @param the type parameter - * @param err the err - * @param httpCode the http code - * @param respMsg the resp msg - * @return the protocol resp dto - */ private static ProtocolRespDTO result(ErrorCode err, Integer httpCode, T respMsg) { ProtocolRespDTO resp = new ProtocolRespDTO<>(); diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameInfoContent.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameInfoContent.java index 4153115..33c424b 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameInfoContent.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameInfoContent.java @@ -11,6 +11,9 @@ import lombok.NoArgsConstructor; import java.util.List; +/** + * The type Game info content. + */ @EqualsAndHashCode(callSuper = true) @Data @Builder @@ -19,6 +22,9 @@ import java.util.List; @JsonPropertyOrder({"gameId", "name", "company", "gamesInfo", "status", "message"}) @JsonInclude(JsonInclude.Include.NON_NULL) public class GameInfoContent extends BaseRespStatus { + /** + * The Games info. + */ List gamesInfo; private Long gameId; private String name; diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameInfoDetail.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameInfoDetail.java index 351a246..a2f691a 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameInfoDetail.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameInfoDetail.java @@ -7,6 +7,9 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +/** + * The type Game info detail. + */ @Data @Builder @NoArgsConstructor diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameListSummary.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameListSummary.java index c7f0be7..1c5671d 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameListSummary.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameListSummary.java @@ -8,12 +8,18 @@ import lombok.NoArgsConstructor; import java.util.List; +/** + * The type Game list summary. + */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @JsonPropertyOrder({"gameId", "gamesFilename"}) public class GameListSummary { + /** + * The Games filename. + */ List gamesFilename; private Long gameId; } diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerContent.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerContent.java index d40a997..f2e6489 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerContent.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerContent.java @@ -14,6 +14,9 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.List; +/** + * The type Game server content. + */ @Data @Builder @NoArgsConstructor diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerDetail.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerDetail.java index b7d202d..89f8953 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerDetail.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerDetail.java @@ -15,6 +15,9 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +/** + * The type Game server detail. + */ @Data @Builder @NoArgsConstructor diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerRet.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerRet.java index 60c1401..3a8e745 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerRet.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerRet.java @@ -9,6 +9,9 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +/** + * The type Game server ret. + */ @EqualsAndHashCode(callSuper = true) @Data @Builder diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerRsp.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerRsp.java index 367590a..bf6e0db 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerRsp.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GameServerRsp.java @@ -11,6 +11,9 @@ import lombok.NoArgsConstructor; import java.util.List; +/** + * The type Game server rsp. + */ @EqualsAndHashCode(callSuper = true) @Data @Builder @@ -19,5 +22,8 @@ import java.util.List; @JsonPropertyOrder({"items", "status", "message"}) @JsonInclude(JsonInclude.Include.NON_NULL) public class GameServerRsp extends BaseRespStatus { + /** + * The Items. + */ List items; } diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGameInfoDetailReq.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGameInfoDetailReq.java index aa04cdf..6ead24c 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGameInfoDetailReq.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGameInfoDetailReq.java @@ -11,6 +11,9 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.List; +/** + * The type Get game info detail req. + */ @Data @Builder @NoArgsConstructor diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGamesInfoRsp.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGamesInfoRsp.java index 7e4ff99..7860f68 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGamesInfoRsp.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGamesInfoRsp.java @@ -11,6 +11,9 @@ import lombok.NoArgsConstructor; import java.util.List; +/** + * The type Get games info rsp. + */ @EqualsAndHashCode(callSuper = true) @Data @Builder @@ -19,5 +22,8 @@ import java.util.List; @JsonPropertyOrder({"items", "status", "message"}) @JsonInclude(JsonInclude.Include.NON_NULL) public class GetGamesInfoRsp extends BaseRespStatus { + /** + * The Items. + */ List items; } diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGamesSummaryRsp.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGamesSummaryRsp.java index 4fa13cf..2f06122 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGamesSummaryRsp.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/GetGamesSummaryRsp.java @@ -11,6 +11,9 @@ import lombok.NoArgsConstructor; import java.util.List; +/** + * The type Get games summary rsp. + */ @EqualsAndHashCode(callSuper = true) @Data @Builder @@ -19,5 +22,8 @@ import java.util.List; @JsonPropertyOrder({"items", "status", "message"}) @JsonInclude(JsonInclude.Include.NON_NULL) public class GetGamesSummaryRsp extends BaseRespStatus { + /** + * The Items. + */ List items; } diff --git a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/ReportGameServerReq.java b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/ReportGameServerReq.java index ff7aa51..e11c298 100644 --- a/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/ReportGameServerReq.java +++ b/src/main/java/com/cmhi/gds/pojo/dto/protocol/info/ReportGameServerReq.java @@ -11,6 +11,9 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.List; +/** + * The type Report game server req. + */ @Data @Builder @NoArgsConstructor diff --git a/src/main/java/com/cmhi/gds/pojo/entry/GameInfo.java b/src/main/java/com/cmhi/gds/pojo/entry/GameInfo.java index cfbcae3..8dd0ab1 100644 --- a/src/main/java/com/cmhi/gds/pojo/entry/GameInfo.java +++ b/src/main/java/com/cmhi/gds/pojo/entry/GameInfo.java @@ -14,6 +14,9 @@ import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; +/** + * The type Game info. + */ @Data @NoArgsConstructor @AllArgsConstructor @@ -23,14 +26,8 @@ import java.io.Serializable; @Table(name = "game_info") @NameStyle(Style.normal) public class GameInfo implements Serializable { - /** - * The constant serialVersionUID. - */ private static final long serialVersionUID = 1L; - /** - * The Id. - */ @Id @KeySql(useGeneratedKeys = true) private Long id; diff --git a/src/main/java/com/cmhi/gds/pojo/entry/GameServer.java b/src/main/java/com/cmhi/gds/pojo/entry/GameServer.java index 934afed..cf9c041 100644 --- a/src/main/java/com/cmhi/gds/pojo/entry/GameServer.java +++ b/src/main/java/com/cmhi/gds/pojo/entry/GameServer.java @@ -15,6 +15,9 @@ import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; +/** + * The type Game server. + */ @Data @NoArgsConstructor @AllArgsConstructor @@ -24,15 +27,9 @@ import java.io.Serializable; @Table(name = "game_server") @NameStyle(Style.normal) public class GameServer implements Serializable { - /** - * The constant serialVersionUID. - */ private static final long serialVersionUID = 1L; - /** - * The Id. - */ @Id @KeySql(useGeneratedKeys = true) private Long id; diff --git a/src/main/java/com/cmhi/gds/pojo/entry/GameTable.java b/src/main/java/com/cmhi/gds/pojo/entry/GameTable.java index 7535a56..6bfb2fb 100644 --- a/src/main/java/com/cmhi/gds/pojo/entry/GameTable.java +++ b/src/main/java/com/cmhi/gds/pojo/entry/GameTable.java @@ -14,6 +14,9 @@ import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; +/** + * The type Game table. + */ @Data @NoArgsConstructor @AllArgsConstructor @@ -23,14 +26,8 @@ import java.io.Serializable; @Table(name = "game_tables") @NameStyle(Style.normal) public class GameTable implements Serializable { - /** - * The constant serialVersionUID. - */ private static final long serialVersionUID = 1L; - /** - * The Id. - */ @Id @KeySql(useGeneratedKeys = true) private Long id; diff --git a/src/main/java/com/cmhi/gds/pojo/vo/GameDetail.java b/src/main/java/com/cmhi/gds/pojo/vo/GameDetail.java index f5b0f2c..21b847c 100644 --- a/src/main/java/com/cmhi/gds/pojo/vo/GameDetail.java +++ b/src/main/java/com/cmhi/gds/pojo/vo/GameDetail.java @@ -6,6 +6,9 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +/** + * The type Game detail. + */ @Data @AllArgsConstructor @NoArgsConstructor diff --git a/src/main/java/com/cmhi/gds/pojo/vo/GameSummary.java b/src/main/java/com/cmhi/gds/pojo/vo/GameSummary.java index 88daf39..3825b16 100644 --- a/src/main/java/com/cmhi/gds/pojo/vo/GameSummary.java +++ b/src/main/java/com/cmhi/gds/pojo/vo/GameSummary.java @@ -5,6 +5,9 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +/** + * The type Game summary. + */ @Data @NoArgsConstructor @AllArgsConstructor diff --git a/src/main/java/com/cmhi/gds/pojo/vo/GameTableItemsDetail.java b/src/main/java/com/cmhi/gds/pojo/vo/GameTableItemsDetail.java index 3bdf401..1f010e7 100644 --- a/src/main/java/com/cmhi/gds/pojo/vo/GameTableItemsDetail.java +++ b/src/main/java/com/cmhi/gds/pojo/vo/GameTableItemsDetail.java @@ -8,12 +8,18 @@ import lombok.NoArgsConstructor; import java.util.List; +/** + * The type Game table items detail. + */ @Data @AllArgsConstructor @NoArgsConstructor @Builder @JsonInclude(JsonInclude.Include.NON_NULL) public class GameTableItemsDetail { + /** + * The Game details. + */ List gameDetails; private Long gameId; diff --git a/src/main/java/com/cmhi/gds/pojo/vo/GameTableItemsSummary.java b/src/main/java/com/cmhi/gds/pojo/vo/GameTableItemsSummary.java index 0bd1794..47e7814 100644 --- a/src/main/java/com/cmhi/gds/pojo/vo/GameTableItemsSummary.java +++ b/src/main/java/com/cmhi/gds/pojo/vo/GameTableItemsSummary.java @@ -8,6 +8,9 @@ import lombok.NoArgsConstructor; import java.util.List; +/** + * The type Game table items summary. + */ @Data @AllArgsConstructor @NoArgsConstructor diff --git a/src/main/java/com/cmhi/gds/pojo/vo/GameTableSummary.java b/src/main/java/com/cmhi/gds/pojo/vo/GameTableSummary.java index 0b50369..f66c07f 100644 --- a/src/main/java/com/cmhi/gds/pojo/vo/GameTableSummary.java +++ b/src/main/java/com/cmhi/gds/pojo/vo/GameTableSummary.java @@ -8,6 +8,9 @@ import lombok.NoArgsConstructor; import java.util.List; +/** + * The type Game table summary. + */ @Data @NoArgsConstructor @AllArgsConstructor diff --git a/src/main/java/com/cmhi/gds/security/annotation/Decryption.java b/src/main/java/com/cmhi/gds/security/annotation/Decryption.java index 184f459..1720d26 100644 --- a/src/main/java/com/cmhi/gds/security/annotation/Decryption.java +++ b/src/main/java/com/cmhi/gds/security/annotation/Decryption.java @@ -7,8 +7,6 @@ import java.lang.annotation.Target; /** * The interface Decryption. - * - * @author */ @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/com/cmhi/gds/security/annotation/Encryption.java b/src/main/java/com/cmhi/gds/security/annotation/Encryption.java index 51e71ce..2b3c9d8 100644 --- a/src/main/java/com/cmhi/gds/security/annotation/Encryption.java +++ b/src/main/java/com/cmhi/gds/security/annotation/Encryption.java @@ -7,8 +7,6 @@ import java.lang.annotation.Target; /** * The interface Encryption. - * - * @author */ @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/com/cmhi/gds/security/arithmetic/CryptoHelper.java b/src/main/java/com/cmhi/gds/security/arithmetic/CryptoHelper.java index ddeac8e..e6c453e 100644 --- a/src/main/java/com/cmhi/gds/security/arithmetic/CryptoHelper.java +++ b/src/main/java/com/cmhi/gds/security/arithmetic/CryptoHelper.java @@ -17,27 +17,16 @@ import java.security.SecureRandom; /** * The type Crypto helper. - * - * @author */ @Slf4j public class CryptoHelper { - /** - * Instantiates a new Crypto helper. - */ private CryptoHelper() { throw new AssertionError("Instantiating utility class."); } - /** - * The constant AES_ALGORITHM_STR. - */ 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"; /** diff --git a/src/main/java/com/cmhi/gds/security/configure/EncryptionPropertyResolver.java b/src/main/java/com/cmhi/gds/security/configure/EncryptionPropertyResolver.java index 1888bf4..2a6db3c 100644 --- a/src/main/java/com/cmhi/gds/security/configure/EncryptionPropertyResolver.java +++ b/src/main/java/com/cmhi/gds/security/configure/EncryptionPropertyResolver.java @@ -14,14 +14,9 @@ import org.apache.commons.lang.StringUtils; /** * The type Encryption property resolver. - * - * @author */ @Slf4j public class EncryptionPropertyResolver implements EncryptablePropertyResolver { - /** - * The Password. - */ private final String password; /** @@ -33,12 +28,6 @@ public class EncryptionPropertyResolver implements EncryptablePropertyResolver { this.password = key + "cmcc@10086!"; } - /** - * Resolve property value string. - * - * @param value the value - * @return the string - */ @Override public String resolvePropertyValue(String value) { final String encPrefix = "ENC@"; @@ -57,12 +46,6 @@ public class EncryptionPropertyResolver implements EncryptablePropertyResolver { return value; } - /** - * Resolve value string. - * - * @param value the value - * @return the string - */ private String resolveValue(String value) throws IllegalBlockSizeException, InvalidKeyException, BadPaddingException, NoSuchAlgorithmException, NoSuchPaddingException { //自定义密文解密 diff --git a/src/main/java/com/cmhi/gds/security/protocol/DecryptRequestProtocol.java b/src/main/java/com/cmhi/gds/security/protocol/DecryptRequestProtocol.java index c83ae34..e03d815 100644 --- a/src/main/java/com/cmhi/gds/security/protocol/DecryptRequestProtocol.java +++ b/src/main/java/com/cmhi/gds/security/protocol/DecryptRequestProtocol.java @@ -13,20 +13,12 @@ import java.nio.charset.StandardCharsets; /** * The type Decrypt request protocol. - * - * @author */ @Slf4j public class DecryptRequestProtocol implements HttpInputMessage { - /** - * The Input message. - */ private final HttpInputMessage inputMessage; - /** - * The Msg content. - */ private final String msgContent; /** @@ -41,11 +33,6 @@ public class DecryptRequestProtocol implements HttpInputMessage { this.msgContent = msgContent; } - /** - * Gets body. - * - * @return the body - */ @Override @NotNull public InputStream getBody() throws IOException { @@ -53,11 +40,6 @@ public class DecryptRequestProtocol implements HttpInputMessage { return IOUtils.toInputStream(msgContent, StandardCharsets.UTF_8.toString()); } - /** - * Gets headers. - * - * @return the headers - */ @Override @NotNull public HttpHeaders getHeaders() { diff --git a/src/main/java/com/cmhi/gds/service/GameDatabaseServiceService.java b/src/main/java/com/cmhi/gds/service/GameDatabaseServiceService.java index 0ffffe9..eaf9328 100644 --- a/src/main/java/com/cmhi/gds/service/GameDatabaseServiceService.java +++ b/src/main/java/com/cmhi/gds/service/GameDatabaseServiceService.java @@ -8,11 +8,31 @@ import com.cmhi.gds.pojo.vo.GameTableItemsSummary; import java.util.List; import java.util.Map; +/** + * The interface Game database service service. + */ public interface GameDatabaseServiceService { + /** + * Gets game table summary items. + * + * @return the game table summary items + */ List getGameTableSummaryItems(); + /** + * Gets game table items. + * + * @param gameIds the game ids + * @return the game table items + */ List getGameTableItems(List gameIds); + /** + * Add game server info map. + * + * @param gameServerContents the game server contents + * @return the map + */ Map addGameServerInfo(List gameServerContents); } diff --git a/src/main/java/com/cmhi/gds/service/ProtocolSecurityService.java b/src/main/java/com/cmhi/gds/service/ProtocolSecurityService.java index 3d98dc4..f701127 100644 --- a/src/main/java/com/cmhi/gds/service/ProtocolSecurityService.java +++ b/src/main/java/com/cmhi/gds/service/ProtocolSecurityService.java @@ -9,8 +9,6 @@ import java.io.IOException; /** * The interface Protocol security service. - * - * @author */ public interface ProtocolSecurityService { /** diff --git a/src/main/java/com/cmhi/gds/service/impl/GameDatabaseServiceServiceImpl.java b/src/main/java/com/cmhi/gds/service/impl/GameDatabaseServiceServiceImpl.java index 424acfd..c0af1bd 100644 --- a/src/main/java/com/cmhi/gds/service/impl/GameDatabaseServiceServiceImpl.java +++ b/src/main/java/com/cmhi/gds/service/impl/GameDatabaseServiceServiceImpl.java @@ -24,6 +24,9 @@ import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; +/** + * The type Game database service service. + */ @Service @Slf4j public class GameDatabaseServiceServiceImpl implements GameDatabaseServiceService { diff --git a/src/main/java/com/cmhi/gds/service/impl/ProtocolSecurityServiceImpl.java b/src/main/java/com/cmhi/gds/service/impl/ProtocolSecurityServiceImpl.java index ec5a7e8..6df700b 100644 --- a/src/main/java/com/cmhi/gds/service/impl/ProtocolSecurityServiceImpl.java +++ b/src/main/java/com/cmhi/gds/service/impl/ProtocolSecurityServiceImpl.java @@ -29,25 +29,13 @@ import java.nio.charset.StandardCharsets; /** * The type Protocol security service. - * - * @author */ @Service @Slf4j public class ProtocolSecurityServiceImpl implements ProtocolSecurityService { - /** - * The Object mapper. - */ @Resource private ObjectMapper objectMapper; - /** - * Decrypt protocol string. - * - * @param ciphertext the ciphertext - * @return the string - * @throws JsonProcessingException the json processing exception - */ @Override public String decryptProtocol(String ciphertext) throws JsonProcessingException { JsonNode objRoot = objectMapper.readTree(ciphertext); @@ -125,13 +113,6 @@ public class ProtocolSecurityServiceImpl implements ProtocolSecurityService { 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 public DecryptRequestProtocol decryptProtocol(HttpInputMessage httpInputMessage) throws IOException { // 提取协议中的JSON字符串 @@ -140,13 +121,6 @@ public class ProtocolSecurityServiceImpl implements ProtocolSecurityService { return new DecryptRequestProtocol(httpInputMessage, decryptProtocol(reqMessage)); } - /** - * Encrypt protocol string string. - * - * @param plainText the plain text - * @param cryptoType the crypto type - * @return the string - */ @Override public String encryptProtocolString(String plainText, int cryptoType) { 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 public ProtocolRespDTO encryptProtocol(Object orgProtocol, int cryptoType) { ProtocolRespDTO cryptoObject = new ProtocolRespDTO<>(); diff --git a/src/main/java/com/cmhi/gds/validation/group/ValidGroups.java b/src/main/java/com/cmhi/gds/validation/group/ValidGroups.java index 31b1fd0..c52d9d3 100644 --- a/src/main/java/com/cmhi/gds/validation/group/ValidGroups.java +++ b/src/main/java/com/cmhi/gds/validation/group/ValidGroups.java @@ -2,110 +2,82 @@ package com.cmhi.gds.validation.group; /** * The interface Valid groups. - * - * @author */ public interface ValidGroups { /** * The interface Protocol common valid. - * - * @author */ interface ProtocolCommonValid { } /** * The interface Login req valid. - * - * @author */ interface LoginReqValid extends LogoutReqValid { } /** * The interface Logout req valid. - * - * @author */ interface LogoutReqValid extends ProtocolCommonValid { } /** - * The interface Upgrade device valid. - * - * @author + * The interface Add game service valid. */ interface AddGameServiceValid extends ProtocolCommonValid { } /** * The interface Add device valid. - * - * @author */ interface AddDeviceValid extends AddGameServiceValid { } /** * The interface Id array valid. - * - * @author */ interface IdArrayValid extends ProtocolCommonValid { } /** * The interface Explicit id array valid. - * - * @author */ interface ExplicitIdArrayValid extends IdArrayValid { } /** * The interface Task start req common valid. - * - * @author */ interface TaskStartReqCommonValid extends ProtocolCommonValid { } /** * The interface Task start req valid. - * - * @author */ interface TaskStartReqValid extends TaskStartReqCommonValid { } /** * The interface Task start mul req valid. - * - * @author */ interface TaskStartMulReqValid extends TaskStartReqCommonValid { } /** * The interface Task stop req valid. - * - * @author */ interface TaskStopReqValid extends ProtocolCommonValid { } /** * The interface Get dev ver req valid. - * - * @author */ interface GetDevVerReqValid extends ProtocolCommonValid { } /** - * The interface Add device valid. - * - * @author + * The interface Add user info valid. */ interface AddUserInfoValid extends ProtocolCommonValid { } diff --git a/src/main/java/com/cmhi/gds/validation/valids/ValidBaseEnum.java b/src/main/java/com/cmhi/gds/validation/valids/ValidBaseEnum.java index 5fff059..3b05bca 100644 --- a/src/main/java/com/cmhi/gds/validation/valids/ValidBaseEnum.java +++ b/src/main/java/com/cmhi/gds/validation/valids/ValidBaseEnum.java @@ -12,9 +12,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * The interface Valid custom base enum. - * - * @author + * The interface Valid base enum. */ @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/com/cmhi/gds/validation/valids/ValidIpAddr.java b/src/main/java/com/cmhi/gds/validation/valids/ValidIpAddr.java index 03ad9cf..e9e664c 100644 --- a/src/main/java/com/cmhi/gds/validation/valids/ValidIpAddr.java +++ b/src/main/java/com/cmhi/gds/validation/valids/ValidIpAddr.java @@ -12,8 +12,6 @@ import java.lang.annotation.Target; /** * The interface Valid ip addr. - * - * @author */ @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/com/cmhi/gds/validation/valids/ValidIpPort.java b/src/main/java/com/cmhi/gds/validation/valids/ValidIpPort.java index a9a4064..5b7a9c1 100644 --- a/src/main/java/com/cmhi/gds/validation/valids/ValidIpPort.java +++ b/src/main/java/com/cmhi/gds/validation/valids/ValidIpPort.java @@ -12,8 +12,6 @@ import java.lang.annotation.Target; /** * The interface Valid ip port. - * - * @author */ @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/com/cmhi/gds/validation/valids/impl/ValidBaseEnumImpl.java b/src/main/java/com/cmhi/gds/validation/valids/impl/ValidBaseEnumImpl.java index 2c59c57..dc49185 100644 --- a/src/main/java/com/cmhi/gds/validation/valids/impl/ValidBaseEnumImpl.java +++ b/src/main/java/com/cmhi/gds/validation/valids/impl/ValidBaseEnumImpl.java @@ -14,41 +14,21 @@ import java.util.List; import java.util.stream.Collectors; /** - * The type Valid custom base enum. - * - * @author + * The type Valid base enum. */ @Slf4j public class ValidBaseEnumImpl implements ConstraintValidator { - /** - * The Enum class. - */ private Class enumClass; - /** - * The Message. - */ private String message; - /** - * Initialize. - * - * @param constraintAnnotation the constraint annotation - */ @Override public void initialize(ValidBaseEnum constraintAnnotation) { this.enumClass = constraintAnnotation.enumClass(); this.message = constraintAnnotation.message(); } - /** - * Is valid boolean. - * - * @param integer the integer - * @param ctx the constraint validator context - * @return the boolean - */ @Override public boolean isValid(Integer integer, ConstraintValidatorContext ctx) { diff --git a/src/main/java/com/cmhi/gds/validation/valids/impl/ValidIpAddrImpl.java b/src/main/java/com/cmhi/gds/validation/valids/impl/ValidIpAddrImpl.java index 767207c..1b9fbd6 100644 --- a/src/main/java/com/cmhi/gds/validation/valids/impl/ValidIpAddrImpl.java +++ b/src/main/java/com/cmhi/gds/validation/valids/impl/ValidIpAddrImpl.java @@ -11,27 +11,13 @@ import java.util.regex.Pattern; /** * The type Valid ip addr. - * - * @author */ public class ValidIpAddrImpl implements ConstraintValidator { - /** - * Initialize. - * - * @param constraintAnnotation the constraint annotation - */ @Override public void initialize(ValidIpAddr constraintAnnotation) { } - /** - * Is valid boolean. - * - * @param s the s - * @param constraintValidatorContext the constraint validator context - * @return the boolean - */ @Override public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) { diff --git a/src/main/java/com/cmhi/gds/validation/valids/impl/ValidIpPortImpl.java b/src/main/java/com/cmhi/gds/validation/valids/impl/ValidIpPortImpl.java index 9901aeb..ea663f9 100644 --- a/src/main/java/com/cmhi/gds/validation/valids/impl/ValidIpPortImpl.java +++ b/src/main/java/com/cmhi/gds/validation/valids/impl/ValidIpPortImpl.java @@ -9,27 +9,13 @@ import javax.validation.ConstraintValidatorContext; /** * The type Valid ip port. - * - * @author */ public class ValidIpPortImpl implements ConstraintValidator { - /** - * Initialize. - * - * @param constraintAnnotation the constraint annotation - */ @Override public void initialize(ValidIpPort constraintAnnotation) { } - /** - * Is valid boolean. - * - * @param s the s - * @param constraintValidatorContext the constraint validator context - * @return the boolean - */ @Override public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) { final int minSocketPort = 1;