forked from wuyouzhuguli/SpringAll
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75b71a0
commit 951a3d2
Showing
8 changed files
with
632 additions
and
0 deletions.
There are no files selected for viewing
289 changes: 289 additions & 0 deletions
289
56.Spring-Boot-MongoDB-crud/Mongo DB crud.postman_collection.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,289 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "8fa1e028-3088-4d19-bb08-4d41b3802487", | ||
"name": "Mongo DB crud", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "createUser", | ||
"request": { | ||
"method": "POST", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "localhost:8080/user?name=mike&description=python developer&age=21", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "8080", | ||
"path": [ | ||
"user" | ||
], | ||
"query": [ | ||
{ | ||
"key": "name", | ||
"value": "mike" | ||
}, | ||
{ | ||
"key": "description", | ||
"value": "python developer" | ||
}, | ||
{ | ||
"key": "age", | ||
"value": "21" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "getUsers", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "localhost:8080/user", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "8080", | ||
"path": [ | ||
"user" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "getUser", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "localhost:8080/user/5ca56280f08f0b6048fd470b", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "8080", | ||
"path": [ | ||
"user", | ||
"5ca56280f08f0b6048fd470b" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "updateUser", | ||
"request": { | ||
"method": "PUT", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "localhost:8080/user/5ca40ee8f08f0b68cc06c001?id=5ca56280f08f0b6048fd470b&description=Java gosu&age=19", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "8080", | ||
"path": [ | ||
"user", | ||
"5ca40ee8f08f0b68cc06c001" | ||
], | ||
"query": [ | ||
{ | ||
"key": "id", | ||
"value": "5ca56280f08f0b6048fd470b" | ||
}, | ||
{ | ||
"key": "description", | ||
"value": "Java gosu" | ||
}, | ||
{ | ||
"key": "age", | ||
"value": "19" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "deleteUser", | ||
"request": { | ||
"method": "DELETE", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "localhost:8080/user/5ca56280f08f0b6048fd470b", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "8080", | ||
"path": [ | ||
"user", | ||
"5ca56280f08f0b6048fd470b" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "getUsersStream", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "localhost:8080/user/stream", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "8080", | ||
"path": [ | ||
"user", | ||
"stream" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "getUserByAge", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "localhost:8080/user/age/20/30", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "8080", | ||
"path": [ | ||
"user", | ||
"age", | ||
"20", | ||
"30" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "getUserByName", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "localhost:8080/user/name/mrbird", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "8080", | ||
"path": [ | ||
"user", | ||
"name", | ||
"mrbird" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "getUserByDescription", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "localhost:8080/user/description/ui", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "8080", | ||
"path": [ | ||
"user", | ||
"description", | ||
"ui" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "getUserByCondition", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "localhost:8080/user/condition?size=2&page=0", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "8080", | ||
"path": [ | ||
"user", | ||
"condition" | ||
], | ||
"query": [ | ||
{ | ||
"key": "name", | ||
"value": "mrbird", | ||
"disabled": true | ||
}, | ||
{ | ||
"key": "description", | ||
"value": "r", | ||
"disabled": true | ||
}, | ||
{ | ||
"key": "size", | ||
"value": "2" | ||
}, | ||
{ | ||
"key": "page", | ||
"value": "0" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.1.3.RELEASE</version> | ||
<relativePath/> <!-- lookup parent from repository --> | ||
</parent> | ||
<groupId>com.example</groupId> | ||
<artifactId>mongodb</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<name>mongodb</name> | ||
<description>Demo project for Spring Boot</description> | ||
|
||
<properties> | ||
<java.version>1.8</java.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-mongodb</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
13 changes: 13 additions & 0 deletions
13
56.Spring-Boot-MongoDB-crud/src/main/java/com/example/mongodb/MongodbApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.example.mongodb; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class MongodbApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(MongodbApplication.class, args); | ||
} | ||
|
||
} |
Oops, something went wrong.