From 2ce9f39bcf07b6453c2820f65c45e3652e657fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=BE=89?= Date: Thu, 4 Aug 2022 11:22:44 +0800 Subject: [PATCH] Add @Override for method --- src/main/java/org/edgegallery/user/auth/MainServer.java | 5 +++-- .../user/auth/config/security/AuthServerConfig.java | 2 +- .../config/validate/AbstractCheckParamsGenericUtils.java | 1 + .../auth/controller/dto/request/BaseTenantBasicReqDto.java | 1 + .../auth/controller/dto/request/ModifyPasswordReqDto.java | 1 + .../user/auth/controller/dto/request/QueryUserCtrlDto.java | 1 + .../user/auth/controller/dto/request/QueryUserReqDto.java | 1 + .../auth/controller/dto/request/TenantRegisterReqDto.java | 1 + .../java/org/edgegallery/user/auth/db/entity/RolePo.java | 1 + 9 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/edgegallery/user/auth/MainServer.java b/src/main/java/org/edgegallery/user/auth/MainServer.java index e26335b..d17f90d 100644 --- a/src/main/java/org/edgegallery/user/auth/MainServer.java +++ b/src/main/java/org/edgegallery/user/auth/MainServer.java @@ -48,14 +48,15 @@ public class MainServer { // do not check host name TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { + @Override public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0]; } - + @Override public void checkClientTrusted(X509Certificate[] certs, String authType) { LOGGER.info("checks client trusted"); } - + @Override public void checkServerTrusted(X509Certificate[] certs, String authType) { LOGGER.info("checks server trusted"); } diff --git a/src/main/java/org/edgegallery/user/auth/config/security/AuthServerConfig.java b/src/main/java/org/edgegallery/user/auth/config/security/AuthServerConfig.java index 64e909d..0c1517a 100644 --- a/src/main/java/org/edgegallery/user/auth/config/security/AuthServerConfig.java +++ b/src/main/java/org/edgegallery/user/auth/config/security/AuthServerConfig.java @@ -207,7 +207,7 @@ public class AuthServerConfig extends AuthorizationServerConfigurerAdapter { public TokenGranter tokenGranter(AuthorizationServerEndpointsConfigurer endpoints) { return new TokenGranter() { private CompositeTokenGranter delegate; - + @Override public OAuth2AccessToken grant(String grantType, TokenRequest tokenRequest) { if (this.delegate == null) { this.delegate = new CompositeTokenGranter(loadDefaultTokenGranters(endpoints)); diff --git a/src/main/java/org/edgegallery/user/auth/config/validate/AbstractCheckParamsGenericUtils.java b/src/main/java/org/edgegallery/user/auth/config/validate/AbstractCheckParamsGenericUtils.java index c8b2ff2..6f89f55 100644 --- a/src/main/java/org/edgegallery/user/auth/config/validate/AbstractCheckParamsGenericUtils.java +++ b/src/main/java/org/edgegallery/user/auth/config/validate/AbstractCheckParamsGenericUtils.java @@ -24,6 +24,7 @@ public abstract class AbstractCheckParamsGenericUtils implements ICheckParams { /** * check data. */ + @Override public Either checkData() { Either format = checkDataFormat(); if (format.isRight()) { diff --git a/src/main/java/org/edgegallery/user/auth/controller/dto/request/BaseTenantBasicReqDto.java b/src/main/java/org/edgegallery/user/auth/controller/dto/request/BaseTenantBasicReqDto.java index 657f266..e062756 100644 --- a/src/main/java/org/edgegallery/user/auth/controller/dto/request/BaseTenantBasicReqDto.java +++ b/src/main/java/org/edgegallery/user/auth/controller/dto/request/BaseTenantBasicReqDto.java @@ -50,6 +50,7 @@ public abstract class BaseTenantBasicReqDto extends AbstractCheckParamsGenericUt /** * check basic data by trim. */ + @Override public void stringTrim() { this.username = StringUtils.trimWhitespace(this.username); this.company = StringUtils.trimWhitespace(this.company); diff --git a/src/main/java/org/edgegallery/user/auth/controller/dto/request/ModifyPasswordReqDto.java b/src/main/java/org/edgegallery/user/auth/controller/dto/request/ModifyPasswordReqDto.java index 6f2d4d0..1d38f15 100644 --- a/src/main/java/org/edgegallery/user/auth/controller/dto/request/ModifyPasswordReqDto.java +++ b/src/main/java/org/edgegallery/user/auth/controller/dto/request/ModifyPasswordReqDto.java @@ -70,6 +70,7 @@ public class ModifyPasswordReqDto extends AbstractCheckParamsGenericUtils implem /** * check basic data by trim. */ + @Override public void stringTrim() { this.newPassword = StringUtils.trimWhitespace(this.newPassword); diff --git a/src/main/java/org/edgegallery/user/auth/controller/dto/request/QueryUserCtrlDto.java b/src/main/java/org/edgegallery/user/auth/controller/dto/request/QueryUserCtrlDto.java index 8ef6162..dc0d547 100644 --- a/src/main/java/org/edgegallery/user/auth/controller/dto/request/QueryUserCtrlDto.java +++ b/src/main/java/org/edgegallery/user/auth/controller/dto/request/QueryUserCtrlDto.java @@ -51,6 +51,7 @@ public class QueryUserCtrlDto extends AbstractCheckParamsGenericUtils implements /** * check basic data by trim. */ + @Override public void stringTrim() { this.sortBy = StringUtils.trimWhitespace(this.sortBy); if (StringUtils.isEmpty(this.sortBy)) { diff --git a/src/main/java/org/edgegallery/user/auth/controller/dto/request/QueryUserReqDto.java b/src/main/java/org/edgegallery/user/auth/controller/dto/request/QueryUserReqDto.java index c0d0563..bfe67bc 100644 --- a/src/main/java/org/edgegallery/user/auth/controller/dto/request/QueryUserReqDto.java +++ b/src/main/java/org/edgegallery/user/auth/controller/dto/request/QueryUserReqDto.java @@ -65,6 +65,7 @@ public class QueryUserReqDto extends AbstractCheckParamsGenericUtils implements /** * check basic data by trim. */ + @Override public void stringTrim() { this.username = StringUtils.trimWhitespace(this.username); this.mailAddress = StringUtils.trimWhitespace(this.mailAddress); diff --git a/src/main/java/org/edgegallery/user/auth/controller/dto/request/TenantRegisterReqDto.java b/src/main/java/org/edgegallery/user/auth/controller/dto/request/TenantRegisterReqDto.java index 77938dc..d8992e4 100644 --- a/src/main/java/org/edgegallery/user/auth/controller/dto/request/TenantRegisterReqDto.java +++ b/src/main/java/org/edgegallery/user/auth/controller/dto/request/TenantRegisterReqDto.java @@ -37,6 +37,7 @@ public class TenantRegisterReqDto extends BaseTenantBasicReqDto implements IStri /** * check basic data by trim. */ + @Override public void stringTrim() { super.stringTrim(); this.password = StringUtils.trimWhitespace(this.password); diff --git a/src/main/java/org/edgegallery/user/auth/db/entity/RolePo.java b/src/main/java/org/edgegallery/user/auth/db/entity/RolePo.java index 7c1c688..f4312ae 100644 --- a/src/main/java/org/edgegallery/user/auth/db/entity/RolePo.java +++ b/src/main/java/org/edgegallery/user/auth/db/entity/RolePo.java @@ -52,6 +52,7 @@ public class RolePo { this.role = role; } + @Override public String toString() { return platform + "_" + role; } -- Gitee