更改Authowired

master
Number7 2024-08-08 10:58:43 +08:00
parent 0b0097d508
commit cf8df36494
3 changed files with 19 additions and 5 deletions

View File

@ -2,8 +2,10 @@ package com.muyu.cloud.pay;
import com.muyu.common.security.annotation.EnableCustomConfig; import com.muyu.common.security.annotation.EnableCustomConfig;
import com.muyu.common.security.annotation.EnableMyFeignClients; import com.muyu.common.security.annotation.EnableMyFeignClients;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
/** /**
* @Authorliuxinyue * @Authorliuxinyue
@ -12,13 +14,20 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @nameMuYuApplication * @nameMuYuApplication
* @Date2024/7/29 20:59 * @Date2024/7/29 20:59
*/ */
@Log4j2
@EnableCustomConfig @EnableCustomConfig
@EnableMyFeignClients @EnableMyFeignClients
@SpringBootApplication @SpringBootApplication
public class MuYuApplication { public class MuYuApplication {
public static void main (String[] args) { public static void main (String[] args) {
SpringApplication.run(MuYuApplication.class, args); ConfigurableApplicationContext applicationContext = SpringApplication.run(MuYuApplication.class, args);
String[] beanDefinitionNames = applicationContext.getBeanFactory().getBeanDefinitionNames();
for (String beanDefinitionName : beanDefinitionNames) {
log.info("beanDefinitionName:{}"+ beanDefinitionName);
}
} }
} }

View File

@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@ -32,7 +33,8 @@ public class OrderPayCustomerServiceController {
/** /**
* *
*/ */
private final OrderPayCustomerService orderPayCustomerService; @Autowired
private OrderPayCustomerService orderPayCustomerService;
/** /**
@ -48,7 +50,6 @@ public class OrderPayCustomerServiceController {
} }
/** /**
* *
* @return * @return
@ -63,4 +64,8 @@ public class OrderPayCustomerServiceController {
); );
} }
} }

View File

@ -38,11 +38,11 @@ public class OrderPayCustomerServiceImpl
extends ServiceImpl<OrderPayCustomerMapper, OrderPayCustomer> extends ServiceImpl<OrderPayCustomerMapper, OrderPayCustomer>
implements OrderPayCustomerService{ implements OrderPayCustomerService{
@Resource(type = OrderPayServiceImpl.class) @Autowired
private OrderPayService orderPayService; private OrderPayService orderPayService;
@Resource @Autowired
private NacosServerService nacosServerService; private NacosServerService nacosServerService;