sonarqube质量修复

This commit is contained in:
gaoqr
2025-10-29 15:54:09 +08:00
parent f1ac0bf2a4
commit d679409fbd
27 changed files with 75 additions and 137 deletions
@@ -157,6 +157,9 @@ public class SecurityFrameworkUtils {
*/
public static boolean isSuperAdmin() {
LoginUser loginUser = getLoginUser();
if (loginUser == null) {
throw new ServiceException(GlobalErrorCodeConstants.UNAUTHORIZED);
}
return ObjectUtil.isNotNull(loginUser) && loginUser.getIsSupAdmin();
}
@@ -167,6 +170,9 @@ public class SecurityFrameworkUtils {
*/
public static boolean isManageEndPoint() {
LoginUser loginUser = getLoginUser();
if (loginUser == null) {
throw new ServiceException(GlobalErrorCodeConstants.UNAUTHORIZED);
}
return Objects.equals(loginUser.getUserType(), UserTypeEnum.ADMIN.getValue());
}
@@ -186,7 +192,7 @@ public class SecurityFrameworkUtils {
*/
public static Long getProductId() {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
if (loginUser == null) {
throw new ServiceException(GlobalErrorCodeConstants.UNAUTHORIZED);
}
return loginUser.getProductId();