代码优化
This commit is contained in:
73
src/main/java/com/rj/common/ServiceManager.java
Normal file
73
src/main/java/com/rj/common/ServiceManager.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package com.rj.common;
|
||||
|
||||
import com.rj.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Service管理器
|
||||
* 统一管理所有常用的Service注入,减少Controller中的重复注入
|
||||
*
|
||||
* @author 系统生成
|
||||
* @since 2025-08-07
|
||||
*/
|
||||
@Component
|
||||
public class ServiceManager {
|
||||
|
||||
@Autowired
|
||||
private IDealershipService dealershipService;
|
||||
|
||||
@Autowired
|
||||
private IProjectManagementService projectManagementService;
|
||||
|
||||
@Autowired
|
||||
private ISalesManagementService salesManagementService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerManagementService customerManagementService;
|
||||
|
||||
@Autowired
|
||||
private IDeviceManagementService deviceManagementService;
|
||||
|
||||
@Autowired
|
||||
private IAudioManagementService audioManagementService;
|
||||
|
||||
@Autowired
|
||||
private IVideoManagementService videoManagementService;
|
||||
|
||||
@Autowired
|
||||
private IReservationService reservationService;
|
||||
|
||||
// Getter方法
|
||||
public IDealershipService getDealershipService() {
|
||||
return dealershipService;
|
||||
}
|
||||
|
||||
public IProjectManagementService getProjectManagementService() {
|
||||
return projectManagementService;
|
||||
}
|
||||
|
||||
public ISalesManagementService getSalesManagementService() {
|
||||
return salesManagementService;
|
||||
}
|
||||
|
||||
public ICustomerManagementService getCustomerManagementService() {
|
||||
return customerManagementService;
|
||||
}
|
||||
|
||||
public IDeviceManagementService getDeviceManagementService() {
|
||||
return deviceManagementService;
|
||||
}
|
||||
|
||||
public IAudioManagementService getAudioManagementService() {
|
||||
return audioManagementService;
|
||||
}
|
||||
|
||||
public IVideoManagementService getVideoManagementService() {
|
||||
return videoManagementService;
|
||||
}
|
||||
|
||||
public IReservationService getReservationService() {
|
||||
return reservationService;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user