{"action":"opened","issue":{"url":"https://api.github.com/repos/wangliguo123321/Blog/issues/1","repository_url":"https://api.github.com/repos/wangliguo123321/Blog","labels_url":"https://api.github.com/repos/wangliguo123321/Blog/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/wangliguo123321/Blog/issues/1/comments","events_url":"https://api.github.com/repos/wangliguo123321/Blog/issues/1/events","html_url":"https://github.com/wangliguo123321/Blog/issues/1","id":306459209,"number":1,"title":"依赖注入（DI）装配（wiring）","user":{"login":"wangliguo123321","id":31795518,"avatar_url":"https://avatars1.githubusercontent.com/u/31795518?v=4","gravatar_id":"","url":"https://api.github.com/users/wangliguo123321","html_url":"https://github.com/wangliguo123321","followers_url":"https://api.github.com/users/wangliguo123321/followers","following_url":"https://api.github.com/users/wangliguo123321/following{/other_user}","gists_url":"https://api.github.com/users/wangliguo123321/gists{/gist_id}","starred_url":"https://api.github.com/users/wangliguo123321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangliguo123321/subscriptions","organizations_url":"https://api.github.com/users/wangliguo123321/orgs","repos_url":"https://api.github.com/users/wangliguo123321/repos","events_url":"https://api.github.com/users/wangliguo123321/events{/privacy}","received_events_url":"https://api.github.com/users/wangliguo123321/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-19T13:20:23Z","updated_at":"2018-03-19T13:20:23Z","closed_at":null,"author_association":"OWNER","body":"\r\n# 三种不同的方式专配Bean\r\n\r\n## - 自动配置\r\n### 自动扫描（component scanning)\r\n@Configuration\r\n@ComponentScan（basePackages={\"类“} or    basePackages={basePackages={”包“}）\r\n\r\n### 自动装配(autowiring)\r\n@Autowired  //构造方法之前添加,也可用@Injuect 不过使用的比较少\r\n\r\n## JAVA配置（类型安全）\r\n### 创建配置类\r\n@Connfiguration 于类前注解\r\n### 声明Bean\r\n@Bean  于方法前注解\r\n\r\n### 若方法中存在依赖，仍可用@Bean来进行注解如下\r\n\r\n@Bean\r\npublic CDPlayer cdPlayer(){\r\n    return new CDPlayer(compactDisc)\r\n}\r\n## -XML配置\r\n### 声明\r\n<bean id = \"name\" class = \"类.方法＞\r\n构造器注入Bean         <constructor -arg ref=\"compactDisc\"/>\r\n构造器注入字面量      <constructor -arg value = “传递值”/>\r\n构造器注入集合          \r\n<constructor -arg>\r\n        <list>\r\n                 <value>......</value>\r\n                 <value>......</value>\r\n                 <value>......</value>\r\n                 <value>......</value>\r\n                 \r\n         <list>\r\n</constructor>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"wangliguo123321"}}