代码优化

This commit is contained in:
shimingxy 2024-08-13 12:18:34 +08:00
parent feb71561a3
commit 30711097d3
27 changed files with 31 additions and 67 deletions

View File

@ -43,10 +43,10 @@ public class ImageCaptchaEndpoint {
private static final Logger _logger = LoggerFactory.getLogger(ImageCaptchaEndpoint.class);
@Autowired
private Producer captchaProducer;
Producer captchaProducer;
@Autowired
protected MomentaryService momentaryService;
MomentaryService momentaryService;
@Autowired
AuthTokenService authTokenService;

View File

@ -49,7 +49,7 @@ public class RestUserInfoController {
@Autowired
@Qualifier("userInfoService")
private UserInfoService userInfoService;
UserInfoService userInfoService;
@GetMapping(value = "/{id}")
public UserInfo getUser(

View File

@ -41,7 +41,7 @@ public class RestUserPasswordController {
@Autowired
@Qualifier("userInfoService")
private UserInfoService userInfoService;
UserInfoService userInfoService;
@PostMapping(value = "/changePassword")

View File

@ -69,7 +69,7 @@ import org.springframework.web.util.UriComponentsBuilder;
public class ScimUserController {
static final Logger _logger = LoggerFactory.getLogger(ScimUserController.class);
@Autowired
private UserInfoService userInfoService;
UserInfoService userInfoService;
@Autowired
GroupsService groupsService;

View File

@ -1,18 +0,0 @@
/*
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.maxkey.web.access.contorller;

View File

@ -52,7 +52,7 @@ public class AppListController {
static final Logger logger = LoggerFactory.getLogger(AppListController.class);
@Autowired
private UserInfoService userInfoService;
UserInfoService userInfoService;
@Autowired
AccountsService accountsService;

View File

@ -42,13 +42,13 @@ public class ChangePasswodController {
static final Logger logger = LoggerFactory.getLogger(ChangePasswodController.class);
@Autowired
private UserInfoService userInfoService;
UserInfoService userInfoService;
@Autowired
HistorySystemLogsService systemLog;
@Autowired
private CnfPasswordPolicyService passwordPolicyService;
CnfPasswordPolicyService passwordPolicyService;
@GetMapping(value={"/passwordpolicy"})
public Message<CnfPasswordPolicy> passwordpolicy(@CurrentUser UserInfo currentUser){

View File

@ -87,7 +87,7 @@ public class ForgotPasswordContorller {
HistorySystemLogsService historySystemLogsService;
@Autowired
private CnfPasswordPolicyService passwordPolicyService;
CnfPasswordPolicyService passwordPolicyService;
@RequestMapping(value={"/passwordpolicy"}, produces = {MediaType.APPLICATION_JSON_VALUE})
public Message<CnfPasswordPolicy> passwordpolicy(){

View File

@ -54,13 +54,13 @@ public class OneTimePasswordController {
static final Logger logger = LoggerFactory.getLogger(OneTimePasswordController.class);
@Autowired
private UserInfoService userInfoService;
UserInfoService userInfoService;
@Autowired
OtpKeyUriFormat otpKeyUriFormat;
@Autowired
private TimeBasedOtpAuthn timeBasedOtpAuthn;
TimeBasedOtpAuthn timeBasedOtpAuthn;
@RequestMapping(value = {"/timebased"})
@ResponseBody

View File

@ -40,7 +40,7 @@ public class ProfileController {
static final Logger logger = LoggerFactory.getLogger(ProfileController.class);
@Autowired
private UserInfoService userInfoService;
UserInfoService userInfoService;
@Autowired
FileUploadService fileUploadService;

View File

@ -57,16 +57,16 @@ public class RegisterController {
AuthTokenService authTokenService;
@Autowired
protected ApplicationConfig applicationConfig;
ApplicationConfig applicationConfig;
@Autowired
private UserInfoService userInfoService;
UserInfoService userInfoService;
@Autowired
SmsOtpAuthnService smsOtpAuthnService;
@Autowired
private PasswordEncoder passwordEncoder;
PasswordEncoder passwordEncoder;
@ResponseBody
@RequestMapping(value = { "/produceOtp" }, produces = {MediaType.APPLICATION_JSON_VALUE})

View File

@ -43,7 +43,7 @@ public class SafeController {
static final Logger logger = LoggerFactory.getLogger(SafeController.class);
@Autowired
private UserInfoService userInfoService;
UserInfoService userInfoService;
@RequestMapping(value="/forward/setting")
public ModelAndView fowardSetting(@CurrentUser UserInfo currentUser) {

View File

@ -42,7 +42,7 @@ public class SocialSignOnListController {
static final Logger logger = LoggerFactory.getLogger(SocialSignOnListController.class);
@Autowired
protected SocialsAssociatesService socialsAssociatesService;
SocialsAssociatesService socialsAssociatesService;
@RequestMapping(value={"/fetch"})
@ResponseBody

View File

@ -51,7 +51,7 @@ public class LoginAppsHistoryController {
static final Logger logger = LoggerFactory.getLogger(LoginAppsHistoryController.class);
@Autowired
protected HistoryLoginAppsService historyLoginAppsService;
HistoryLoginAppsService historyLoginAppsService;
/**
* @param loginAppsHistory

View File

@ -1,18 +0,0 @@
/*
* Copyright [2021] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.maxkey.web.historys.contorller;

View File

@ -46,7 +46,7 @@ public class HistorySignOnAppInterceptor implements AsyncHandlerInterceptor {
HistoryLoginAppsService historyLoginAppsService;
@Autowired
protected AppsService appsService;
AppsService appsService;
/**
* postHandle .

View File

@ -62,7 +62,7 @@ public class SAML20DetailsController extends BaseAppContorller {
static final Logger logger = LoggerFactory.getLogger(SAML20DetailsController.class);
@Autowired
private KeyStoreLoader keyStoreLoader;
KeyStoreLoader keyStoreLoader;
@Autowired
AppsSaml20DetailsService saml20DetailsService;

View File

@ -39,7 +39,7 @@ public class CnfEmailSendersController {
static final Logger logger = LoggerFactory.getLogger(CnfEmailSendersController.class);
@Autowired
private CnfEmailSendersService emailSendersService;
CnfEmailSendersService emailSendersService;
@RequestMapping(value={"/get"})
public Message<?> get(@CurrentUser UserInfo currentUser){

View File

@ -42,7 +42,7 @@ public class CnfLdapContextController {
static final Logger logger = LoggerFactory.getLogger(CnfLdapContextController.class);
@Autowired
private CnfLdapContextService ldapContextService;
CnfLdapContextService ldapContextService;
@RequestMapping(value={"/get"}, produces = {MediaType.APPLICATION_JSON_VALUE})
public Message<?> get(@CurrentUser UserInfo currentUser){

View File

@ -41,7 +41,7 @@ public class CnfPasswordPolicyController {
static final Logger logger = LoggerFactory.getLogger(CnfPasswordPolicyController.class);
@Autowired
private CnfPasswordPolicyService passwordPolicyService;
CnfPasswordPolicyService passwordPolicyService;
@RequestMapping(value={"/get"}, produces = {MediaType.APPLICATION_JSON_VALUE})
public Message<?> get(@CurrentUser UserInfo currentUser){

View File

@ -40,7 +40,7 @@ public class CnfSmsProviderController {
static final Logger logger = LoggerFactory.getLogger(CnfSmsProviderController.class);
@Autowired
private CnfSmsProviderService smsProviderService;
CnfSmsProviderService smsProviderService;
@RequestMapping(value={"/get"}, produces = {MediaType.APPLICATION_JSON_VALUE})
public Message<?> get(@CurrentUser UserInfo currentUser){

View File

@ -37,7 +37,7 @@ public class InstitutionsController {
static final Logger logger = LoggerFactory.getLogger(InstitutionsController.class);
@Autowired
private InstitutionsService institutionsService;
InstitutionsService institutionsService;
@RequestMapping(value={"/get"}, produces = {MediaType.APPLICATION_JSON_VALUE})
public Message<?> get(@CurrentUser UserInfo currentUser){

View File

@ -51,7 +51,7 @@ public class LoginEntryPoint {
AuthTokenService authTokenService;
@Autowired
protected ApplicationConfig applicationConfig;
ApplicationConfig applicationConfig;
@Autowired
AbstractAuthenticationProvider authenticationProvider ;

View File

@ -33,7 +33,7 @@ public class LogoutEndpoint {
private static Logger logger = LoggerFactory.getLogger(LogoutEndpoint.class);
@Autowired
protected SessionManager sessionManager;
SessionManager sessionManager;
@GetMapping(value={"/logout"})
public Message<?> logout(HttpServletRequest request,@CurrentUser UserInfo currentUser){

View File

@ -46,7 +46,7 @@ public class LoginAppsHistoryController {
static final Logger logger = LoggerFactory.getLogger(LoginAppsHistoryController.class);
@Autowired
protected HistoryLoginAppsService historyLoginAppsService;
HistoryLoginAppsService historyLoginAppsService;
/**
* @param loginAppsHistory

View File

@ -77,7 +77,7 @@ public class UserInfoController {
static final Logger logger = LoggerFactory.getLogger(UserInfoController.class);
@Autowired
private UserInfoService userInfoService;
UserInfoService userInfoService;
@Autowired
FileUploadService fileUploadService;

View File

@ -35,10 +35,10 @@ import io.swagger.v3.oas.annotations.tags.Tag;
public class RestTimeBasedOtpController {
@Autowired
protected AbstractOtpAuthn timeBasedOtpAuthn;
AbstractOtpAuthn timeBasedOtpAuthn;
@Autowired
private UserInfoService userInfoService;
UserInfoService userInfoService;
@Operation(summary = "基于时间令牌验证 API文档模块", description = "传递参数username和token",method="GET")
@ResponseBody