我想将三个属性( 、 和 )初始化companyTypes
为carrierLists
全局cabinLevels
变量:
@Controller
@RequestMapping("/backend/basic")
public class TicketRuleController {
@Autowired
private CarrierService carrierService;
@Autowired
private CabinLevelService cabinLevelService;
@Autowired
private CompanyTypeService companyTypeService;
private List<DTOCompanyType> companyTypes = companyTypeService.loadAllCompanyTypes();
private List<DTOCarrier> carrierLists = carrierService.loadAllCarriers();
private List<DTOCabinLevel> cabinLevels = cabinLevelService.loadAllCabinLevel();
...
}
我怎样才能做到这一点?