Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
0e4dcd82
Commit
0e4dcd82
authored
Aug 09, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实例化关系
parent
aa9f6cea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
DbExecuteImpl.java
.../src/main/java/com/yanzuoguang/db/impl/DbExecuteImpl.java
+2
-1
MessageServiceImpl.java
...a/com/yanzuoguang/mq/service/impl/MessageServiceImpl.java
+4
-2
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/db/impl/DbExecuteImpl.java
View file @
0e4dcd82
...
...
@@ -13,6 +13,7 @@ import org.springframework.jdbc.core.RowCallbackHandler;
import
org.springframework.jdbc.support.rowset.SqlRowSet
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
...
...
@@ -30,6 +31,7 @@ public class DbExecuteImpl implements DbExecute, ApplicationContextAware {
private
ConfigDb
configDb
;
@Resource
private
JdbcTemplate
jdbc
;
/**
...
...
@@ -50,7 +52,6 @@ public class DbExecuteImpl implements DbExecute, ApplicationContextAware {
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
this
.
printSql
=
applicationContext
.
getBean
(
DbPrintSql
.
class
);
this
.
configDb
=
applicationContext
.
getBean
(
ConfigDb
.
class
);
this
.
jdbc
=
applicationContext
.
getBean
(
JdbcTemplate
.
class
);
}
public
JdbcTemplate
getJdbc
()
{
...
...
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/impl/MessageServiceImpl.java
View file @
0e4dcd82
...
...
@@ -20,6 +20,7 @@ import org.springframework.context.*;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -36,9 +37,11 @@ public class MessageServiceImpl implements MessageService, ApplicationContextAwa
* 用于内部自引用,调用事物
*/
private
MessageDao
messageDao
;
private
MyRabbitTemplate
rabbitTemplate
;
private
YzgMqProcedure
yzgMqProcedure
;
@Resource
private
MyRabbitTemplate
rabbitTemplate
;
/**
* Set the ApplicationContext that this object runs in.
* Normally this call will be used to initialize the object.
...
...
@@ -56,7 +59,6 @@ public class MessageServiceImpl implements MessageService, ApplicationContextAwa
@Override
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
messageDao
=
applicationContext
.
getBean
(
MessageDao
.
class
);
rabbitTemplate
=
applicationContext
.
getBean
(
MyRabbitTemplate
.
class
);
yzgMqProcedure
=
applicationContext
.
getBean
(
YzgMqProcedure
.
class
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment