|
@@ -1,7 +1,9 @@
|
1
|
1
|
import com.Config.JdbcUtil;
|
2
|
2
|
import com.Config.SpringConfiguration;
|
|
3
|
+import com.Config.TestConfiguration;
|
3
|
4
|
import com.alibaba.druid.pool.DruidDataSource;
|
4
|
5
|
import com.alibaba.druid.pool.DruidPooledConnection;
|
|
6
|
+import com.entity.User;
|
5
|
7
|
import com.service.JwtService;
|
6
|
8
|
import com.service.StudentService;
|
7
|
9
|
import com.service.UserService;
|
|
@@ -14,14 +16,16 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
14
|
16
|
public class AnnotationMain {
|
15
|
17
|
public static void main(String[] args) throws Exception{
|
16
|
18
|
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringConfiguration.class);
|
17
|
|
- Object jdbcUrl = applicationContext.getBean("getJdbcUrl");
|
18
|
|
- StudentService bean = applicationContext.getBean(StudentService.class);
|
19
|
|
- JwtService bean1 = applicationContext.getBean(JwtService.class);
|
20
|
|
- String s = bean1.generateToken("123");
|
21
|
|
- bean1.parseToken(s);
|
22
|
|
- UserService userService = applicationContext.getBean(UserService.class);
|
23
|
|
- userService.addUserBatch();
|
24
|
|
- System.out.println(JdbcUtil.URL);
|
|
19
|
+// Object jdbcUrl = applicationContext.getBean("getJdbcUrl");
|
|
20
|
+// StudentService bean = applicationContext.getBean(StudentService.class);
|
|
21
|
+// JwtService bean1 = applicationContext.getBean(JwtService.class);
|
|
22
|
+// String s = bean1.generateToken("123");
|
|
23
|
+// bean1.parseToken(s);
|
|
24
|
+// UserService userService = applicationContext.getBean(UserService.class);
|
|
25
|
+// userService.addUserBatch();
|
|
26
|
+ TestConfiguration bean2 = applicationContext.getBean(TestConfiguration.class);
|
|
27
|
+ User user1 = applicationContext.getBean("user1", User.class);
|
|
28
|
+ User user11 = bean2.getUser1();
|
25
|
29
|
// JdbcUtil bean2 = applicationContext.getBean(JdbcUtil.class);
|
26
|
30
|
}
|
27
|
31
|
}
|