代码优化

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); private static final Logger _logger = LoggerFactory.getLogger(ImageCaptchaEndpoint.class);
@Autowired @Autowired
private Producer captchaProducer; Producer captchaProducer;
@Autowired @Autowired
protected MomentaryService momentaryService; MomentaryService momentaryService;
@Autowired @Autowired
AuthTokenService authTokenService; AuthTokenService authTokenService;

View File

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

View File

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

View File

@ -69,7 +69,7 @@ import org.springframework.web.util.UriComponentsBuilder;
public class ScimUserController { public class ScimUserController {
static final Logger _logger = LoggerFactory.getLogger(ScimUserController.class); static final Logger _logger = LoggerFactory.getLogger(ScimUserController.class);
@Autowired @Autowired
private UserInfoService userInfoService; UserInfoService userInfoService;
@Autowired @Autowired
GroupsService groupsService; 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); static final Logger logger = LoggerFactory.getLogger(AppListController.class);
@Autowired @Autowired
private UserInfoService userInfoService; UserInfoService userInfoService;
@Autowired @Autowired
AccountsService accountsService; AccountsService accountsService;

View File

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

View File

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

View File

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

View File

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

View File

@ -57,16 +57,16 @@ public class RegisterController {
AuthTokenService authTokenService; AuthTokenService authTokenService;
@Autowired @Autowired
protected ApplicationConfig applicationConfig; ApplicationConfig applicationConfig;
@Autowired @Autowired
private UserInfoService userInfoService; UserInfoService userInfoService;
@Autowired @Autowired
SmsOtpAuthnService smsOtpAuthnService; SmsOtpAuthnService smsOtpAuthnService;
@Autowired @Autowired
private PasswordEncoder passwordEncoder; PasswordEncoder passwordEncoder;
@ResponseBody @ResponseBody
@RequestMapping(value = { "/produceOtp" }, produces = {MediaType.APPLICATION_JSON_VALUE}) @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); static final Logger logger = LoggerFactory.getLogger(SafeController.class);
@Autowired @Autowired
private UserInfoService userInfoService; UserInfoService userInfoService;
@RequestMapping(value="/forward/setting") @RequestMapping(value="/forward/setting")
public ModelAndView fowardSetting(@CurrentUser UserInfo currentUser) { public ModelAndView fowardSetting(@CurrentUser UserInfo currentUser) {

View File

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

View File

@ -51,7 +51,7 @@ public class LoginAppsHistoryController {
static final Logger logger = LoggerFactory.getLogger(LoginAppsHistoryController.class); static final Logger logger = LoggerFactory.getLogger(LoginAppsHistoryController.class);
@Autowired @Autowired
protected HistoryLoginAppsService historyLoginAppsService; HistoryLoginAppsService historyLoginAppsService;
/** /**
* @param loginAppsHistory * @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; HistoryLoginAppsService historyLoginAppsService;
@Autowired @Autowired
protected AppsService appsService; AppsService appsService;
/** /**
* postHandle . * postHandle .

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,7 +33,7 @@ public class LogoutEndpoint {
private static Logger logger = LoggerFactory.getLogger(LogoutEndpoint.class); private static Logger logger = LoggerFactory.getLogger(LogoutEndpoint.class);
@Autowired @Autowired
protected SessionManager sessionManager; SessionManager sessionManager;
@GetMapping(value={"/logout"}) @GetMapping(value={"/logout"})
public Message<?> logout(HttpServletRequest request,@CurrentUser UserInfo currentUser){ 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); static final Logger logger = LoggerFactory.getLogger(LoginAppsHistoryController.class);
@Autowired @Autowired
protected HistoryLoginAppsService historyLoginAppsService; HistoryLoginAppsService historyLoginAppsService;
/** /**
* @param loginAppsHistory * @param loginAppsHistory

View File

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

View File

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