Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-mongodb
Overview
Overview
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
cemarose
spring-boot-mongodb
Commits
4b93f469
Commit
4b93f469
authored
Jul 16, 2018
by
jwrwst
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释
parent
70eb2a20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
MongoConfig.java
src/main/java/com/cemarose/mongodb/config/MongoConfig.java
+9
-3
No files found.
src/main/java/com/cemarose/mongodb/config/MongoConfig.java
View file @
4b93f469
package
com
.
cemarose
.
mongodb
.
config
;
import
com.mongodb.*
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.parsing.Location
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.mongodb.MongoDbFactory
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.SimpleMongoDbFactory
;
...
...
@@ -13,8 +10,17 @@ import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties
(
prefix
=
"spring.data.mongodb"
)
public
class
MongoConfig
{
/**
* host主机ip
*/
private
String
host
;
/**
* port端口号
*/
private
Integer
port
;
/**
* mongo地址
*/
private
String
uri
;
/**
...
...
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