Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
Details
Activity
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
曲欣亮
shop
Commits
2fb15e19
Commit
2fb15e19
authored
Jan 11, 2019
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
87469c5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
40 deletions
+40
-40
ShopApplication.java
src/main/java/com/egolm/shop/ShopApplication.java
+40
-40
No files found.
src/main/java/com/egolm/shop/ShopApplication.java
View file @
2fb15e19
package
com
.
egolm
.
shop
;
package
com
.
egolm
.
shop
;
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.cache.annotation.EnableCaching
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@EnableCaching
@EnableCaching
@EnableSwagger2
@EnableSwagger2
@SpringBootApplication
@SpringBootApplication
@EnableTransactionManagement
@EnableTransactionManagement
public
class
ShopApplication
{
public
class
ShopApplication
{
private
static
ApplicationContext
applicationContext
;
private
static
ApplicationContext
applicationContext
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
applicationContext
=
SpringApplication
.
run
(
ShopApplication
.
class
,
args
);
applicationContext
=
SpringApplication
.
run
(
ShopApplication
.
class
,
args
);
}
}
public
static
ApplicationContext
getApplicationContext
()
{
public
static
ApplicationContext
getApplicationContext
()
{
return
applicationContext
;
return
applicationContext
;
}
}
public
static
Object
getBean
(
String
name
){
public
static
Object
getBean
(
String
name
){
return
getApplicationContext
().
getBean
(
name
);
return
getApplicationContext
().
getBean
(
name
);
}
}
public
static
<
T
>
T
getBean
(
Class
<
T
>
clazz
){
public
static
<
T
>
T
getBean
(
Class
<
T
>
clazz
){
return
getApplicationContext
().
getBean
(
clazz
);
return
getApplicationContext
().
getBean
(
clazz
);
}
}
public
static
<
T
>
T
getBean
(
String
name
,
Class
<
T
>
clazz
){
public
static
<
T
>
T
getBean
(
String
name
,
Class
<
T
>
clazz
){
return
getApplicationContext
().
getBean
(
name
,
clazz
);
return
getApplicationContext
().
getBean
(
name
,
clazz
);
}
}
}
}
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